Skip to content

Commit a763f1a

Browse files
authored
Merge pull request #1167 from opencrvs/ocrvs-10267
Replace EventStatus VALIDATED with flag 'validated'
2 parents 74fe3c5 + 5e22eb2 commit a763f1a

File tree

5 files changed

+60
-17
lines changed

5 files changed

+60
-17
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@hapi/boom": "^9.1.1",
6464
"@hapi/hapi": "^20.0.1",
6565
"@hapi/inert": "^6.0.3",
66-
"@opencrvs/toolkit": "1.9.0-rc.8a42cc8",
66+
"@opencrvs/toolkit": "1.9.0-rc.1346624",
6767
"@types/chalk": "^2.2.0",
6868
"@types/csv2json": "^1.4.0",
6969
"@types/fhir": "^0.0.30",

src/api/workqueue/workqueueConfig.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export const Workqueues = defineWorkqueues([
166166
terms: ['DECLARED', 'NOTIFIED']
167167
},
168168
flags: {
169-
noneOf: [InherentFlags.REJECTED]
169+
noneOf: [InherentFlags.REJECTED, 'validated']
170170
},
171171
createdBy: { type: 'exact', term: user('id') }
172172
},
@@ -194,7 +194,7 @@ export const Workqueues = defineWorkqueues([
194194
query: {
195195
status: { type: 'exact', term: EventStatus.enum.DECLARED },
196196
flags: {
197-
noneOf: [InherentFlags.REJECTED]
197+
noneOf: [InherentFlags.REJECTED, 'validated']
198198
},
199199
updatedAtLocation: { type: 'exact', term: user('primaryOfficeId') }
200200
},
@@ -230,7 +230,7 @@ export const Workqueues = defineWorkqueues([
230230
{
231231
status: {
232232
type: 'anyOf',
233-
terms: ['DECLARED', 'VALIDATED']
233+
terms: ['DECLARED']
234234
},
235235
flags: {
236236
noneOf: [InherentFlags.REJECTED]
@@ -341,15 +341,10 @@ export const Workqueues = defineWorkqueues([
341341
clauses: [
342342
{
343343
updatedBy: { type: 'exact', term: user('id') },
344-
status: { type: 'exact', term: 'VALIDATED' },
345-
flags: {
346-
noneOf: [InherentFlags.REJECTED]
347-
}
344+
flags: { noneOf: [InherentFlags.REJECTED] }
348345
},
349346
{
350-
flags: {
351-
anyOf: [InherentFlags.CORRECTION_REQUESTED]
352-
},
347+
flags: { anyOf: [InherentFlags.CORRECTION_REQUESTED, 'validated'] },
353348
updatedBy: { type: 'exact', term: user('id') }
354349
}
355350
]

src/form/v2/birth/index.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ export const birthEvent = defineConfig({
5858
description: 'Flag label for approval required for late registration'
5959
},
6060
requiresAction: true
61+
},
62+
{
63+
id: 'validated',
64+
label: {
65+
id: 'event.birth.flag.validated',
66+
defaultMessage: 'Validated',
67+
description: 'Flag label for validated'
68+
},
69+
requiresAction: true
6170
}
6271
],
6372
summary: {
@@ -275,8 +284,10 @@ export const birthEvent = defineConfig({
275284
{
276285
type: ConditionalType.ENABLE,
277286
conditional: not(flag('approval-required-for-late-registration'))
278-
}
287+
},
288+
{ type: ConditionalType.SHOW, conditional: not(flag('validated')) }
279289
],
290+
flags: [{ id: 'validated', operation: 'add' }],
280291
deduplication: {
281292
id: 'birth-deduplication',
282293
label: {
@@ -288,6 +299,16 @@ export const birthEvent = defineConfig({
288299
query: dedupConfig
289300
}
290301
},
302+
{
303+
type: ActionType.REJECT,
304+
label: {
305+
defaultMessage: 'Reject',
306+
description:
307+
'This is shown as the action name anywhere the user can trigger the action from',
308+
id: 'event.birth.action.reject.label'
309+
},
310+
flags: [{ id: 'validated', operation: 'remove' }]
311+
},
291312
{
292313
type: ActionType.REGISTER,
293314
label: {

src/form/v2/death/index.ts

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ import {
1212
ActionType,
1313
ConditionalType,
1414
defineConfig,
15-
field
15+
field,
16+
not,
17+
flag
1618
} from '@opencrvs/toolkit/events'
1719
import {
1820
DEATH_DECLARATION_REVIEW,
@@ -45,6 +47,17 @@ export const deathEvent = defineConfig({
4547
description:
4648
'This is a fallback title if actual title resolves to empty string'
4749
},
50+
flags: [
51+
{
52+
id: 'validated',
53+
label: {
54+
id: 'event.death.flag.validated',
55+
defaultMessage: 'Validated',
56+
description: 'Flag label for validated'
57+
},
58+
requiresAction: true
59+
}
60+
],
4861
summary: {
4962
fields: [
5063
{
@@ -201,6 +214,10 @@ export const deathEvent = defineConfig({
201214
'This is shown as the action name anywhere the user can trigger the action from',
202215
id: 'event.death.action.validate.label'
203216
},
217+
conditionals: [
218+
{ type: ConditionalType.SHOW, conditional: not(flag('validated')) }
219+
],
220+
flags: [{ id: 'validated', operation: 'add' }],
204221
deduplication: {
205222
id: 'death-deduplication',
206223
label: {
@@ -212,6 +229,16 @@ export const deathEvent = defineConfig({
212229
query: dedupConfig
213230
}
214231
},
232+
{
233+
type: ActionType.REJECT,
234+
label: {
235+
defaultMessage: 'Reject',
236+
description:
237+
'This is shown as the action name anywhere the user can trigger the action from',
238+
id: 'event.death.action.reject.label'
239+
},
240+
flags: [{ id: 'validated', operation: 'remove' }]
241+
},
215242
{
216243
type: ActionType.REGISTER,
217244
label: {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -834,10 +834,10 @@
834834
dependencies:
835835
"@octokit/openapi-types" "^18.0.0"
836836

837-
"@opencrvs/[email protected].8a42cc8":
838-
version "1.9.0-rc.8a42cc8"
839-
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.8a42cc8.tgz#29d8299ce1feed7b2d71f6eec1c89d5fb7a0c6dc"
840-
integrity sha512-GCVX2eIHcZdc8GlmQT+RISlJjt0eU0ftld5Nd3lLwsso7lkVNQa7sY/LdbvMZ6dcgx9sdYUr32pgeEwL8iUMYw==
837+
"@opencrvs/[email protected].1346624":
838+
version "1.9.0-rc.1346624"
839+
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.1346624.tgz#4a605be5e913452ef7890eb879b1c3c679fac6ea"
840+
integrity sha512-Fl+n1QpySvHS8niZ8cdWzeyIoScPMi+AY/7moTjV08dj3r8OdiMVm7My4+uq4cVSeqRVNnk6jGMfTiFTq16Ihg==
841841
dependencies:
842842
"@trpc/client" "11.4.3"
843843
"@trpc/server" "11.4.3"

0 commit comments

Comments
 (0)