Closed aleksa-krolls closed 4 years ago
When OpenFn sends a GET request to Primero, there are 3 potential responses:
transitions
transitions_changed_at
{ owned_by: 'primero', owned_by_agency: 'agency-unicef', owned_by_phone: '12345676867867876', module_id: 'primeromodule-cp', created_at: '2020/06/23 08:59:18 +0000', case_id_display: '0ae445f', name_first: 'Pedro', name_last: 'test', sex: 'female', date_of_birth: '2015/01/01', services_section: [ [Object], [Object] ], _id: '20cddfa26b10a439d5f2e3203cf99d10', case_id: '875303e6-840c-4bfa-af5f-293ed0ae445f', transitions_changed_at: '2020/06/28 22:22:48 +0000' }
Before we wrongly assumed that there would always be a transitions object which is not the case for response type 3. Can you please update these logs to either show transitions_changed_at AND/OR transitions.created_at (if it exists)? https://github.com/OpenFn/unicef-cambodia/blob/05077d36e99ebfce2c004bee757213049a50d2e5/jobs/f1-j1-getPrimeroCases.js#L36-L67
transitions.created_at
When OpenFn sends a GET request to Primero, there are 3 potential responses:
transitions
object - standard response we've been expecting)transitions
object included; in this scenario onlytransitions_changed_at
may be sent - see below)Before we wrongly assumed that there would always be a
transitions
object which is not the case for response type 3. Can you please update these logs to either showtransitions_changed_at
AND/ORtransitions.created_at
(if it exists)? https://github.com/OpenFn/unicef-cambodia/blob/05077d36e99ebfce2c004bee757213049a50d2e5/jobs/f1-j1-getPrimeroCases.js#L36-L67