VRMS icon indicating copy to clipboard operation
VRMS copied to clipboard

Provide Mock responses for user check in

Open heyitsalexander opened this issue 2 years ago • 8 comments

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".

  1. 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
    
  2. 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", ... }

  3. ~~Then, look up user by email.~~ This is not needed since the user is logged in.

    ~~Something like getUserByEmail("[email protected]")~~

  4. 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

2022-09-13 10 54 40 lucid app 7b1da2fa7eeb 2022-09-13 10 55 26 lucid app 2e34178a2387

heyitsalexander avatar Sep 09 '22 02:09 heyitsalexander

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.

fyliu avatar Sep 13 '22 04:09 fyliu

Thanks fang!

jbubar avatar Sep 13 '22 15:09 jbubar

@fyliu can we actually get all the columns that will be returned when we hit the all events api?

jbubar avatar Sep 13 '22 15:09 jbubar

Can we also have a get user by id response?

jbubar avatar Sep 13 '22 15:09 jbubar

@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

fyliu avatar Sep 13 '22 18:09 fyliu

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.

2022-09-13 11 13 33 www figma com 45e2d3dfe103

I updated the responses for this scenario.

fyliu avatar Sep 13 '22 18:09 fyliu

So I would like some actual sample data for all the relevant endpoints

jbubar avatar Sep 23 '22 01:09 jbubar

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",
    ...
  },
]

jbubar avatar Sep 23 '22 01:09 jbubar

Not sure why this issue is needed.

JackHaeg avatar Apr 04 '24 23:04 JackHaeg