Skip to content

Commit 2a99d72

Browse files
committed
Change OTHER requester and fixed typos in historyResolver
1 parent 9e76b6d commit 2a99d72

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { Certificate, HistoryItem } from './types.ts'
22

33
export const collectorResolver = {
4-
'collector.requesterId': (data: Certificate) => data.collector?.relationship,
4+
'collector.requesterId': (data: Certificate) =>
5+
other(data) ? 'SOMEONE_ELSE' : data.collector?.relationship,
56
'collector.OTHER.name': (data: Certificate) =>
67
other(data) && {
78
surname: data.collector?.name[0].familyName, // TODO - I think I need to use the name resolver
@@ -14,11 +15,13 @@ export const collectorResolver = {
1415
other(data) && getId(data).type,
1516
'collector.PASSPORT.details': (data: Certificate) =>
1617
getIdForType(data, 'PASSPORT'),
17-
'collector.DRIVING_LICENSE.details': (data: Certificate) =>
18+
'collector.DRIVING-LICENCE.details': (data: Certificate) =>
1819
getIdForType(data, 'DRIVING_LICENSE'),
19-
'collector.REFUGEE_NUMBER.details': (data: Certificate) =>
20+
'collector.DRIVING-LICENSE.details': (data: Certificate) =>
21+
getIdForType(data, 'DRIVING_LICENSE'),
22+
'collector.REFUGEE-NUMBER.details': (data: Certificate) =>
2023
getIdForType(data, 'REFUGEE_NUMBER'),
21-
'collector.ALIEN_NUMBER.details': (data: Certificate) =>
24+
'collector.ALIEN-NUMBER.details': (data: Certificate) =>
2225
getIdForType(data, 'ALIEN_NUMBER'),
2326
'collector.OTHER.idTypeOther': (data: Certificate) =>
2427
other(data) && getId(data).otherType,
@@ -41,6 +44,9 @@ export const collectorResolver = {
4144
'collector.collect.payment.data.beforeRegistrationTarget': (
4245
data: Certificate
4346
) => data.x, // TODO
47+
'collector.collect.payment.data.afterRegistrationTarget': (
48+
data: Certificate
49+
) => data.x, // TODO
4450
}
4551

4652
export const correctionResolver = {

0 commit comments

Comments
 (0)