From 85774843313109049188be12a3e5a74cbfed8dc7 Mon Sep 17 00:00:00 2001 From: mattch1 Date: Mon, 6 Jan 2025 11:24:40 +0000 Subject: [PATCH 1/6] LP-367 Limited partnerships - Update PATCH function data parameter --- src/services/limited-partnerships/service.ts | 2 +- .../limited.partnerships.spec.ts | 23 ++++++------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/services/limited-partnerships/service.ts b/src/services/limited-partnerships/service.ts index b9d619e7..dc9c01c1 100644 --- a/src/services/limited-partnerships/service.ts +++ b/src/services/limited-partnerships/service.ts @@ -30,7 +30,7 @@ export default class LimitedPartnershipsService { public async patchLimitedPartnership ( transactionId: string, submissionId: string, - body: { type: string; data: Record } + body: LimitedPartnership["data"] ): Promise | ApiErrorResponse> { const URL = `/transactions/${transactionId}/limited-partnership/partnership/${submissionId}`; const response: HttpResponse = await this.client.httpPatch(URL, body); diff --git a/test/services/limited-partnerships/limited.partnerships.spec.ts b/test/services/limited-partnerships/limited.partnerships.spec.ts index 0c8cda15..92974a23 100644 --- a/test/services/limited-partnerships/limited.partnerships.spec.ts +++ b/test/services/limited-partnerships/limited.partnerships.spec.ts @@ -127,11 +127,8 @@ describe("LimitedPartnershipsService", () => { const response = await service.patchLimitedPartnership( mockValues.TRANSACTION_ID, mockValues.SUBMISSION_ID, - { - type: "email", - data: { - email: "test@email.com" - } + { + email: "test@email.com" } ); @@ -139,11 +136,8 @@ describe("LimitedPartnershipsService", () => { expect( mockRequest.calledWith( "/transactions/12345/limited-partnership/partnership/09876", - { - type: "email", - data: { - email: "test@email.com" - } + { + email: "test@email.com" } ) ).to.be.true; @@ -162,9 +156,8 @@ describe("LimitedPartnershipsService", () => { const response = await service.patchLimitedPartnership( mockValues.TRANSACTION_ID, mockValues.SUBMISSION_ID, - { - type: "email", - data: {} + { + } ) as ApiErrorResponse; @@ -172,9 +165,7 @@ describe("LimitedPartnershipsService", () => { expect( mockRequest.calledWith( "/transactions/12345/limited-partnership/partnership/09876", - { - type: "email", - data: {} + { } ) From 7bf30e2e0be27c70aa3b0b5cb26da530bcd909eb Mon Sep 17 00:00:00 2001 From: mattch1 Date: Mon, 6 Jan 2025 11:31:39 +0000 Subject: [PATCH 2/6] LP-367 Indentation and spacing --- .../limited-partnerships/limited.partnerships.spec.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/services/limited-partnerships/limited.partnerships.spec.ts b/test/services/limited-partnerships/limited.partnerships.spec.ts index 92974a23..5306f89c 100644 --- a/test/services/limited-partnerships/limited.partnerships.spec.ts +++ b/test/services/limited-partnerships/limited.partnerships.spec.ts @@ -156,18 +156,14 @@ describe("LimitedPartnershipsService", () => { const response = await service.patchLimitedPartnership( mockValues.TRANSACTION_ID, mockValues.SUBMISSION_ID, - { - - } + {} ) as ApiErrorResponse; expect(mockRequest).to.have.been.calledOnce; expect( mockRequest.calledWith( "/transactions/12345/limited-partnership/partnership/09876", - { - - } + {} ) ).to.be.true; From 3bbf0246bcc5d5b7f9763d33aacfee7a6a6dedcf Mon Sep 17 00:00:00 2001 From: mattch1 Date: Mon, 6 Jan 2025 11:38:31 +0000 Subject: [PATCH 3/6] LP-367 Trailing spaces --- .../limited-partnerships/limited.partnerships.spec.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/services/limited-partnerships/limited.partnerships.spec.ts b/test/services/limited-partnerships/limited.partnerships.spec.ts index 5306f89c..4b5f358e 100644 --- a/test/services/limited-partnerships/limited.partnerships.spec.ts +++ b/test/services/limited-partnerships/limited.partnerships.spec.ts @@ -127,8 +127,8 @@ describe("LimitedPartnershipsService", () => { const response = await service.patchLimitedPartnership( mockValues.TRANSACTION_ID, mockValues.SUBMISSION_ID, - { - email: "test@email.com" + { + email: "test@email.com" } ); @@ -136,8 +136,8 @@ describe("LimitedPartnershipsService", () => { expect( mockRequest.calledWith( "/transactions/12345/limited-partnership/partnership/09876", - { - email: "test@email.com" + { + email: "test@email.com" } ) ).to.be.true; From f400d08c7c459c6889a82a44a7abc5ae6234f4f1 Mon Sep 17 00:00:00 2001 From: mattch1 Date: Mon, 6 Jan 2025 12:24:39 +0000 Subject: [PATCH 4/6] LP-367 Stopped using empty object in test --- .../limited-partnerships/limited.partnerships.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/services/limited-partnerships/limited.partnerships.spec.ts b/test/services/limited-partnerships/limited.partnerships.spec.ts index 4b5f358e..06bb8027 100644 --- a/test/services/limited-partnerships/limited.partnerships.spec.ts +++ b/test/services/limited-partnerships/limited.partnerships.spec.ts @@ -156,14 +156,18 @@ describe("LimitedPartnershipsService", () => { const response = await service.patchLimitedPartnership( mockValues.TRANSACTION_ID, mockValues.SUBMISSION_ID, - {} + { + email: "testemail.com" + } ) as ApiErrorResponse; expect(mockRequest).to.have.been.calledOnce; expect( mockRequest.calledWith( "/transactions/12345/limited-partnership/partnership/09876", - {} + { + email: "testemail.com" + } ) ).to.be.true; From 3075749caac456056aefc4d7ede89cbd867ee17a Mon Sep 17 00:00:00 2001 From: mattch1 Date: Wed, 8 Jan 2025 09:13:57 +0000 Subject: [PATCH 5/6] TEMP: Log new sdk for testing --- src/services/limited-partnerships/service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/limited-partnerships/service.ts b/src/services/limited-partnerships/service.ts index dc9c01c1..79fc2a6b 100644 --- a/src/services/limited-partnerships/service.ts +++ b/src/services/limited-partnerships/service.ts @@ -34,7 +34,7 @@ export default class LimitedPartnershipsService { ): Promise | ApiErrorResponse> { const URL = `/transactions/${transactionId}/limited-partnership/partnership/${submissionId}`; const response: HttpResponse = await this.client.httpPatch(URL, body); - + console.log("\n\n\n\n>>>>>>>>>>>>>>>>>>> THE NEW SDK"); if (response.error) { return { httpStatusCode: response.status, From c04bda9a755810e1b3ef8167f3ceb2d43492ef6d Mon Sep 17 00:00:00 2001 From: mattch1 Date: Wed, 8 Jan 2025 09:55:02 +0000 Subject: [PATCH 6/6] Removed temporary console logging --- src/services/limited-partnerships/service.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/services/limited-partnerships/service.ts b/src/services/limited-partnerships/service.ts index 79fc2a6b..1f37ad9b 100644 --- a/src/services/limited-partnerships/service.ts +++ b/src/services/limited-partnerships/service.ts @@ -34,7 +34,6 @@ export default class LimitedPartnershipsService { ): Promise | ApiErrorResponse> { const URL = `/transactions/${transactionId}/limited-partnership/partnership/${submissionId}`; const response: HttpResponse = await this.client.httpPatch(URL, body); - console.log("\n\n\n\n>>>>>>>>>>>>>>>>>>> THE NEW SDK"); if (response.error) { return { httpStatusCode: response.status,