Skip to content

Commit 910387a

Browse files
authored
Merge pull request #828 from companieshouse/cse-681-sic-code-transaction
Update service.ts
2 parents 8308ad0 + 5ab7fb2 commit 910387a

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/services/confirmation-statement/service.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,6 @@ export default class {
105105
const resp: HttpResponse =
106106
await this.client.httpPost(`${baseUrl}/${confirmationStatementId}`,
107107
this.mapToConfirmationStatementSubmissionResource(csSubmission));
108-
const sicCodes = csSubmission.data?.sicCodeData?.sicCode || [];
109-
110-
this.validateSicCodes(sicCodes);
111108

112109
const resource: Resource<ConfirmationStatementSubmission> = {
113110
httpStatusCode: resp.status
@@ -701,20 +698,4 @@ export default class {
701698
private getConfirmationStatementUrl (companyNumber: string) {
702699
return `/confirmation-statement/company/${companyNumber}`;
703700
}
704-
705-
private validateSicCodes (sicCodes: SicCode[]) {
706-
const hasDuplicateSicCodes = new Set(sicCodes.map(sc => sc.code)).size !== sicCodes.length;
707-
708-
if (sicCodes.length === 0) {
709-
throw new Error(`At least one SIC code must be associated.`);
710-
}
711-
712-
if (sicCodes.length > 4) {
713-
throw new Error(`Maximum of 4 SIC codes must be associated.`);
714-
}
715-
716-
if (hasDuplicateSicCodes) {
717-
throw new Error(`Can not have duplicate SIC codes.`);
718-
}
719-
}
720701
}

0 commit comments

Comments
 (0)