Additional Information
The script that produces the errors report JSON data is here: https://github.com/ACMGca/certs_to_memberships/blob/main/util/parseAll.js
The overall process goes like this:
- The Cognito Profile object is reduced to a smaller subset of the essential information. https://github.com/ACMGca/certs_to_memberships/blob/main/util/helpers.js#L17
- The Cognito 'certs' object goes through a schema validator that sets the rules for what shape it needs to be in. This has 2 parts - it both tries to correct problems in the data (if possible)
and it registers specific errors on the object so we know why it was rejected. https://github.com/ACMGca/certs_to_memberships/blob/main/schema/cognito_certificates_schema.js (note the 'transform' and 'addIssue' blocks). If it doesn't make it through this - that's a Parse Error.
Where the schema validator actually changes the data, it leaves a note about what was changed in the 'transforms' attribute of the resulting object.
This step in the process also coalesces any Apprentice and Permanent Apprentice certificate records into one regular apprentice record. It marks the
replaced certificate with an additional attribute showing isPermanent: true
- If the Cognito Certs object makes it through the schema validation, then we pass it to the converter: https://github.com/ACMGca/certs_to_memberships/blob/main/util/convert.js#L51.
Internally, that iterates over all the Cognito Certificates and turns them, roughly, into the right kind of Wicket Membership Tier (including the supersedence rules).
Once those are all built, then it runs through it again to:
- Remove 'one-day' memberships
- Apply the 'Winter Travel' conversion
- Add IFMGA Membership (where applicable)
- (TODO: add interrupted membership logic)
- (TODO: add the CGI3 to CGI2 conversion logic)
- (TODO: add DHGW logic)
NOTE: Absence of parsing or conversion error does not necessarily indicate correct conversion. Continued manual review and
additional detailed test cases are planned. This is all work in progress. If you find profiles you want to flag for review and
testing, note the Cognito URL via the link for the Row # and send it to Mark with your comments via email.
Formal test cases are used to lock in the correct behaviors. This work is ongoing. Just because a profile lacks parse or conversion errors does not mean that it is correct (at this stage).
See: https://github.com/ACMGca/certs_to_memberships/blob/main/test/util/convert.test.js