Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As an implementer I can configure logic that determines the rules for MOSIP integration (birth and death) #7942

Open
naftis opened this issue Nov 8, 2024 · 1 comment

Comments

@naftis
Copy link
Collaborator

naftis commented Nov 8, 2024

Description

  • Custom business logic can be created to determine whether MOSIP processing should be triggered on registration or correction:
    • for birth: a UIN should be created if the business logic is satisfied (based on record fields + authentication of IDs, where available)
    • for death: a UIN should be deactivated if the business logic is satisfied (based on record fields + authentication of IDs, where available)
  • If business logic not satisfied, bypass the MOSIP processing. Processing continues in OpenCRVS as per action.
  • Business logic can be turned on/off as a configuration

Design

Acceptance criteria

@naftis
Copy link
Collaborator Author

naftis commented Nov 14, 2024

Tech design to be refined, but initial idea is that we could allow passing here the custom logic:
https://github.com/opencrvs/mosip/blob/34eba001aad46421e5853cd541cbba0180edd4a0/packages/country-config/src/events.ts#L4

Proposed @opencrvs/mosip/events API:

export const mosipRegistrationHandler = ({ url, enabled = true }: { url: string, enabled: boolean | (record: ValidRecord) => boolean }) => ...

Proposed country-config usage

- handler: eventRegistrationHandler
+ handler: mosipRegistrationHandler({
+   url: 'http://mosip-server:2024',
+   enabled: (record) => {
+     const anyCustomLogic = Math.random() > 0.5
+     return anyCustomLogic && record.id !== 404
+   }
+ })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Design
Development

No branches or pull requests

1 participant