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.dda3c71",
"@opencrvs/toolkit": "1.9.0-rc.74b7aa0",
"@types/chalk": "^2.2.0",
"@types/csv2json": "^1.4.0",
"@types/fhir": "^0.0.30",
Expand Down
21 changes: 21 additions & 0 deletions src/api/workqueue/workqueueConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,5 +418,26 @@ export const Workqueues = defineWorkqueues([
value: event.field('updatedAt')
}
]
},
{
slug: 'late-registration-approval-required',
icon: 'FileSearch',
name: {
id: 'workqueues.requiresApproval.title',
defaultMessage: 'Pending approval',
description: 'Title of Pending approval workqueue'
},
query: {
flags: {
anyOf: ['approval-required-for-late-registration']
},
updatedAtLocation: { type: 'exact', term: user('primaryOfficeId') }
},
actions: [
{
type: 'DEFAULT',
conditionals: []
}
]
}
])
1 change: 1 addition & 0 deletions src/data-seeding/employees/source/default-employees.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ CRVS_OFFICE_JWMRGwDBXK,Kalusha,Bwalya,HOSPITAL_CLERK,+260911111111,k.bwalya,kalu
CRVS_OFFICE_JWMRGwDBXK,Felix,Katongo,REGISTRATION_AGENT,+260922222222,f.katongo,[email protected],test
CRVS_OFFICE_JWMRGwDBXK,Kennedy,Mweene,LOCAL_REGISTRAR,+260933333333,k.mweene,[email protected],test
CRVS_OFFICE_JWMRGwDBXK,Emmanuel,Mayuka,LOCAL_SYSTEM_ADMIN,+260921681112,e.mayuka,[email protected],test
CRVS_OFFICE_JWMRGwDBXK,Mitchell,Owen,PROVINCIAL_REGISTRAR,+260915151516,m.owen,[email protected],test
CRVS_OFFICE_2OKicPQMNI,Jonathan,Campbell,NATIONAL_SYSTEM_ADMIN,+260921111111,j.campbell,[email protected],test
CRVS_OFFICE_okQp4uKCz0,Patrick,Gondwe,COMMUNITY_LEADER,+260912121212,p.gondwe,[email protected],test
CRVS_OFFICE_okQp4uKCz0,Joshua,Mutale,REGISTRATION_AGENT,+260923232323,j.mutale,[email protected],test
Expand Down
22 changes: 18 additions & 4 deletions src/data-seeding/roles/roles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,7 @@ export const roles: Role[] = [
'record.register[event=birth|death|tennis-club-membership]',
'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=Approve]'
'record.unassign-others[event=birth|death|tennis-club-membership]'
]
},
{
Expand Down Expand Up @@ -253,8 +252,8 @@ export const roles: Role[] = [
},
scopes: [
SCOPES.USER_CREATE,
'user.create[role=FIELD_AGENT|POLICE_OFFICER|HOSPITAL_CLERK|HEALTHCARE_WORKER|COMMUNITY_LEADER|REGISTRATION_AGENT|LOCAL_REGISTRAR|NATIONAL_REGISTRAR|LOCAL_SYSTEM_ADMIN|NATIONAL_SYSTEM_ADMIN|PERFORMANCE_MANAGER]',
'user.edit[role=FIELD_AGENT|POLICE_OFFICER|HOSPITAL_CLERK|HEALTHCARE_WORKER|COMMUNITY_LEADER|REGISTRATION_AGENT|LOCAL_REGISTRAR|NATIONAL_REGISTRAR|LOCAL_SYSTEM_ADMIN|NATIONAL_SYSTEM_ADMIN|PERFORMANCE_MANAGER]',
'user.create[role=FIELD_AGENT|POLICE_OFFICER|HOSPITAL_CLERK|HEALTHCARE_WORKER|COMMUNITY_LEADER|REGISTRATION_AGENT|LOCAL_REGISTRAR|NATIONAL_REGISTRAR|LOCAL_SYSTEM_ADMIN|NATIONAL_SYSTEM_ADMIN|PERFORMANCE_MANAGER|PROVINCIAL_REGISTRAR]',
'user.edit[role=FIELD_AGENT|POLICE_OFFICER|HOSPITAL_CLERK|HEALTHCARE_WORKER|COMMUNITY_LEADER|REGISTRATION_AGENT|LOCAL_REGISTRAR|NATIONAL_REGISTRAR|LOCAL_SYSTEM_ADMIN|NATIONAL_SYSTEM_ADMIN|PERFORMANCE_MANAGER|PROVINCIAL_REGISTRAR]',
SCOPES.USER_READ,
SCOPES.USER_UPDATE,
SCOPES.ORGANISATION_READ_LOCATIONS,
Expand Down Expand Up @@ -326,5 +325,20 @@ export const roles: Role[] = [
'record.registered.correct[event=birth|death|tennis-club-membership]',
'record.unassign-others[event=birth|death|tennis-club-membership]'
]
},
{
id: 'PROVINCIAL_REGISTRAR',
label: {
defaultMessage: 'Provincial Registrar',
description: 'Name for user role Provincial Registrar',
id: 'userRole.provincialRegistrar'
},
scopes: [
'record.read[event=birth|death|tennis-club-membership]',
'record.custom-action[event=birth,customActionType=APPROVE_DECLARATION]',
'workqueue[id=late-registration-approval-required|recent]',
'search[event=birth,access=all]',
'record.unassign-others[event=birth]'
]
}
]
15 changes: 10 additions & 5 deletions src/form/v2/birth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
defineConfig,
field,
flag,
InherentFlags,
not
} from '@opencrvs/toolkit/events'
import {
Expand Down Expand Up @@ -231,10 +232,10 @@ export const birthEvent = defineConfig({
},
{
type: ActionType.CUSTOM,
customActionType: 'Approve',
icon: 'Globe',
customActionType: 'APPROVE_DECLARATION',
icon: 'Stamp',
label: {
defaultMessage: 'Approve',
defaultMessage: 'Approve declaration',
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.birth.action.approve.label'
Expand All @@ -243,21 +244,25 @@ export const birthEvent = defineConfig({
{
id: 'notes',
type: 'TEXTAREA',
required: true,
label: {
defaultMessage: 'Notes',
defaultMessage: 'Comments',
description: 'This is the label for the field for a custom action',
id: 'event.birth.custom.action.approve.field.notes.label'
}
}
],
flags: [
{ id: InherentFlags.REJECTED, operation: 'remove' },
{ id: 'approval-required-for-late-registration', operation: 'remove' }
],
conditionals: [
{
type: ConditionalType.SHOW,
conditional: flag('approval-required-for-late-registration')
},
{
type: ConditionalType.ENABLE,
conditional: not(flag(InherentFlags.POTENTIAL_DUPLICATE))
}
],
auditHistoryLabel: {
Expand Down
Loading
Loading