Closed aleksa-krolls closed 4 years ago
@aleksa-krolls , Am I right to read that step 2 and 3 are the same as flow 2? If so, I recommend that we have these steps triggered by either f2-j1 (get clients) or f2-j2 (get cases.) Better yet, it looks like that's the SAME api? In other words, this flow dissapears entirely and is handled by #3
I am closing this issue as it's been confirmed that it will be covered by issue #3 . @aleksa-krolls , feel free to re-open if things change.
User Story Flow 4: Sending Referrals to Primero On a daily basis, (1) fetch new client referrals from OSCaR. Then (2) check if that client exists in Primero, and either (2a) update the existing case, or (2b) create a new case.
> Step 1 (Every 24hrs): Fetch new client referrals from OSCaR
curl -X POST -v -H 'Content-Type: application/json' http://start.oscarhq-staging.com/api/v1/auth/sign_in -d '{"email": "api.user@example.com", "password": "enter-pwd" }'
GET /api/v1/organizations/clients?since_date&referred_external=true
> Step 2 (Diagram Step 5): Check if case exists in Primero
GET /api/cases/:id?locale=en&mobile=true
>> Step 2a (Diagram Step 9): Existing case found in Primero, update case
PATCH /api/cases/:id
patch_update_cases_primero.json
>> Step 2b (Diagram Step 9): No existing case found in Primero, create new case and referral??
POST /api/cases
post_new_cases_primero.json
>> Step 3: Send Primero case_ids back to OSCaR
PUT to /api/v1/organizations/clients/update_links/
put_update_client_links_oscar.json
ResourcesCredentials