OpenFn / unicef-cambodia

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

Exclude 'demo' cases from F2: Oscar --> Primero sync #75

Closed aleksa-krolls closed 3 years ago

aleksa-krolls commented 3 years ago

Request

If Oscar case "organization_name": "demo", then DO NOT map to Primero. This is to ensure no dummy data created by admins in Oscar prod is synced with Primero. This will require changes in f2-j2... https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/f2-j2-upsertCasesToPrimero.js

Note: This should be implemented before the OSCaR --> Primero historical sync is run.

state

To test, use these LP creds... Oscar creds: Oscar Production Demo Primero creds: Primero Staging Thailand

See sample state: https://github.com/OpenFn/unicef-cambodia/blob/master/sample_data/getOscarNew.json#L111

expression

https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/f2-j2-upsertCasesToPrimero.js

adaptor

language-primero

output

No "demo" cases will be synced from OSCaR --> Primero when we run this in production.

aleksa-krolls commented 3 years ago

@taylordowns2000 Looks good, but can you log which demo cases we drop? Otherwise it looks like OpenFn loses data.

  1. See this run when we GET cases from Oscar and includes demo case 01EX7KZ2J2ZN0ZZP085RQ0FNPM that I see in the logs: https://www.openfn.org/projects/pdngk6/runs/r89ndyrb
  2. We then upload non-Demo cases to Primero (id 01EX7KZ2J2ZN0ZZP085RQ0FNPM is missing... but would be good to record that we remove this): https://www.openfn.org/projects/pdngk6/runs/rbg3r747