Skip to content

Commit 89cf0d6

Browse files
authored
Merge pull request #233 from companieshouse/feature/BI-8941_add_missing_field
BI-8941 Add missing field to certificates
2 parents 774bb32 + b7a45fb commit 89cf0d6

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed

src/services/order/certificates/mapping.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export default class CertificateMapping {
6767
general_partner_details: generalPartnerDetails,
6868
include_company_objects_information: itemOptions.includeCompanyObjectsInformation,
6969
include_email_copy: itemOptions.includeEmailCopy,
70+
include_general_nature_of_business_information: itemOptions.includeGeneralNatureOfBusinessInformation,
7071
include_good_standing_information: itemOptions.includeGoodStandingInformation,
7172
limited_partner_details: limitedPartnerDetails,
7273
member_details: ordinaryMemberDetails,
@@ -134,6 +135,7 @@ export default class CertificateMapping {
134135
generalPartnerDetails,
135136
includeCompanyObjectsInformation: io.include_company_objects_information,
136137
includeEmailCopy: io.include_email_copy,
138+
includeGeneralNatureOfBusinessInformation: io.include_general_nature_of_business_information,
137139
includeGoodStandingInformation: io.include_good_standing_information,
138140
limitedPartnerDetails,
139141
memberDetails: ordinaryMemberDetails,

src/services/order/certificates/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export interface ItemOptionsResource {
4141
general_partner_details: GeneralPartnerDetailsResource;
4242
include_company_objects_information: boolean;
4343
include_email_copy: boolean;
44+
include_general_nature_of_business_information: boolean;
4445
include_good_standing_information: boolean;
4546
limited_partner_details: LimitedPartnerDetailsResource;
4647
member_details: OrdinaryMemberDetailsResource;
@@ -142,6 +143,7 @@ export interface ItemOptions {
142143
generalPartnerDetails?: GeneralPartnerDetails;
143144
includeCompanyObjectsInformation: boolean;
144145
includeEmailCopy: boolean;
146+
includeGeneralNatureOfBusinessInformation: boolean;
145147
includeGoodStandingInformation: boolean;
146148
limitedPartnerDetails?: LimitedPartnerDetails;
147149
memberDetails?: OrdinaryMemberDetails;
@@ -228,6 +230,7 @@ export interface ItemOptionsRequest {
228230
generalPartnerDetails?: GeneralPartnerDetailsRequest;
229231
includeCompanyObjectsInformation?: boolean | null;
230232
includeEmailCopy?: boolean;
233+
includeGeneralNatureOfBusinessInformation?: boolean | null;
231234
includeGoodStandingInformation?: boolean | null;
232235
limitedPartnerDetails?: LimitedPartnerDetailsRequest;
233236
memberDetails?: OrdinaryMemberDetailsRequest;

src/services/order/order/mapping.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export default class OrderMapping {
134134
deliveryTimescale: itemResource.delivery_timescale,
135135
deliveryMethod: itemResource.delivery_method,
136136
designatedMemberDetails: designatedMemberDetails,
137+
includeGeneralNatureOfBusinessInformation: itemResource.include_general_nature_of_business_information,
137138
includeGoodStandingInformation: itemResource.include_good_standing_information,
138139
includeCompanyObjectsInformation: itemResource.include_company_objects_information,
139140
generalPartnerDetails: generalPartnerDetails,

src/services/order/order/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export interface CertificateItemOptions {
7676
generalPartnerDetails: {
7777
includeBasicInformation?: boolean;
7878
};
79+
includeGeneralNatureOfBusinessInformation?: boolean;
7980
includeGoodStandingInformation?: boolean;
8081
includeCompanyObjectsInformation?: boolean;
8182
limitedPartnerDetails: {
@@ -216,6 +217,7 @@ export interface CertificateItemOptionsResource {
216217
include_country_of_residence?: boolean;
217218
include_dob_type?: string;
218219
};
220+
include_general_nature_of_business_information?: boolean;
219221
include_good_standing_information?: boolean;
220222
include_company_objects_information?: boolean;
221223
general_partner_details: {

test/services/certificates/service.spec.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const mockResponseBody : CertificateItemResource = ({
5656
},
5757
include_company_objects_information: true,
5858
include_email_copy: true,
59+
include_general_nature_of_business_information: true,
5960
include_good_standing_information: true,
6061
limited_partner_details: {
6162
include_basic_information: true
@@ -126,6 +127,7 @@ const mockResponseBodyMissingFields : CertificateItemResource = ({
126127
general_partner_details: undefined,
127128
include_company_objects_information: true,
128129
include_email_copy: true,
130+
include_general_nature_of_business_information: true,
129131
include_good_standing_information: true,
130132
limited_partner_details: undefined,
131133
member_details: undefined,
@@ -236,6 +238,7 @@ describe("order a certificate GET", () => {
236238
expect(resourceItemOptions.forename).to.equal(mockItemOptions.forename);
237239
expect(resourceItemOptions.includeCompanyObjectsInformation).to.equal(mockItemOptions.include_company_objects_information);
238240
expect(resourceItemOptions.includeEmailCopy).to.equal(mockItemOptions.include_email_copy);
241+
expect(resourceItemOptions.includeGeneralNatureOfBusinessInformation).to.equal(mockItemOptions.include_general_nature_of_business_information);
239242
expect(resourceItemOptions.includeGoodStandingInformation).to.equal(mockItemOptions.include_good_standing_information);
240243
expect(resourceLimitedPartnerDetails.includeBasicInformation).to.equal(mockLimitedPartnerDetails.include_basic_information);
241244
expect(resourceMemberDetails.includeAddress).to.equal(mockMemberDetails.include_address);
@@ -317,6 +320,7 @@ describe("order a certificate GET", () => {
317320
expect(resourceItemOptions.forename).to.equal(mockItemOptions.forename);
318321
expect(resourceItemOptions.includeCompanyObjectsInformation).to.equal(mockItemOptions.include_company_objects_information);
319322
expect(resourceItemOptions.includeEmailCopy).to.equal(mockItemOptions.include_email_copy);
323+
expect(resourceItemOptions.includeGeneralNatureOfBusinessInformation).to.equal(mockItemOptions.include_general_nature_of_business_information);
320324
expect(resourceItemOptions.includeGoodStandingInformation).to.equal(mockItemOptions.include_good_standing_information);
321325
expect(resourceLimitedPartnerDetails).to.be.undefined;
322326
expect(resourceMemberDetails).to.be.undefined;
@@ -372,6 +376,7 @@ describe("create a certificate POST", () => {
372376
},
373377
includeCompanyObjectsInformation: true,
374378
includeEmailCopy: true,
379+
includeGeneralNatureOfBusinessInformation: true,
375380
includeGoodStandingInformation: true,
376381
limitedPartnerDetails: {
377382
includeBasicInformation: true
@@ -467,6 +472,7 @@ describe("create a certificate POST", () => {
467472
expect(io.generalPartnerDetails.includeBasicInformation).to.equal(mockIo.general_partner_details.include_basic_information);
468473
expect(io.includeCompanyObjectsInformation).to.equal(mockIo.include_company_objects_information);
469474
expect(io.includeEmailCopy).to.equal(mockIo.include_email_copy);
475+
expect(io.includeGeneralNatureOfBusinessInformation).to.equal(mockIo.include_general_nature_of_business_information);
470476
expect(io.includeGoodStandingInformation).to.equal(mockIo.include_good_standing_information);
471477
expect(io.limitedPartnerDetails.includeBasicInformation).to.equal(mockIo.limited_partner_details.include_basic_information);
472478
expect(io.memberDetails.includeAddress).to.equal(mockIo.member_details.include_address);
@@ -513,6 +519,7 @@ describe("create a certificate POST", () => {
513519
expect(io.forename).to.equal(mockIo.forename);
514520
expect(io.includeCompanyObjectsInformation).to.equal(mockIo.include_company_objects_information);
515521
expect(io.includeEmailCopy).to.equal(mockIo.include_email_copy);
522+
expect(io.includeGeneralNatureOfBusinessInformation).to.equal(mockIo.include_general_nature_of_business_information);
516523
expect(io.includeGoodStandingInformation).to.equal(mockIo.include_good_standing_information);
517524
expect(io.registeredOfficeAddressDetails).to.be.undefined;
518525
expect(io.secretaryDetails).to.be.undefined;
@@ -554,6 +561,7 @@ describe("update a certificate PATCH", () => {
554561
},
555562
includeCompanyObjectsInformation: true,
556563
includeEmailCopy: true,
564+
includeGeneralNatureOfBusinessInformation: true,
557565
includeGoodStandingInformation: true,
558566
limitedPartnerDetails: {
559567
includeBasicInformation: true
@@ -649,6 +657,7 @@ describe("update a certificate PATCH", () => {
649657
expect(io.generalPartnerDetails.includeBasicInformation).to.equal(mockIo.general_partner_details.include_basic_information);
650658
expect(io.includeCompanyObjectsInformation).to.equal(mockIo.include_company_objects_information);
651659
expect(io.includeEmailCopy).to.equal(mockIo.include_email_copy);
660+
expect(io.includeGeneralNatureOfBusinessInformation).to.equal(mockIo.include_general_nature_of_business_information);
652661
expect(io.includeGoodStandingInformation).to.equal(mockIo.include_good_standing_information);
653662
expect(io.limitedPartnerDetails.includeBasicInformation).to.equal(mockIo.limited_partner_details.include_basic_information);
654663
expect(io.memberDetails.includeAddress).to.equal(mockIo.member_details.include_address);
@@ -695,6 +704,7 @@ describe("update a certificate PATCH", () => {
695704
expect(io.forename).to.equal(mockIo.forename);
696705
expect(io.includeCompanyObjectsInformation).to.equal(mockIo.include_company_objects_information);
697706
expect(io.includeEmailCopy).to.equal(mockIo.include_email_copy);
707+
expect(io.includeGeneralNatureOfBusinessInformation).to.equal(mockIo.include_general_nature_of_business_information);
698708
expect(io.includeGoodStandingInformation).to.equal(mockIo.include_good_standing_information);
699709
expect(io.registeredOfficeAddressDetails).to.be.undefined;
700710
expect(io.secretaryDetails).to.be.undefined;

test/services/order/service.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const mockCertificateOrderResponseBody: OrderResource = {
6767
general_partner_details: {},
6868
limited_partner_details: {},
6969
member_details: {},
70+
include_general_nature_of_business_information: true,
7071
include_good_standing_information: true,
7172
principle_place_of_business_details: {},
7273
registered_office_address_details: {},
@@ -366,6 +367,7 @@ describe("order", () => {
366367
expect(itemOptions.deliveryTimescale).to.equal(itemOptionsResource.delivery_timescale);
367368
expect(itemOptions.directorDetails.includeBasicInformation).to.equal(itemOptionsResource.director_details.include_basic_information);
368369
expect(itemOptions.forename).to.equal(itemOptionsResource.forename);
370+
expect(itemOptions.includeGeneralNatureOfBusinessInformation).to.equal(itemOptionsResource.include_general_nature_of_business_information);
369371
expect(itemOptions.includeGoodStandingInformation).to.equal(itemOptionsResource.include_good_standing_information);
370372
expect(itemOptions.registeredOfficeAddressDetails).to.be.undefined;
371373
expect(itemOptions.secretaryDetails).to.be.undefined;

0 commit comments

Comments
 (0)