VRMS
VRMS copied to clipboard
Provide Mock responses for user check in
Overview
Decide what records we need to create/consume for user story #4 (Volunteer check-in).
Action Items
Check_in: From Fang/PD:
- [x] get all (today's) events response
- [x] get user by id response
Resources/Instructions
People Depot ERD: https://lucid.app/lucidchart/ac2f3e81-00d2-4257-b1fc-266d7f0a4cbe/view?page=0_0#
Responses
Note that all the ids are strings. In reality, they're uuid string that are over 10 characters long, but I'm using simple strings as a quick example.
For check-in, the frontend requires a list of all projects that are meeting, preferably filtered down to today or even "now".
-
For something like getEventsByTime("now"), it would return a javascript object that's an array of objects. The important data here are all the project_id fields for use in the next step. In reality, the array would have a single object in most cases because it should be filtering based on the logged in user's projects.
let events = [ { "id": "1", "project_id": "1", "description": "Team Meeting", "video_conference_url": "https://zoom.com/meetingid", ... }, { "id": "2", "project_id": "2", "description": "Team Meeting", "video_conference_url": "https://zoom.com/meetingid", ... }, ... ] return events
-
Then, it needs to look up the project names.
loop through the values in events and do something like getProjectById(1) to get a list of them for display. It should return something like
{ "id": "1", "name": "VRMS", ... }
-
~~Then, look up user by email.~~ This is not needed since the user is logged in.
~~Something like getUserByEmail("[email protected]")~~
-
Lastly, create the check_in record when the user clicks the "log in" button
Something like createCheckIn(event_id="1", user_id="1"). It should automatically set checked_in to "now". Let's say the logged in user's id is "1" It probably returns a form of success or no error.
user and event tables and fields
I added examples for what should be called returned for the user story to work. Let me know if this works or needs something else.
Thanks fang!
@fyliu can we actually get all the columns that will be returned when we hit the all events api?
Can we also have a get user by id response?
@jbubar I added screenshots of what the tables contain. Those fields would all be returned, but I think for this user story, we only care about the project_id in the event, and then getting the project name from the project table.
I think it's modeled after how VRMS had it, only the data is spread out in tables with relationships between them
It looks like the v4 design for the check in is just a notification and a check in button. Since the user is logged in, we know what few projects they're a member of and which of those are currently meeting.
I updated the responses for this scenario.
So I would like some actual sample data for all the relevant endpoints
So Maybe for GET api/endpoints it would be..
{
"id": "1",
"project_id": "1",
"description": "Team Meeting",
"video_conference_url": "https://zoom.com/meetingid",
"location_id": "1",
"alt_address_1": "",
"alt_address_2": "",
"alt_location_city": "",
"alt_location_state": "",
"alt_address_zip": "",
"start_date_time": "",
"duration_in_min": "",
"recurring_event_id": "",
"created_date": "",
"check_in_ready": "",
},
{
"id": "2",
"project_id": "2",
"description": "Team Meeting",
"video_conference_url": "https://zoom.com/meetingid",
...
},
]
Not sure why this issue is needed.