@companieshouse/api-sdk-node 2.0.3 → 2.0.4
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.
|
@@ -20,7 +20,8 @@ const mapOverseasEntity = (body) => {
|
|
|
20
20
|
beneficial_owners_individual: mapBeneficialOwnersIndividual(body.beneficial_owners_individual),
|
|
21
21
|
beneficial_owners_corporate: mapBeneficialOwnersCorporate(body.beneficial_owners_corporate),
|
|
22
22
|
beneficial_owners_government_or_public_authority: mapBeneficialOwnersGovernment(body.beneficial_owners_government_or_public_authority),
|
|
23
|
-
managing_officers_individual: mapManagingOfficersIndividual(body.managing_officers_individual)
|
|
23
|
+
managing_officers_individual: mapManagingOfficersIndividual(body.managing_officers_individual),
|
|
24
|
+
managing_officers_corporate: mapManagingOfficersCorporate(body.managing_officers_corporate)
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
exports.mapOverseasEntity = mapOverseasEntity;
|
|
@@ -80,6 +81,20 @@ const mapManagingOfficersIndividual = (moIndividuals = []) => {
|
|
|
80
81
|
});
|
|
81
82
|
return moIndividualResources;
|
|
82
83
|
};
|
|
84
|
+
/**
|
|
85
|
+
* Convert the ManagingOfficerCorporate array data into the Resource format that the API expects
|
|
86
|
+
* (just converting dates currently)
|
|
87
|
+
* @param moCorporates Array of ManagingOfficerCorporate objects
|
|
88
|
+
* @returns Array of ManagingOfficerCorporateResource
|
|
89
|
+
*/
|
|
90
|
+
const mapManagingOfficersCorporate = (moCorporates = []) => {
|
|
91
|
+
const boCorporateResources = [];
|
|
92
|
+
moCorporates.forEach(moCorporate => {
|
|
93
|
+
const { start_date } = moCorporate, rest = __rest(moCorporate, ["start_date"]);
|
|
94
|
+
boCorporateResources.push(Object.assign(Object.assign({}, rest), { start_date: convertDateToIsoDateString(start_date.day, start_date.month, start_date.year) }));
|
|
95
|
+
});
|
|
96
|
+
return boCorporateResources;
|
|
97
|
+
};
|
|
83
98
|
const convertDateToIsoDateString = (day, month, year) => {
|
|
84
99
|
return `${year}-${zeroPadNumber(month)}-${zeroPadNumber(day)}`;
|
|
85
100
|
};
|
|
@@ -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":";;;;;;;;;;;;;;AAQO,MAAM,iBAAiB,GAAG,CAAC,IAAoB,EAA0B,EAAE;IAC9E,OAAO;QACH,SAAS,oBAAO,IAAI,CAAC,SAAS,CAAE;QAChC,MAAM,oBAAO,IAAI,CAAC,MAAM,CAAE;QAC1B,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,4BAA4B,CAAC,IAAI,CAAC,2BAA2B,CAAC;KAC9F,CAAC;AACN,CAAC,CAAC;AAXW,QAAA,iBAAiB,qBAW5B;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;QAC5D,qBAAqB,CAAC,IAAI,iCACnB,IAAI,KACP,aAAa,EAAE,0BAA0B,CAAC,aAAa,CAAC,GAAG,EAAE,aA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AAK,CAAC;AACjB,CAAC,CAAA"}
|
|
@@ -9,6 +9,7 @@ export interface OverseasEntity {
|
|
|
9
9
|
beneficial_owners_corporate?: BeneficialOwnerCorporate[];
|
|
10
10
|
beneficial_owners_government_or_public_authority?: BeneficialOwnerGovernmentOrPublicAuthority[];
|
|
11
11
|
managing_officers_individual?: ManagingOfficerIndividual[];
|
|
12
|
+
managing_officers_corporate?: ManagingOfficerCorporate[];
|
|
12
13
|
}
|
|
13
14
|
export interface OverseasEntityResource {
|
|
14
15
|
presenter?: Presenter;
|
|
@@ -18,6 +19,7 @@ export interface OverseasEntityResource {
|
|
|
18
19
|
beneficial_owners_corporate?: BeneficialOwnerCorporateResource[];
|
|
19
20
|
beneficial_owners_government_or_public_authority?: BeneficialOwnerGovernmentOrPublicAuthorityResource[];
|
|
20
21
|
managing_officers_individual?: ManagingOfficerIndividualResource[];
|
|
22
|
+
managing_officers_corporate?: ManagingOfficerCorporateResource[];
|
|
21
23
|
}
|
|
22
24
|
export interface OverseasEntityCreated {
|
|
23
25
|
id: string;
|
|
@@ -150,6 +152,30 @@ export interface ManagingOfficerIndividualResource {
|
|
|
150
152
|
occupation?: string;
|
|
151
153
|
role_and_responsibilities?: string;
|
|
152
154
|
}
|
|
155
|
+
export interface ManagingOfficerCorporate {
|
|
156
|
+
name?: string;
|
|
157
|
+
principal_address?: Address;
|
|
158
|
+
service_address?: Address;
|
|
159
|
+
is_service_address_same_as_principal_address?: yesNoResponse;
|
|
160
|
+
legal_form?: string;
|
|
161
|
+
law_governed?: string;
|
|
162
|
+
is_on_register_in_country_formed_in?: yesNoResponse;
|
|
163
|
+
public_register_name?: string;
|
|
164
|
+
registration_number?: string;
|
|
165
|
+
start_date?: InputDate;
|
|
166
|
+
}
|
|
167
|
+
export interface ManagingOfficerCorporateResource {
|
|
168
|
+
name?: string;
|
|
169
|
+
principal_address?: Address;
|
|
170
|
+
service_address?: Address;
|
|
171
|
+
is_service_address_same_as_principal_address?: yesNoResponse;
|
|
172
|
+
legal_form?: string;
|
|
173
|
+
law_governed?: string;
|
|
174
|
+
is_on_register_in_country_formed_in?: yesNoResponse;
|
|
175
|
+
public_register_name?: string;
|
|
176
|
+
registration_number?: string;
|
|
177
|
+
start_date?: string;
|
|
178
|
+
}
|
|
153
179
|
/**
|
|
154
180
|
* Shared Data Type
|
|
155
181
|
*/
|
|
@@ -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;;;AA2MH,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,6CAAM,CAAA;IACN,+CAAO,CAAA;AACX,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAQD,IAAY,6BAMX;AAND,WAAY,6BAA6B;IACrC,0FAAyD,CAAA;IACzD,4FAA2D,CAAA;IAC3D,4FAA2D,CAAA;IAC3D,8FAA6D,CAAA;IAC7D,oEAAmC,CAAA;AACvC,CAAC,EANW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAMxC;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"}
|