Skip to content

Commit 0d205b4

Browse files
committed
add validate flag config to declare action
1 parent b8ce888 commit 0d205b4

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

src/form/v2/birth/index.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ import {
1818
flag,
1919
InherentFlags,
2020
not,
21-
status
21+
status,
22+
or,
23+
user
2224
} from '@opencrvs/toolkit/events'
2325
import {
2426
BIRTH_DECLARATION_FORM,
@@ -238,6 +240,14 @@ export const birthEvent = defineConfig({
238240
),
239241
field('child.dob').isBefore().now()
240242
)
243+
},
244+
{
245+
id: 'validated',
246+
operation: 'add',
247+
conditional: or(
248+
user.hasRole('REGISTRATION_AGENT'),
249+
user.hasRole('LOCAL_REGISTRAR')
250+
)
241251
}
242252
]
243253
},

src/form/v2/death/index.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ import {
1414
defineConfig,
1515
field,
1616
not,
17-
flag
17+
flag,
18+
or,
19+
user
1820
} from '@opencrvs/toolkit/events'
1921
import {
2022
DEATH_DECLARATION_REVIEW,
@@ -204,7 +206,17 @@ export const deathEvent = defineConfig({
204206
id: 'event.death.action.detect-duplicate.label'
205207
},
206208
query: dedupConfig
207-
}
209+
},
210+
flags: [
211+
{
212+
id: 'validated',
213+
operation: 'add',
214+
conditional: or(
215+
user.hasRole('REGISTRATION_AGENT'),
216+
user.hasRole('LOCAL_REGISTRAR')
217+
)
218+
}
219+
]
208220
},
209221
{
210222
type: ActionType.VALIDATE,

src/translations/client.csv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,8 @@ event.edit.declareWithEdits.label,Label for "Declare with edits" in edit action
806806
event.edit.registerWithEdits.description,Description for "Register with edits" in edit action menu,Are you sure you want to register this event with these edits?,Êtes-vous sûr de vouloir enregistrer cet événement avec ces modifications ?
807807
event.edit.declareWithEdits.description,Description for "Declare with edits" in edit action menu,Are you sure you want to edit this declaration? By confirming you are redeclaring this event and override past changes...,Êtes-vous sûr de vouloir modifier cette déclaration ? En confirmant, vous redéclarez cet événement et remplacez les modifications précédentes...
808808
event.edit.comment.label,The label for the comment,Comments,Commentaires
809-
editPageBanner.message,The message for the edit page banner,You are editing a record declared by {name} ({role} at {location}),Vous modifiez un dossier déclaré par {name} ({role} à {location})
809+
editPageBanner.declaredMessage,The message for the edit page banner,You are editing a record declared by {name} ({role} at {location}),Vous modifiez un dossier déclaré par {name} ({role} à {location})
810+
editPageBanner.notifiedMessage,The message for the edit page banner,You are editing a record notified by {name} ({role} at {location}),Vous modifiez un dossier déclaré par {name} ({role} à {location})
810811
event.birth.action.approve.confirmationText,This is the confirmation text for the approve action,This birth has been registered late. You are now approving it for further validation and registration.,Cette naissance a été enregistrée en retard. Vous l'approuvez maintenant pour une validation et un enregistrement supplémentaires.
811812
event.birth.action.approve.label,This is shown as the action name anywhere the user can trigger the action from,Approve declaration,Approuver la déclaration
812813
event.birth.action.archive.label,Label for archive record button in dropdown menu,Archive,Aarchiver

0 commit comments

Comments
 (0)