OpenFn / unicef-cambodia

UNICEF Cambodia - Primero Interoperability
https://openfn.github.io/unicef-cambodia/
1 stars 2 forks source link

Update the f1-j2 job to not fail if no services have been passed from the f1-j1 job #108

Closed daissatou2 closed 2 years ago

daissatou2 commented 2 years ago

Feature Request

Background, context, and business value

The f2-j2 job currently fails if the parent-run retrieves a case and removes its services. See this example run. In the parent-run log, line 29 shows that we removed the service for the case.

The specific request, in as few words as possible

Instead of failing, the f2-j2 job should pass and log "no referrals to send".

state.json

f1-j1 job

{
"configuration": "Primero V2 Cambodia Demo (openfn_cp_user)",
}

f1-j2 job

{
"configuration": "Oscar Staging (api only user)",
"data": "Data will be generated from this job"
}

adaptor

language-http

expression.js

only update job in the V2 folder https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/V2/f1-j2-casesToOscar.js

daissatou2 commented 2 years ago

@taylordowns2000 you can test locally with "case_id": "a73b0bab-f236-4b48-aab2-2c0700a7daa5", after running the f1-j1 job.

taylordowns2000 commented 2 years ago

@daissatou2 , filtered out all cases w/o services: https://github.com/OpenFn/unicef-cambodia/commit/c5b751f32bc8e2f9aff38fe62d95719b0f063424