Skip to content
Merged
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 @@ -63,7 +63,7 @@
"@hapi/boom": "^9.1.1",
"@hapi/hapi": "^20.0.1",
"@hapi/inert": "^6.0.3",
"@opencrvs/toolkit": "1.9.0-rc.8a42cc8",
"@opencrvs/toolkit": "1.9.0-rc.1346624",
"@types/chalk": "^2.2.0",
"@types/csv2json": "^1.4.0",
"@types/fhir": "^0.0.30",
Expand Down
15 changes: 5 additions & 10 deletions src/api/workqueue/workqueueConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export const Workqueues = defineWorkqueues([
terms: ['DECLARED', 'NOTIFIED']
},
flags: {
noneOf: [InherentFlags.REJECTED]
noneOf: [InherentFlags.REJECTED, 'validated']
},
createdBy: { type: 'exact', term: user('id') }
},
Expand Down Expand Up @@ -194,7 +194,7 @@ export const Workqueues = defineWorkqueues([
query: {
status: { type: 'exact', term: EventStatus.enum.DECLARED },
flags: {
noneOf: [InherentFlags.REJECTED]
noneOf: [InherentFlags.REJECTED, 'validated']
},
updatedAtLocation: { type: 'exact', term: user('primaryOfficeId') }
},
Expand Down Expand Up @@ -230,7 +230,7 @@ export const Workqueues = defineWorkqueues([
{
status: {
type: 'anyOf',
terms: ['DECLARED', 'VALIDATED']
terms: ['DECLARED']
},
flags: {
noneOf: [InherentFlags.REJECTED]
Expand Down Expand Up @@ -341,15 +341,10 @@ export const Workqueues = defineWorkqueues([
clauses: [
{
updatedBy: { type: 'exact', term: user('id') },
status: { type: 'exact', term: 'VALIDATED' },
flags: {
noneOf: [InherentFlags.REJECTED]
}
flags: { noneOf: [InherentFlags.REJECTED] }
},
{
flags: {
anyOf: [InherentFlags.CORRECTION_REQUESTED]
},
flags: { anyOf: [InherentFlags.CORRECTION_REQUESTED, 'validated'] },
updatedBy: { type: 'exact', term: user('id') }
}
]
Expand Down
23 changes: 22 additions & 1 deletion src/form/v2/birth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ export const birthEvent = defineConfig({
description: 'Flag label for approval required for late registration'
},
requiresAction: true
},
{
id: 'validated',
label: {
id: 'event.birth.flag.validated',
defaultMessage: 'Validated',
description: 'Flag label for validated'
},
requiresAction: true
}
],
summary: {
Expand Down Expand Up @@ -275,8 +284,10 @@ export const birthEvent = defineConfig({
{
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: {
Expand All @@ -288,6 +299,16 @@ export const birthEvent = defineConfig({
query: dedupConfig
}
},
{
type: ActionType.REJECT,
label: {
defaultMessage: 'Reject',
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.birth.action.reject.label'
},
flags: [{ id: 'validated', operation: 'remove' }]
},
{
type: ActionType.REGISTER,
label: {
Expand Down
29 changes: 28 additions & 1 deletion src/form/v2/death/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import {
ActionType,
ConditionalType,
defineConfig,
field
field,
not,
flag
} from '@opencrvs/toolkit/events'
import {
DEATH_DECLARATION_REVIEW,
Expand Down Expand Up @@ -45,6 +47,17 @@ 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 @@ -201,6 +214,10 @@ export const deathEvent = defineConfig({
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.death.action.validate.label'
},
conditionals: [
{ type: ConditionalType.SHOW, conditional: not(flag('validated')) }
],
flags: [{ id: 'validated', operation: 'add' }],
deduplication: {
id: 'death-deduplication',
label: {
Expand All @@ -212,6 +229,16 @@ export const deathEvent = defineConfig({
query: dedupConfig
}
},
{
type: ActionType.REJECT,
label: {
defaultMessage: 'Reject',
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,
label: {
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].8a42cc8":
version "1.9.0-rc.8a42cc8"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.8a42cc8.tgz#29d8299ce1feed7b2d71f6eec1c89d5fb7a0c6dc"
integrity sha512-GCVX2eIHcZdc8GlmQT+RISlJjt0eU0ftld5Nd3lLwsso7lkVNQa7sY/LdbvMZ6dcgx9sdYUr32pgeEwL8iUMYw==
"@opencrvs/[email protected].1346624":
version "1.9.0-rc.1346624"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.1346624.tgz#4a605be5e913452ef7890eb879b1c3c679fac6ea"
integrity sha512-Fl+n1QpySvHS8niZ8cdWzeyIoScPMi+AY/7moTjV08dj3r8OdiMVm7My4+uq4cVSeqRVNnk6jGMfTiFTq16Ihg==
dependencies:
"@trpc/client" "11.4.3"
"@trpc/server" "11.4.3"
Expand Down
Loading