Skip to content

Conversation

@PathumN99
Copy link
Collaborator

@PathumN99 PathumN99 commented Nov 8, 2024

#7909

  • Removed the national ID select option in integrations UI.
  • Removed the national ID scope in backend.
  • Removed the relevant translations from the country-config. [#313]
  • Removed MOSIP systemType in GraphQL schemas.

@github-actions
Copy link

github-actions bot commented Nov 8, 2024

Oops! Looks like you forgot to update the changelog. When updating CHANGELOG.md, please consider the following:

  • Changelog is read by country implementors who might not always be familiar with all technical details of OpenCRVS. Keep language high-level, user friendly and avoid technical references to internals.
  • Answer "What's new?", "Why was the change made?" and "Why should I care?" for each change.
  • If it's a breaking change, include a migration guide answering "What do I need to do to upgrade?".

Copy link
Member

@naftis naftis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks, looks good.

we could also remove it in these GraphQL schemas and then run frontend type generation:

cd packages/client
TOKEN="" yarn generate-gateway-types

https://is-my-opencrvs-up.netlify.app/
you can find the registrar's token in the left panel when you are running the app locally

@tahmidrahman-dsi
Copy link
Contributor

tahmidrahman-dsi commented Nov 26, 2024

@PathumN99 I think you might have to take care of these cases as well

https://github.com/opencrvs/opencrvs-core/blob/5c402ea/packages/webhooks/src/features/event/service.ts#L59-L60
https://github.com/opencrvs/opencrvs-core/blob/5c402ea/packages/webhooks/src/features/event/service.ts#L74-L75

If you get rid of these cases. then the functions transformBirthBundle, transformDeathBundle will be mostly redundant.
Then you can also get rid of those functions.

Then in the file packages/webhooks/src/features/event/handler.ts you can do something like this

-        const transformedBundle = transformBirthBundle(
-          bundle,
-          webhookToNotify.createdBy.type,
-          permissions
-        )
+        let finalBundle: RegisteredRecord
+        if (webhookToNotify.createdBy.type === 'webhook') {
+          finalBundle = getPermissionsBundle(bundle, permissions)
+        } else {
+          finalBundle = bundle
+        }
         if (webhookToNotify.trigger === TRIGGERS[TRIGGERS.BIRTH_REGISTERED]) {
           const payload = {
             timestamp: new Date().toISOString(),
@@ -80,7 +80,7 @@ export async function birthRegisteredHandler(
               hub: {
                 topic: TRIGGERS[TRIGGERS.BIRTH_REGISTERED]
               },
-              context: [transformedBundle]
+              context: [finalBundle]
             }
           }

Consider making similar changes to both birthRegisteredHandler and deathRegisteredHandler

Copy link
Contributor

@tahmidrahman-dsi tahmidrahman-dsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PathumN99 Nice work! Please have a look at the comment I made about the webhooks handlers

Copy link
Contributor

@tahmidrahman-dsi tahmidrahman-dsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good one @PathumN99, thank you

@tahmidrahman-dsi
Copy link
Contributor

@PathumN99 one small test case needs to be removed to pass unit tests for webhooks

it('transforms national id integration bundle', () => {
const bundle = transformBirthBundle(registeredRecord, 'nationalId')
expect(bundle).toEqual(nationalIdBundle)
})

Also after you remove this test case, please consider removing subsequent unused codes

@naftis
Copy link
Member

naftis commented Dec 3, 2024

@PathumN99 on approval / ready to merge label, you can merge the pull request to develop if the tests pass.

@ocrvs-bot
Copy link
Contributor

Your environment is deployed to https://ocrvs-7909.opencrvs.dev

@naftis naftis merged commit 5f582ac into develop Dec 10, 2024
65 checks passed
@naftis naftis deleted the ocrvs-7909 branch December 10, 2024 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants