-
Notifications
You must be signed in to change notification settings - Fork 73
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
feat(api): Self Service Portal APIs #8286
Open
tharakadadigama20
wants to merge
11
commits into
develop
Choose a base branch
from
ocrvs-2268-webhook
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+180
−21
Open
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
71a3725
Iterated the Record Search API to return all statuses to system clients.
Hyper3x b1b5dff
Merge branch 'ocrvs-2268' of https://github.com/opencrvs/opencrvs-cor…
tharakadadigama20 af8b82c
Issue 2268 webhook changes
tharakadadigama20 a91e3ff
code changes done according to comments
tharakadadigama20 75732ea
Webhook added to other statuses
tharakadadigama20 6d5b3c5
Merge branch 'develop' of https://github.com/opencrvs/opencrvs-core i…
tharakadadigama20 c35e683
approved webhook changed to validated
tharakadadigama20 f8bc249
Webhook changed to support event V2
tharakadadigama20 b60eebc
Merge branch 'develop' of https://github.com/opencrvs/opencrvs-core i…
tharakadadigama20 ce31f14
Additional triggers removed.
tharakadadigama20 fd0632a
Webhook removed inside corrections
tharakadadigama20 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,7 @@ import { createRoute } from '@workflow/states' | |
import { getToken } from '@workflow/utils/auth-utils' | ||
import { validateRequest } from '@workflow/utils/index' | ||
import { findActiveCorrectionRequest, sendNotification } from './utils' | ||
import { invokeWebhooks } from '@workflow/records/webhooks' | ||
|
||
export const approveCorrectionRoute = createRoute({ | ||
method: 'POST', | ||
|
@@ -148,6 +149,14 @@ export const approveCorrectionRoute = createRoute({ | |
} | ||
) | ||
|
||
await invokeWebhooks({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tharakadadigama20 this webhook for correction isnt dispatching for me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have updated it. Please check now. |
||
bundle: record, | ||
token, | ||
event: getEventType(record), | ||
isNotRegistred: true, | ||
tharakadadigama20 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
statusType: 'approved' | ||
}) | ||
|
||
return recordWithUpdatedValues | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this filtering needed? We're making it possible for event type to be whatever value in the future so if these variables could be whatever, we'd support the new approach right away
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to keep this filtering, then do it on the route definition level, so instead of one catch-all
you would do
and so on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can remove this. However, what will serve as the trigger point for the webhook?
Currently, it's set up like
BIRTH_REGISTERED
,DEATH_REGISTERED
and so on.How can we filter the webhook to ensure it only triggers for the desired events?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific constraint that prevents us from calling
/events/{eventType}/status/{statusType}
with arbitrary event type and status type e.g.'/events/divorce/status/my-custom-status'
? The hub.topic that gets sent could directly bedivorce/my-custom-status
in this case without us needing the hard coded triggers at allThis approach would support Events v2 right away.
cc @euanmillar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will try this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rikukissa @euanmillar
When doing this, the
webhook subscribe POST API
also needs to be changed.Currently, the
hub.topic
should be inTRIGGERS
I have removed that validation in this API also.
Changes are pushed.