Skip to content

Commit db90f20

Browse files
committed
Update service.ts
Removing validation from here. Should be added to confirmation-statement-api instead.
1 parent c010e13 commit db90f20

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

src/services/confirmation-statement/service.ts

Lines changed: 0 additions & 18 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
@@ -702,19 +699,4 @@ export default class {
702699
return `/confirmation-statement/company/${companyNumber}`;
703700
}
704701

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-
}
720702
}

0 commit comments

Comments
 (0)