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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@hapi/boom": "^9.1.1",
"@hapi/hapi": "^20.0.1",
"@hapi/inert": "^6.0.3",
"@opencrvs/toolkit": "1.9.0-rc.f73868a",
"@opencrvs/toolkit": "1.9.0-rc.f2d330d",
"@types/chalk": "^2.2.0",
"@types/csv2json": "^1.4.0",
"@types/fhir": "^0.0.30",
Expand Down Expand Up @@ -114,7 +114,7 @@
"tsconfig-paths": "^3.8.0",
"typescript": "^5.1.6",
"uuid": "^11.1.0",
"zod": "^3.24.1"
"zod": "^4.1.12"
},
"lint-staged": {
"src/**/*.{ts,graphql}": [
Expand Down
16 changes: 0 additions & 16 deletions src/form/tennis-club-membership.ts
Original file line number Diff line number Diff line change
Expand Up @@ -827,14 +827,6 @@ export const tennisClubMembershipEvent = defineConfig({
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.tennis-club-membership.action.validate.label'
},
review: {
title: {
defaultMessage: 'Validate',
description: 'Title of the form to show in review page',
id: 'event.birth.action.validate.form.review.title'
},
fields: []
}
},
{
Expand All @@ -844,14 +836,6 @@ export const tennisClubMembershipEvent = defineConfig({
description:
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.tennis-club-membership.action.register.label'
},
review: {
title: {
defaultMessage: 'Register',
description: 'Title of the form to show in review page',
id: 'event.birth.action.register.form.review.title'
},
fields: []
}
},
{
Expand Down
49 changes: 31 additions & 18 deletions src/form/v2/birth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
*/
import {
ActionType,
and,
ConditionalType,
defineConfig,
field
field,
not
} from '@opencrvs/toolkit/events'
import {
BIRTH_DECLARATION_FORM,
Expand All @@ -24,6 +26,7 @@ import { BIRTH_CERTIFICATE_COLLECTOR_FORM } from './forms/printForm'
import { PlaceOfBirth } from './forms/pages/child'
import { CORRECTION_FORM } from './forms/correctionForm'
import { dedupConfig } from './dedupConfig'
import { applicationConfig } from '@countryconfig/api/application/application-config'

export const birthEvent = defineConfig({
id: Event.Birth,
Expand All @@ -45,6 +48,17 @@ export const birthEvent = defineConfig({
description:
'This is a fallback title if actual title resolves to empty string'
},
flags: [
{
id: 'approval-required-for-late-registration',
label: {
id: 'event.birth.flag.approval-required-for-late-registration',
defaultMessage: 'Approval required for late registration',
description: 'Flag label for approval required for late registration'
},
requiresAction: true
}
],
summary: {
fields: [
{
Expand Down Expand Up @@ -188,7 +202,22 @@ export const birthEvent = defineConfig({
id: 'event.birth.action.detect-duplicate.label'
},
query: dedupConfig
}
},
flags: [
{
id: 'approval-required-for-late-registration',
operation: 'add',
conditional: and(
not(
field('child.dob')
.isAfter()
.days(applicationConfig.BIRTH.LATE_REGISTRATION_TARGET)
.inPast()
),
field('child.dob').isBefore().now()
)
}
]
},
{
type: ActionType.VALIDATE,
Expand All @@ -198,14 +227,6 @@ export const birthEvent = defineConfig({
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.birth.action.validate.label'
},
review: {
title: {
defaultMessage: 'Validate',
description: 'Title of the form to show in review page',
id: 'event.birth.action.validate.form.review.title'
},
fields: []
},
deduplication: {
id: 'birth-deduplication',
label: {
Expand All @@ -225,14 +246,6 @@ 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'
},
review: {
title: {
defaultMessage: 'Register',
description: 'Title of the form to show in review page',
id: 'event.birth.action.register.form.review.title'
},
fields: []
},
deduplication: {
id: 'birth-deduplication',
label: {
Expand Down
16 changes: 0 additions & 16 deletions src/form/v2/death/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,6 @@ 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'
},
review: {
title: {
defaultMessage: 'Validate',
description: 'Title of the form to show in review page',
id: 'event.birth.action.validate.form.review.title'
},
fields: []
},
deduplication: {
id: 'death-deduplication',
label: {
Expand All @@ -228,14 +220,6 @@ export const deathEvent = defineConfig({
'This is shown as the action name anywhere the user can trigger the action from',
id: 'event.death.action.register.label'
},
review: {
title: {
defaultMessage: 'Register',
description: 'Title of the form to show in review page',
id: 'event.birth.action.register.form.review.title'
},
fields: []
},
deduplication: {
id: 'death-deduplication',
label: {
Expand Down
26 changes: 13 additions & 13 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].f73868a":
version "1.9.0-rc.f73868a"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.f73868a.tgz#d21f3b037552584fc43a0a87af2fa735296c900a"
integrity sha512-V6vO+/AlD4ravxeQnHEwPSwTZgdZwe3OZqJp2Z1M1VSA5iAhgRGHh3zZiRrlJto/PYSYS171WTzn/uZgEWB+4Q==
"@opencrvs/[email protected].f2d330d":
version "1.9.0-rc.f2d330d"
resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-1.9.0-rc.f2d330d.tgz#9a5d8597711bde3d7cdb5ab02126386d91afe6c9"
integrity sha512-Ne+UMRbyHT7/YFXv/P8dW/qPujF3gUwtUUUHoxSI/JElKzmXIVVSbICVr35a0ko3NcrDpCPb1gCLCczYKIgS+g==
dependencies:
"@trpc/client" "11.4.3"
"@trpc/server" "11.4.3"
Expand All @@ -846,7 +846,7 @@
object-hash "^3.0.0"
superjson "1.9.0-0"
uuid "^9.0.0"
zod-openapi "^4.2.4"
zod-openapi "^5.4.3"

"@pkgjs/parseargs@^0.11.0":
version "0.11.0"
Expand Down Expand Up @@ -5817,12 +5817,12 @@ yocto-queue@^0.1.0:
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==

zod-openapi@^4.2.4:
version "4.2.4"
resolved "https://registry.yarnpkg.com/zod-openapi/-/zod-openapi-4.2.4.tgz#44a0ec81ace6d64d705c8e4232095fac313359cf"
integrity sha512-tsrQpbpqFCXqVXUzi3TPwFhuMtLN3oNZobOtYnK6/5VkXsNdnIgyNr4r8no4wmYluaxzN3F7iS+8xCW8BmMQ8g==
zod-openapi@^5.4.3:
version "5.4.3"
resolved "https://registry.yarnpkg.com/zod-openapi/-/zod-openapi-5.4.3.tgz#ec886fac181b778bc2e9ccc3462c470543f23e26"
integrity sha512-6kJ/gJdvHZtuxjYHoMtkl2PixCwRuZ/s79dVkEr7arHvZGXfx7Cvh53X3HfJ5h9FzGelXOXlnyjwfX0sKEPByw==

zod@^3.24.1:
version "3.24.1"
resolved "https://registry.yarnpkg.com/zod/-/zod-3.24.1.tgz#27445c912738c8ad1e9de1bea0359fa44d9d35ee"
integrity sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==
zod@^4.1.12:
version "4.1.12"
resolved "https://registry.yarnpkg.com/zod/-/zod-4.1.12.tgz#64f1ea53d00eab91853195653b5af9eee68970f0"
integrity sha512-JInaHOamG8pt5+Ey8kGmdcAcg3OL9reK8ltczgHTAwNhMys/6ThXHityHxVV2p3fkw/c+MAvBHFVYHFZDmjMCQ==
Loading