Skip to content

api/v1/ for Case Contacts (iOS App) #3942

@FireLemons

Description

@FireLemons

What type(s) of user does this feature affect?

  • volunteers

Description
A volunteer needs to be able to use the app to save a case contact.

Approach

Authentication

HTTP Route Description Issue(s) Completed
POST /api/v1/users/sign_in Login #4976, #6216
POST /api/v1/users/sign_in/validate Validation
POST /api/v1/users/refresh_token Refresh Access Token
DELETE /api/v1/users/sign_out Log-Out #6241

Case Contact

HTTP Route Description Issue{s) Completed
GET /api/v1/case_contacts List Case Contacts (casa_cases)
GET /api/v1/case_contacts/:id Get Specific Case Contact
POST /api/v1/case_contacts Create new Case Contact
PATCH /api/v1/case_contacts/:id Update Specific Case Contact

For Additional Expenses (they are nested under Case Contacts)

HTTP Route Issue(s) Completed
POST /api/v1/case_contacts/:case_contact_id/additional_expenses
PATCH /api/v1/case_contacts/:case_contact_id/additional_expenses/:id
DELETE /api/v1/case_contacts/:case_contact_id/additional_expenses/:id

Requirements for /api/v1/

  1. Secure Authentication (token based) /api/v1/users/sign_in

    Foundation: iOS app can authenticate on sign_in endpoint Initial API Structure + Auth Route #4976, and below

    Token Refreshing: iOS app generates new access tokens when refresh token is still valid /api/v1/users/refresh_token

    Token Validating: iOS app can validate users session on endpoint /api/v1/users/validate

    Token Revoking: iOS app can Sign-Out users on sign_out endpoint /api/v1/users/sign_out

  2. Casa Case Endpoint for Signed-In Users /api/v1/casa_cases

    Milestone 1

    • Add authenticate user before_action to controller and validate user is signed-in
    • Signed-In user case contact data is accessible through POST request (only shallow fields meaning fields that don't reference a different table)
    • Make sure user can only see case contacts they have permission to see

    Milestone 2a

    • Can display errors

    Milestone 2b

    • Can accept new case contact and save it
    • Can create case contact drafts

    Milestone 2c (expand case contact data)

    • Add case contact creator to json
    • Add data from casa_case_contact_types to show which contact types are available to be selected for the case contact
    • Add data from case_contact_contact_types to show contact types have been selected on the case contact
    • Add data from contact_topic_answers to show sections of notes for the case contact
    • Add contact topics to show available contact topics to choose from

    Milestone 3a

    • Can update case contact and save it
    • Can update case contact drafts and save it

    Milestone 3b

    • Can delete drafts

We have jBuilder installed. It can help you if your json response is complicated. You can also use it to convert a rails object into json easily like this

Questions? Join Slack!

We highly recommend that you join us in slack https://rubyforgood.herokuapp.com/ #casa channel to ask questions quickly and hear about office hours (currently Tuesday 6-8pm Pacific), stakeholder news, and upcoming new issues.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In Progress

    Status

    No Prio

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions