Skip to content

Commit df9f4ae

Browse files
committed
add back age mappings
1 parent b760546 commit df9f4ae

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

v1-to-v2-data-migration/helpers/defaultMappings.ts

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,47 @@ export const VERIFIED_MAPPINGS : Record<
144144
'death.spouse.verified': (data: string) => ({
145145
'spouse.verified': data === '' ? undefined : data,
146146
}),
147-
}
147+
}
148+
149+
export const AGE_MAPPINGS: Record<
150+
string,
151+
(data: string) => Record<string, any>
152+
> = {
153+
'birth.mother.ageOfIndividualInYears': (data: string) => ({
154+
'mother.age': {
155+
age: data,
156+
asOfDateRef: 'child.dob',
157+
},
158+
}),
159+
'birth.father.ageOfIndividualInYears': (data: string) => ({
160+
'father.age': {
161+
age: data,
162+
asOfDateRef: 'child.dob',
163+
},
164+
}),
165+
'birth.informant.ageOfIndividualInYears': (data: string) => ({
166+
'informant.age': {
167+
age: data,
168+
asOfDateRef: 'child.dob',
169+
},
170+
}),
171+
'death.deceased.ageOfIndividualInYears': (data: string) => ({
172+
'deceased.age': {
173+
age: data,
174+
asOfDateRef: 'eventDetails.date',
175+
},
176+
}),
177+
'death.informant.ageOfIndividualInYears': (data: string) => ({
178+
'informant.age': {
179+
age: data,
180+
asOfDateRef: 'eventDetails.date',
181+
},
182+
}),
183+
'death.spouse.ageOfIndividualInYears': (data: string) => ({
184+
'spouse.age': {
185+
age: data,
186+
asOfDateRef: 'eventDetails.date',
187+
},
188+
}),
189+
}
190+

0 commit comments

Comments
 (0)