OpenFn / unicef-cambodia

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

Add mappings to logs for upsert jobs #82

Closed daissatou2 closed 2 years ago

daissatou2 commented 2 years ago

Feature Request

Background, context, and business value

Please update the logs for the jobs below to show all the field mappings. This will make it easier for us to verify the mappings.

DO NOT DELETE OLD LOGS. Please comment out the old logging in case the client wants us to change this back (they wanted very specific logging in the past).

Jobs to update: https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/V2/f1-j2-casesToOscar.js https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/V2/f2-j2-upsertCasesToPrimero.js

The Primero-Progres job logging is a great example: https://www.openfn.org/projects/primero-progres-v4-staging/runs/06193d4c-d328-7fb4-9422-1dc153692154

lakhassane commented 2 years ago

@daissatou2 logs are added

daissatou2 commented 2 years ago

Hi @lakhassane can you please double check that this is implemented? Some fields are still missing.. For example, in this run service_type is missing.

lakhassane commented 2 years ago

@daissatou2 please could you tell where in the logs we shouild have service_type? There are many different logs in the run :confused:

Also there is no service_type in the data we send to primero https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/V2/f2-j2-upsertCasesToPrimero.js#L507-L560

aleksa-krolls commented 2 years ago

@lakhassane The issue is right now the logs are all hardcoded... this custom logging was originally for security reasons, but it makes testing difficult because we can't see ALL the data points being exchanged. Please comment these logs out (for now... we will add them back later before go-live).

Then, add new logs so that we see the raw payload of ALL fields that are being passed between systems. Show all state.data for (1) Data provided by Oscar and... (2)Data provided to Primero for upload 'upsertCase'

This will enable @daissatou2 to critique the mappings more easily and ensure all necessary data points are being exchanged. Ping me on Slack if you want to talk this through.

lakhassane commented 2 years ago

@daissatou2 I updated logs to show all the content of state.data instead of hardcoding. You should be good to go.