Skip to content

Instantly share code, notes, and snippets.

@daqo
Last active December 1, 2017 22:03
Show Gist options
  • Save daqo/2043bcd8b533708a3fc2af5e93da3157 to your computer and use it in GitHub Desktop.
Save daqo/2043bcd8b533708a3fc2af5e93da3157 to your computer and use it in GitHub Desktop.
Implementation details for Going/NotGoing Declation (Backend Perspective)
  1. Under user_type, we need to create a new acceptedOrganizations connection. This will return all the orgs that the current user is accepted into (based on funnel_state).

  2. Under user_type, we need to create a new connection named pendingAcceptedOrganizations. This will return all the orgs that a user has uos.pending_accepted field set for.

  3. The client is responsible for merging the result of #1 and #2. (Client's responsibility)

  4. For each item in the accepted organization listing, we rely on amAccepted field under organization_type. If it resolves to true, we show Set Going button. If it's false, we don't show that button and instead, the mobile client checks for amPendingAccepted field under organization_type. If that value is set, the mobile client shows "Pending Verification" badge.

  5. To upload the acceptance letter the mobile client needs to use FilePicker's client library to directly do the upload, and then it will supply the returned photo url to UpdateUserOrganizationPendingAccepted mutation. The inputs for that mutation are organizationId and acceptanceLetterUrl. This will set pending_accepted field on UOS. Note: When UpdateUserOrganizationPendingAccepted mutation is called, backend needs to make sure that user is following that organization.

  6. To change the going status, UpdateUserOrganizationGoing mutation needs to be called. The inputs for that mutation are organizationId and going. going param should be one of the following: going notgoing undecided. Note: definition of mark_going method under UOS model needs to be changed. Currently, it relies on UOS accepted field

  7. A new field named goingTo needs to be added to user_type. This field returns an OrganizationType object. If the user doesn't have a going org, it will return null.

  8. accept_reject class method in UOSAcceptedToCollege module needs to be reworked.

  9. Upon approval or rejection, the user should receive a push notification

Also, please read the following story in pivotal. It explains different use cases that we need to support: https://www.pivotaltracker.com/n/projects/1164082/stories/153229292

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment