Closed daissatou2 closed 3 years ago
@daissatou2 changes done
referral_services
present: https://www.openfn.org/projects/pd3yk4/runs/renm57xd
referral_services
missing: https://www.openfn.org/projects/pd3yk4/runs/rmknyr6z
referral_services
& CommCare_Ext_ID__C
type 1 present: https://www.openfn.org/projects/pd3yk4/runs/r5e8awkg
referral_services
& CommCare_Ext_ID__C
type 2 present: https://www.openfn.org/projects/pd3yk4/runs/raay3eje
referral_services
present but fields for CommCare_Ext_ID__C
missing: https://www.openfn.org/projects/pd3yk4/runs/rya4je6g
The last one is failing but I assume it's normal since there is no CommCare_Ext_ID__C
to upsert with.
Describe the bug
I made a change to the
Upsert Risk & Vulnerability Assessment | Service Referral
job today to address an issue the client flagged. However, my changes are currently failing. Basically, there are various versions of this job that we need to be able to handle.Feel free to revert my changes from today, the intended changes are below:
NewReferral
ifreferral_services
is in the message (like this message). Here's another message wherereferral_services
is missing and so the job should end gracefully and log a message that says "no referrals to upsert".CommCare_Ext_ID__c
field can come from 1 of two places:state.data.form.subcase_0.case['@case_id']
like in this message AND/ORstate.data.form.referral_services.art_support_services.skillz_plus_club_details.create_skillz_plus_club_participant_case.case['@case_id']
like in this message.If neither of these fields for the
CommCare_Ext_ID__c
are present (even thoughreferral_services
is), the job should again end gracefully and log a message that says "no referrals to upsert". Example message here. (If both are present just pick anyone, the ID will be the same).To Reproduce
expression.js
Link to the job itself in Github: https://github.com/OpenFn/grassroot-soccer/blob/master/jobs/upsertRiskVulnerabilityNewReferrals.js
state.json
referral_services
present: https://www.openfn.org/projects/pd3yk4/messages/mwbebqkareferral_services
missing: https://www.openfn.org/projects/pd3yk4/messages/mrb5m87areferral_services
&CommCare_Ext_ID__C
type 1 present: https://www.openfn.org/projects/pd3yk4/messages/mpq8gb3qreferral_services
&CommCare_Ext_ID__C
type 2 present: https://www.openfn.org/projects/pd3yk4/messages/m3p4p3vpreferral_services
present but fields forCommCare_Ext_ID__C
missing: https://www.openfn.org/projects/pd3yk4/messages/mn58k3qzExpected behavior
See above. Everything else in this job relating to Risk Assessment should remain the same.
To test/resolve