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
11 changes: 11 additions & 0 deletions src/form/v2/death/forms/pages/deceased.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ export const deceased = defineFormPage({
id: 'event.death.action.declare.form.section.deceased.field.dob.error'
},
validator: field('deceased.dob').isBefore().now()
},
{
message: {
defaultMessage: 'Date of birth must be before the date of death',
description:
'This is the error message for date of birth later than date of death',
id: 'event.death.action.declare.form.section.deceased.field.dob.error.laterThanDeath'
},
validator: field('deceased.dob')
.isBefore()
.date(field('eventDetails.date'))
}
],
label: {
Expand Down
12 changes: 12 additions & 0 deletions src/form/v2/death/forms/pages/eventDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,18 @@ export const eventDetails = defineFormPage({
id: 'event.death.action.declare.form.section.event.field.date.error'
},
validator: field('eventDetails.date').isBefore().now()
},
{
message: {
defaultMessage:
"Date of death must be after the deceased's birth date",
description:
'This is the error message for date of death before date of birth',
id: 'event.death.action.declare.form.section.event.field.date.error.beforeBirth'
},
validator: field('eventDetails.date')
.isAfter()
.date(field('deceased.dob'))
}
],
label: {
Expand Down
2 changes: 2 additions & 0 deletions src/translations/client.csv
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,7 @@ event.death.action.declare.form.section.deceased.field.maritalStatus.label,This
event.death.action.declare.form.section.deceased.field.name.label,This is the label for the field,Deceased's name,Nom du défunt
event.death.action.declare.form.section.deceased.field.numberOfDependants.label,This is the label for the field,No. of dependants,Nombre de personnes à charge
event.death.action.declare.form.section.deceased.field.placeOfDeath.label,This is the label for the field,Place of death,Lieu du décès
event.death.action.declare.form.section.deceased.field.dob.error.laterThanDeath,This is the error message for date of birth later than date of death,Date of birth must be before the date of death,La date de naissance doit être antérieure à la date de décès
event.death.action.declare.form.section.documents.field.proofOfCauseOfDeath.label,This is the label for the field,Proof of cause of death,Preuve de la cause du décès
event.death.action.declare.form.section.documents.field.proofOfDeath.label,This is the label for the field,Proof of death of deceased,Preuve du décès du défunt
event.death.action.declare.form.section.documents.field.proofOfDeceased.label,This is the label for the field,Proof of deceased's ID,Preuve de l'identité du défunt
Expand All @@ -961,6 +962,7 @@ event.death.action.declare.form.section.event.field.description.label,Descriptio
event.death.action.declare.form.section.event.field.manner.label,This is the label for the field,Manner of death,Mode de décès
event.death.action.declare.form.section.event.field.reason.label,This is the label for the field,Reason,Raison
event.death.action.declare.form.section.event.field.sourceCauseDeath.label,This is the label for the field,Source of cause of death,Source de la cause du décès
event.death.action.declare.form.section.event.field.date.error.beforeBirth,This is the error message for date of death before date of birth,Date of death must be after the deceased's birth date,La date du décès doit être postérieure à la date de naissance du défunt
event.death.action.declare.form.section.informant.field.address.addressSameAs.label,This is the label for the field,Same as deceased's usual place of residence?,Identique au lieu de résidence habituel du défunt ?
event.death.action.declare.form.section.informant.field.address.label,This is the label for the field,Usual place of residence,Lieu de résidence habituel
event.death.action.declare.form.section.informant.field.addressHelper.label,This is the label for the field,Usual place of residence,Lieu de résidence habituel
Expand Down
Loading