@companieshouse/api-sdk-node 2.0.12 → 2.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -17,6 +17,7 @@ const mapOverseasEntity = (body) => {
|
|
|
17
17
|
presenter: Object.assign({}, body.presenter),
|
|
18
18
|
entity: Object.assign({}, body.entity),
|
|
19
19
|
due_diligence: mapDueDiligence(body.due_diligence),
|
|
20
|
+
overseas_entity_due_diligence: mapOverseasEntityDueDiligence(body.overseas_entity_due_diligence),
|
|
20
21
|
beneficial_owners_statement: body.beneficial_owners_statement,
|
|
21
22
|
beneficial_owners_individual: mapBeneficialOwnersIndividual(body.beneficial_owners_individual),
|
|
22
23
|
beneficial_owners_corporate: mapBeneficialOwnersCorporate(body.beneficial_owners_corporate),
|
|
@@ -96,6 +97,23 @@ const mapDueDiligence = (dueDiligence) => {
|
|
|
96
97
|
}
|
|
97
98
|
return {};
|
|
98
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* Convert the Overseas Entity Due Diligence data into the Resource format that the API expects
|
|
102
|
+
* (just converting dates currently)
|
|
103
|
+
* @param oeDueDiligence OverseasEntityDueDiligence objects
|
|
104
|
+
* @returns OverseasEntityDueDiligenceResource
|
|
105
|
+
*/
|
|
106
|
+
const mapOverseasEntityDueDiligence = (oeDueDiligence) => {
|
|
107
|
+
if (oeDueDiligence && Object.keys(oeDueDiligence).length) {
|
|
108
|
+
const identityDate = oeDueDiligence.identity_date || {};
|
|
109
|
+
const identity_date = convertOptionalDateToIsoDateString(identityDate.day, identityDate.month, identityDate.year);
|
|
110
|
+
return Object.assign(Object.assign({}, oeDueDiligence), { identity_date });
|
|
111
|
+
}
|
|
112
|
+
return {};
|
|
113
|
+
};
|
|
114
|
+
const convertOptionalDateToIsoDateString = (day = "", month = "", year = "") => {
|
|
115
|
+
return (day && month && year) ? convertDateToIsoDateString(day, month, year) : "";
|
|
116
|
+
};
|
|
99
117
|
const convertDateToIsoDateString = (day, month, year) => {
|
|
100
118
|
return `${year}-${zeroPadNumber(month)}-${zeroPadNumber(day)}`;
|
|
101
119
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../../../src/services/overseas-entities/mapping.ts"],"names":[],"mappings":";;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../../../src/services/overseas-entities/mapping.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAkBO,MAAM,iBAAiB,GAAG,CAAC,IAAoB,EAA0B,EAAE;IAC9E,OAAO;QACH,SAAS,oBAAO,IAAI,CAAC,SAAS,CAAE;QAChC,MAAM,oBAAO,IAAI,CAAC,MAAM,CAAE;QAC1B,aAAa,EAAE,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC;QAClD,6BAA6B,EAAE,6BAA6B,CAAC,IAAI,CAAC,6BAA6B,CAAC;QAChG,2BAA2B,EAAE,IAAI,CAAC,2BAA2B;QAC7D,4BAA4B,EAAE,6BAA6B,CAAC,IAAI,CAAC,4BAA4B,CAAC;QAC9F,2BAA2B,EAAE,4BAA4B,CAAC,IAAI,CAAC,2BAA2B,CAAC;QAC3F,gDAAgD,EAAE,6BAA6B,CAAC,IAAI,CAAC,gDAAgD,CAAC;QACtI,4BAA4B,EAAE,6BAA6B,CAAC,IAAI,CAAC,4BAA4B,CAAC;QAC9F,2BAA2B,EAAE,IAAI,CAAC,2BAA2B;KAChE,CAAC;AACN,CAAC,CAAC;AAbW,QAAA,iBAAiB,qBAa5B;AAEF;;;;;GAKG;AACH,MAAM,6BAA6B,GAAG,CAAC,gBAA6C,EAAE,EAAuC,EAAE;IAC3H,MAAM,qBAAqB,GAAwC,EAAE,CAAC;IACtE,aAAa,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACjC,MAAM,EAAE,aAAa,EAAE,UAAU,KAAc,YAAY,EAArB,IAAI,UAAK,YAAY,EAArD,+BAAsC,CAAe,CAAC;QA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
|
+
overseas_entity_due_diligence?: OverseasEntityDueDiligence;
|
|
8
9
|
beneficial_owners_statement?: BeneficialOwnersStatementType;
|
|
9
10
|
beneficial_owners_individual?: BeneficialOwnerIndividual[];
|
|
10
11
|
beneficial_owners_corporate?: BeneficialOwnerCorporate[];
|
|
@@ -16,6 +17,7 @@ export interface OverseasEntityResource {
|
|
|
16
17
|
presenter?: Presenter;
|
|
17
18
|
entity?: Entity;
|
|
18
19
|
due_diligence?: DueDiligenceResource;
|
|
20
|
+
overseas_entity_due_diligence?: OverseasEntityDueDiligenceResource;
|
|
19
21
|
beneficial_owners_statement?: BeneficialOwnersStatementType;
|
|
20
22
|
beneficial_owners_individual?: BeneficialOwnerIndividualResource[];
|
|
21
23
|
beneficial_owners_corporate?: BeneficialOwnerCorporateResource[];
|
|
@@ -68,6 +70,24 @@ export interface DueDiligenceResource {
|
|
|
68
70
|
partner_name?: string;
|
|
69
71
|
diligence?: string;
|
|
70
72
|
}
|
|
73
|
+
export interface OverseasEntityDueDiligence {
|
|
74
|
+
identity_date?: InputDate;
|
|
75
|
+
name?: string;
|
|
76
|
+
identity_address?: Address;
|
|
77
|
+
email?: string;
|
|
78
|
+
supervisory_name?: string;
|
|
79
|
+
aml_number?: string;
|
|
80
|
+
partner_name?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface OverseasEntityDueDiligenceResource {
|
|
83
|
+
identity_date?: string;
|
|
84
|
+
name?: string;
|
|
85
|
+
identity_address?: Address;
|
|
86
|
+
email?: string;
|
|
87
|
+
supervisory_name?: string;
|
|
88
|
+
aml_number?: string;
|
|
89
|
+
partner_name?: string;
|
|
90
|
+
}
|
|
71
91
|
export interface BeneficialOwnerIndividual {
|
|
72
92
|
first_name?: string;
|
|
73
93
|
last_name?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/overseas-entities/types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/services/overseas-entities/types.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAgPH,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,6CAAM,CAAA;IACN,+CAAO,CAAA;AACX,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAQD,IAAY,6BAIX;AAJD,WAAY,6BAA6B;IACrC,0FAAyD,CAAA;IACzD,4FAA2D,CAAA;IAC3D,oEAAmC,CAAA;AACvC,CAAC,EAJW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAIxC;AAED,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,8EAAuD,CAAA;IACvD,4FAAqE,CAAA;IACrE,gHAAyF,CAAA;IACzF,4FAAqE,CAAA;AACzE,CAAC,EALW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAK9B"}
|