Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@hapi/boom": "^9.1.1",
"@hapi/hapi": "^20.0.1",
"@hapi/inert": "^6.0.3",
"@opencrvs/toolkit": "1.9.2-rc.db73c78",
"@opencrvs/toolkit": "1.9.2-rc.2064449",
"@types/chalk": "^2.2.0",
"@types/csv2json": "^1.4.0",
"@types/fhir": "^0.0.30",
Expand Down
1 change: 0 additions & 1 deletion src/api/action-confirmation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ The following actions currently support action confirmation:

- `ActionType.NOTIFY`
- `ActionType.DECLARE`
- `ActionType.VALIDATE`
- `ActionType.REGISTER`
- `ActionType.REJECT`
- `ActionType.ARCHIVE`
Expand Down
2 changes: 1 addition & 1 deletion src/api/workqueue/workqueueConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Workqueues = defineWorkqueues([
query: {},
actions: [
{
type: 'VALIDATE',
type: 'DECLARE',
conditionals: []
}
]
Expand Down
7 changes: 4 additions & 3 deletions src/data-seeding/roles/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,12 @@ export const roles: Role[] = [
'record.read[event=birth|death|tennis-club-membership]',
'record.declare[event=birth|death|tennis-club-membership]',
'record.declared.edit[event=birth|death|tennis-club-membership]',
'record.declared.validate[event=birth|death|tennis-club-membership]',
'record.declared.reject[event=birth|death|tennis-club-membership]',
'record.declared.archive[event=birth|death|tennis-club-membership]',
'record.declared.review-duplicates[event=birth|death|tennis-club-membership]',
'record.registered.print-certified-copies[event=birth|death|tennis-club-membership]',
'record.registered.request-correction[event=birth|death|tennis-club-membership]'
'record.registered.request-correction[event=birth|death|tennis-club-membership]',
'record.custom-action[event=birth|death,customActionType=VALIDATE_DECLARATION]'
]
},
{
Expand Down Expand Up @@ -229,7 +229,8 @@ export const roles: Role[] = [
'record.registered.print-certified-copies[event=birth|death|tennis-club-membership]',
'record.registered.correct[event=birth|death|tennis-club-membership]',
'record.unassign-others[event=birth|death|tennis-club-membership]',
'record.custom-action[event=birth,customActionType=ESCALATE|ISSUE_CERTIFIED_COPY]'
'record.custom-action[event=birth,customActionType=ESCALATE|ISSUE_CERTIFIED_COPY|VALIDATE_DECLARATION]',
'record.custom-action[event=death,customActionType=VALIDATE_DECLARATION]'
]
},
{
Expand Down
9 changes: 0 additions & 9 deletions src/form/tennis-club-membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,15 +901,6 @@ export const tennisClubMembershipEvent = defineConfig({
},
review: TENNIS_CLUB_DECLARATION_REVIEW
},
{
type: ActionType.VALIDATE,
label: {
defaultMessage: 'Validate',
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.tennis-club-membership.action.validate.label'
}
},
{
type: ActionType.REGISTER,
label: {
Expand Down
70 changes: 42 additions & 28 deletions src/form/v2/birth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
flag,
InherentFlags,
not,
status,
or,
status,
user
} from '@opencrvs/toolkit/events'
import {
Expand Down Expand Up @@ -270,6 +270,46 @@ export const birthEvent = defineConfig({
}
]
},
{
type: ActionType.CUSTOM,
customActionType: 'VALIDATE_DECLARATION',
icon: 'Stamp',
label: {
defaultMessage: 'Validate declaration',
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.birth.custom.action.validate-declaration.label'
},
conditionals: [
{
type: ConditionalType.SHOW,
conditional: and(status('DECLARED'), not(flag('validated')))
},
{
type: ConditionalType.ENABLE,
conditional: not(flag(InherentFlags.POTENTIAL_DUPLICATE))
}
],
flags: [{ id: 'validated', operation: 'add' }],
form: [
{
id: 'comments',
type: 'TEXTAREA',
label: {
defaultMessage: 'Comments',
description:
'This is the label for the comments field for the validate declaration action',
id: 'event.birth.custom.action.validate-declaration.field.comments.label'
}
}
],
auditHistoryLabel: {
defaultMessage: 'Validated',
description:
'The label to show in audit history for the validate action',
id: 'event.birth.custom.action.validate-declaration.audit-history-label'
}
},
{
type: ActionType.CUSTOM,
customActionType: 'APPROVE_DECLARATION',
Expand Down Expand Up @@ -546,33 +586,6 @@ export const birthEvent = defineConfig({
id: 'event.birth.action.registrar-feedback.audit-history-label'
}
},
{
type: ActionType.VALIDATE,
label: {
defaultMessage: 'Validate',
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.birth.action.validate.label'
},
conditionals: [
{
type: ConditionalType.ENABLE,
conditional: not(flag('approval-required-for-late-registration'))
},
{ type: ConditionalType.SHOW, conditional: not(flag('validated')) }
],
flags: [{ id: 'validated', operation: 'add' }],
deduplication: {
id: 'birth-deduplication',
label: {
defaultMessage: 'Detect duplicate',
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.birth.action.detect-duplicate.label'
},
query: dedupConfig
}
},
{
type: ActionType.REJECT,
label: {
Expand All @@ -591,6 +604,7 @@ export const birthEvent = defineConfig({
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.birth.action.register.label'
},
flags: [{ id: 'validated', operation: 'remove' }],
conditionals: [
{
type: ConditionalType.ENABLE,
Expand Down
75 changes: 47 additions & 28 deletions src/form/v2/death/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ import {
ConditionalType,
defineConfig,
field,
or,
user,
and,
status,
not,
flag,
or,
user
InherentFlags
} from '@opencrvs/toolkit/events'
import {
DEATH_DECLARATION_REVIEW,
Expand Down Expand Up @@ -50,17 +53,6 @@ export const deathEvent = defineConfig({
description:
'This is a fallback title if actual title resolves to empty string'
},
flags: [
{
id: 'validated',
label: {
id: 'event.death.flag.validated',
defaultMessage: 'Validated',
description: 'Flag label for validated'
},
requiresAction: true
}
],
summary: {
fields: [
{
Expand Down Expand Up @@ -178,6 +170,17 @@ export const deathEvent = defineConfig({
}
]
},
flags: [
{
id: 'validated',
label: {
id: 'event.birth.flag.validated',
defaultMessage: 'Validated',
description: 'Flag label for validated'
},
requiresAction: true
}
],
actions: [
{
type: ActionType.READ,
Expand Down Expand Up @@ -220,26 +223,43 @@ export const deathEvent = defineConfig({
]
},
{
type: ActionType.VALIDATE,
type: ActionType.CUSTOM,
customActionType: 'VALIDATE_DECLARATION',
icon: 'Stamp',
label: {
defaultMessage: 'Validate',
defaultMessage: 'Validate declaration',
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.death.action.validate.label'
id: 'event.birth.custom.action.validate-declaration.label'
},
conditionals: [
{ type: ConditionalType.SHOW, conditional: not(flag('validated')) }
{
type: ConditionalType.SHOW,
conditional: and(status('DECLARED'), not(flag('validated')))
},
{
type: ConditionalType.ENABLE,
conditional: not(flag(InherentFlags.POTENTIAL_DUPLICATE))
}
],
flags: [{ id: 'validated', operation: 'add' }],
deduplication: {
id: 'death-deduplication',
label: {
defaultMessage: 'Detect duplicate',
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.death.action.detect-duplicate.label'
},
query: dedupConfig
form: [
{
id: 'comments',
type: 'TEXTAREA',
label: {
defaultMessage: 'Comments',
description:
'This is the label for the comments field for the validate declaration action',
id: 'event.birth.custom.action.validate-declaration.field.comments.label'
}
}
],
auditHistoryLabel: {
defaultMessage: 'Validated',
description:
'The label to show in audit history for the validate action',
id: 'event.birth.custom.action.validate-declaration.audit-history-label'
}
},
{
Expand All @@ -249,8 +269,7 @@ export const deathEvent = defineConfig({
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.death.action.reject.label'
},
flags: [{ id: 'validated', operation: 'remove' }]
}
},
{
type: ActionType.REGISTER,
Expand Down
3 changes: 3 additions & 0 deletions src/translations/client.csv
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,9 @@ event.birth.summary.informant.contact.empty,This is shown when there is no infor
event.birth.summary.informant.contact.label,This is the label for the informant information,Contact,Contact
event.birth.summary.informant.contact.value,This is the contact value of the informant,{informant.phoneNo} {informant.email},{informant.phoneNo} {informant.email}
event.birth.title,This is the title of the summary,{child.name.firstname} {child.name.surname},{child.name.firstname} {child.name.surname}
event.birth.custom.action.validate-declaration.field.comments.label,This is the label for the comments field for the validate declaration action,Comments,Commentaires
event.birth.custom.action.validate-declaration.audit-history-label,The label to show in audit history for the validate action,Validated,Validé
event.birth.custom.action.validate-declaration.label,This is shown as the action name anywhere the user can trigger the action from,Validate declaration,Valider la déclaration
event.death.action.Read.label,This is shown as the action name anywhere the user can trigger the action from,Read,Lire
event.death.action.certificate.form.cancel,This is the label for the verification cancellation button,Identity does not match,L'identité ne correspond pas
event.death.action.certificate.form.cancel.confirmation.body,This is the body for the verification cancellation modal,"Please be aware that if you proceed, you will be responsible for issuing a certificate without the necessary proof of ID from the collector","Veuillez noter que si vous continuez, vous serez responsable de la délivrance d'un certificat sans la preuve d'identité nécessaire du collecteur."
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -834,10 +834,10 @@
dependencies:
"@octokit/openapi-types" "^18.0.0"

"@opencrvs/[email protected].db73c78":
version "1.9.2-rc.db73c78"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.2-rc.db73c78.tgz#b389acb0f6f9ba6f54b50f037bcec92dcdfa2536"
integrity sha512-2ekht7jBpn1MxKL0AOMRGrfL1fx2dM9akxAD5GU2pfr3x7zjABeMsEtMtCcrXFYhJhaXIooSKk4XofXjXz4wTg==
"@opencrvs/[email protected].2064449":
version "1.9.2-rc.2064449"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.2-rc.2064449.tgz#9afa3739eafcd01245a0998edcdafbb2467a7368"
integrity sha512-dKKhvvoSqL7dyIxdxy7rhe85+NDSxxye+ibOQq5K10t8/jJc5QDCnwsRXzvb4N6ValNA/glLfgwpezQNEEYlNQ==
dependencies:
"@trpc/client" "11.4.3"
"@trpc/server" "11.4.3"
Expand Down
Loading