Skip to content

Instantly share code, notes, and snippets.

@trabianmatt
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trabianmatt/64e8b0348dcfbd482a39 to your computer and use it in GitHub Desktop.
Save trabianmatt/64e8b0348dcfbd482a39 to your computer and use it in GitHub Desktop.

Linked memberships

  • Does Joe represent each membership in the DB as a separate entity with its own ID, or do we reference it with both the user id and membership number?

    For example: POST to /api/users/1/membership/12345/link to link the membership, or POST to /api/associated_member/2394809834/link

  • Which actions do we need?
    • link (POST {base-membership-url}/link)
    • unlink (POST {base-membership-url}/unlink)
    • invite (POST {base-membership-url}/invite)
    • edit nickname (POST {base-membership-url} with body:
      {
        "nickname": "New Nickname"
      }              
              

      Passing an empty nickname should clear it out.

  • What information do we need?
    [{:member_number "123456"
      :nickname "Primary Membership"
      :access_level "full_access"
      :primary true
      :association "Joint Member"
      :relationship "Other"
      :editable true
      :status "linked"
      :contact_info {:email "sparks.mike@gmail.com"
                     :phone_list [{:type "home"
                                   :number "234 567-8910"}
                                  {:type "work"
                                   :number "344 923-1234"}]}}
     {:member_number "4323423"
      :name "Mom's account"
      :association "Joint Member"
      :relationship "Mother"
      :restricted true
      :status "available"
      :editable false
      :access_level "transactional"}
     {:member_number "923409"
      :nickname "Kelly's account"
      :access_level "full_access"
      :association "Joint Member"
      :relationship "Wife"
      :status "linked"
      :editable false
      :contact_source "123456"}]
        
    • Fields:
      • member_number
      • nickname
      • access_level (currently “full_access” or “transactional”)

        This is being used to populate the “Allowed Accounts” field, but the purpose is a bit unclear to me.

      • primary (boolean)
      • association (string)
      • relationship (string)
      • editable (boolean)
      • status (string - one of “linked”, “available”, “unenrolled”)
@trabianmatt
Copy link
Author

For the GET, I'm fine with passing the username in as a query param.

@sffirecujoe
Copy link

Ok Matt, I've updated the code (not deployed as of right now) so that you can do any of the following:

GET /users/{id}
GET /users?id={id}
GET /users?username={username}

In the even that both username and id are supplied, the username will be ignored.

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