OpenFn / unicef-cambodia

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

Primero upserts not working; case_id undefined #46

Closed aleksa-krolls closed 4 years ago

aleksa-krolls commented 4 years ago

I'm worried we broke something in our recent round of changes that causing all sorts of testing questions... it looks like case_id is returning undefined when we would expect to see a value.

See L463 in this run and below. Logs show "case_id": "or_op||undefined" when there is indeed "case_id": "a1f4a4f9-ee68-4a94-89b2-96ddc868bc97".


Data provided to Primero `upsertCase`:  {
  "remote": true,
  "oscar_number": "01EDQTSXMDH49F6N4D0YQ2FXJY",
  "child": {
    "case_id": "a1f4a4f9-ee68-4a94-89b2-96ddc868bc97",
    "oscar_number": "01EDQTSXMDH49F6N4D0YQ2FXJY",
    "oscar_short_id": "xgbp-1775",
    "oscar_status": "Accepted",
    "owned_by": "agency-cif-user",
    "consent_for_services": true,
    "disclosure_other_orgs": true,
    "interview_subject": "other",
    "content_source_other": "OSCaR",
    "module_id": "primeromodule-cp",
    "registration_date": "2020/07/21",
    "services_section": [],
    "transitions": []
  }
}
Upserting: {
  "method": "GET",
  "url": "https://cpims-kh-alpha.primero.org/api/cases",
  "jar": true,
  "qs": {
    "remote": true,
    "scope": {
      "or": {
        "oscar_number": "or_op||01EDQTSXMDH49F6N4D0YQ2FXJY",
        "case_id": "or_op||undefined"
      }
    }
  }
}
No case found. Performing create.