bitcamp / event-admin

Bitcamp day-of tech, supplements dashboard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adjust the API response schema for better compatibility with the mobile app

zbreit opened this issue · comments

To better match the needs of the mobile app, we should restructure the following API routes:

Events

  • The Event object should be changed
// Should be this
{
    // Unique identifier
    id: string, 
    // Event title, displayed on every clickable event throughout the app
    title: string,
    // Short description, rendered under event cards on the home page
    caption: string,
    // Full description of the event
    description: string,
    // Room where the event takes place
    location: string,
    // List of event categories ordered by relevance
    categories: ["main" | "food" | "mini" | "workshop" | "sponsored", ...],
    // Start time
    startTime: ISOTimestamp,
    // End time (can be the same as the start)
    endTime: ISOTimestamp,
    // How many points the event is worth
    pointVal: int
}
// Instead of this
{
    "id": 0,
    "title": "string",
    "description": "string",
    "location": "string",
    "start_time": "string",
    "end_time": "string",
    "host": "string",             
    "created_by": "string",   
    "created_at": "string",      
    "updated_at": "string",
    "url": "string",  
    "tags": [] 
}
  • /events/following:
// Should be this:
[ int, ... ]  // Each string is an event id
// Instead of this:
[ EventObject, ... ]

Mentorship

  • Should be renamed to Questions
  • /questions: Should become an authenticated API request that, given a specific user token, returns that user's list of questions
  • The Question object should also include a slackUsername field, so mentors can respond to questions over slack
  • The question field in the Question object should have the type "string", not null
  • Add a new route: /questions/delete to delete a user's question

Announcements

  • The Announcement object should have a timestamp field indicating when it was created.

Other assorted changes

  • Make all API responses use camelCase instead of snake_case
  • Remove the APIKey authentication, and instead just use the HackerToken. Any request that can only be performed by organizers/admins will not allow users to modify