Skip to content

Commit 04db31f

Browse files
committed
feat: use new AGE field
1 parent 9727e71 commit 04db31f

File tree

7 files changed

+29
-12
lines changed

7 files changed

+29
-12
lines changed

src/api/certificates/source/v2.birth-certificate-certified-copy.svg

Lines changed: 3 additions & 3 deletions
Loading

src/api/notification/testData.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,13 @@ const RequestDeathDeclarationAction = {
297297
createdByRole: 'LOCAL_REGISTRAR',
298298
createdAtLocation: '9e069dda-0d83-4f67-a4f2-9adbf5658e2e' as unknown as UUID,
299299
declaration: {
300-
'spouse.age': '41',
300+
'spouse.age': { age: '41', asOfDate: '2025-08-19' },
301301
'spouse.name': {
302302
firstname: 'Toki',
303303
surname: 'Kozuki',
304304
middlename: ''
305305
},
306-
'deceased.age': '31',
306+
'deceased.age': { age: '31', asOfDate: '2025-08-19' },
307307
'deceased.name': {
308308
firstname: 'Oden',
309309
surname: 'Kozuki',
@@ -353,13 +353,13 @@ const DeathDeclarationAction = {
353353
createdByRole: 'LOCAL_REGISTRAR',
354354
createdAtLocation: '9e069dda-0d83-4f67-a4f2-9adbf5658e2e' as unknown as UUID,
355355
declaration: {
356-
'spouse.age': '41',
356+
'spouse.age': { age: '41', asOfDate: '2025-08-19' },
357357
'spouse.name': {
358358
firstname: 'Toki',
359359
surname: 'Kozuki',
360360
middlename: ''
361361
},
362-
'deceased.age': '31',
362+
'deceased.age': { age: '31', asOfDate: '2025-08-19' },
363363
'deceased.name': {
364364
firstname: 'Oden',
365365
surname: 'Kozuki',

src/form/v2/birth/forms/pages/father.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,12 @@ export const father = defineFormPage({
195195
id: 'event.birth.action.declare.form.section.father.field.age.label'
196196
},
197197
configuration: {
198-
asOfDate: field('child.dob')
198+
asOfDate: field('child.dob'),
199+
postfix: {
200+
defaultMessage: 'years',
201+
description: 'This is the postfix for age field',
202+
id: 'event.birth.action.declare.form.section.person.field.age.postfix'
203+
}
199204
},
200205
conditionals: [
201206
{

src/form/v2/birth/forms/pages/informant.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,12 @@ export const informant = defineFormPage({
233233
id: 'event.birth.action.declare.form.section.informant.field.age.label'
234234
},
235235
configuration: {
236-
asOfDate: field('child.dob')
236+
asOfDate: field('child.dob'),
237+
postfix: {
238+
defaultMessage: 'years',
239+
description: 'This is the postfix for age field',
240+
id: 'event.birth.action.declare.form.section.person.field.age.postfix'
241+
}
237242
},
238243
conditionals: [
239244
{

src/form/v2/birth/forms/pages/mother.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,12 @@ export const mother = defineFormPage({
192192
id: 'event.birth.action.declare.form.section.mother.field.age.label'
193193
},
194194
configuration: {
195-
asOfDate: field('child.dob')
195+
asOfDate: field('child.dob'),
196+
postfix: {
197+
defaultMessage: 'years',
198+
description: 'This is the postfix for age field',
199+
id: 'event.birth.action.declare.form.section.person.field.age.postfix'
200+
}
196201
},
197202
conditionals: [
198203
{

src/form/v2/death/forms/pages/informant.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,14 +227,15 @@ export const informant = defineFormPage({
227227
},
228228
{
229229
id: 'informant.age',
230-
type: FieldType.TEXT,
230+
type: FieldType.AGE,
231231
required: true,
232232
label: {
233233
defaultMessage: 'Age of informant',
234234
description: 'This is the label for the field',
235235
id: 'event.death.action.declare.form.section.informant.field.age.label'
236236
},
237237
configuration: {
238+
asOfDate: field('eventDetails.date'),
238239
postfix: {
239240
defaultMessage: 'years',
240241
description: 'This is the postfix for age field',

src/form/v2/death/forms/pages/spouse.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,15 @@ export const spouse = defineFormPage({
174174
},
175175
{
176176
id: 'spouse.age',
177-
type: FieldType.TEXT,
177+
type: FieldType.AGE,
178178
required: true,
179179
label: {
180180
defaultMessage: 'Age of spouse',
181181
description: 'This is the label for the field',
182182
id: 'event.death.action.declare.form.section.spouse.field.age.label'
183183
},
184184
configuration: {
185+
asOfDate: field('eventDetails.date'),
185186
postfix: {
186187
defaultMessage: 'years',
187188
description: 'This is the postfix for age field',

0 commit comments

Comments
 (0)