Skip to content

Commit

Permalink
Fix AccountNotLinedToRequisition Error typo (#465)
Browse files Browse the repository at this point in the history
* fix GCL AccountNotLinedToRequisition typo

* release note
  • Loading branch information
matt-fidd authored Sep 25, 2024
1 parent c01e229 commit 2e70c11
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/app-gocardless/app-gocardless.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { inspect } from 'util';

import { goCardlessService } from './services/gocardless-service.js';
import {
AccountNotLinedToRequisition,
AccountNotLinkedToRequisition,
GenericGoCardlessError,
RateLimitError,
RequisitionNotLinked,
Expand Down Expand Up @@ -214,7 +214,7 @@ app.post(
'Access to account has expired as set in End User Agreement',
});
break;
case error instanceof AccountNotLinedToRequisition:
case error instanceof AccountNotLinkedToRequisition:
sendErrorResponse({
error_type: 'INVALID_INPUT',
error_code: 'INVALID_ACCESS_TOKEN',
Expand Down
2 changes: 1 addition & 1 deletion src/app-gocardless/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export class RequisitionNotLinked extends Error {
}
}

export class AccountNotLinedToRequisition extends Error {
export class AccountNotLinkedToRequisition extends Error {
constructor(accountId, requisitionId) {
super('Provided account id is not linked to given requisition');
this.details = {
Expand Down
10 changes: 5 additions & 5 deletions src/app-gocardless/services/gocardless-service.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import BankFactory, { BANKS_WITH_LIMITED_HISTORY } from '../bank-factory.js';
import {
AccessDeniedError,
AccountNotLinedToRequisition,
AccountNotLinkedToRequisition,
GenericGoCardlessError,
InvalidInputDataError,
InvalidGoCardlessTokenError,
Expand Down Expand Up @@ -181,7 +181,7 @@ export const goCardlessService = {
* @param accountId
* @param startDate
* @param endDate
* @throws {AccountNotLinedToRequisition} Will throw an error if requisition not includes provided account id
* @throws {AccountNotLinkedToRequisition} Will throw an error if requisition not includes provided account id
* @throws {RequisitionNotLinked} Will throw an error if requisition is not in Linked
* @throws {InvalidInputDataError}
* @throws {InvalidGoCardlessTokenError}
Expand All @@ -203,7 +203,7 @@ export const goCardlessService = {
await goCardlessService.getLinkedRequisition(requisitionId);

if (!accountIds.includes(accountId)) {
throw new AccountNotLinedToRequisition(accountId, requisitionId);
throw new AccountNotLinkedToRequisition(accountId, requisitionId);
}

const [normalizedTransactions, accountBalance] = await Promise.all([
Expand Down Expand Up @@ -239,7 +239,7 @@ export const goCardlessService = {
* @param accountId
* @param startDate
* @param endDate
* @throws {AccountNotLinedToRequisition} Will throw an error if requisition not includes provided account id
* @throws {AccountNotLinkedToRequisition} Will throw an error if requisition not includes provided account id
* @throws {RequisitionNotLinked} Will throw an error if requisition is not in Linked
* @throws {InvalidInputDataError}
* @throws {InvalidGoCardlessTokenError}
Expand All @@ -261,7 +261,7 @@ export const goCardlessService = {
await goCardlessService.getLinkedRequisition(requisitionId);

if (!accountIds.includes(accountId)) {
throw new AccountNotLinedToRequisition(accountId, requisitionId);
throw new AccountNotLinkedToRequisition(accountId, requisitionId);
}

const transactions = await goCardlessService.getTransactions({
Expand Down
6 changes: 3 additions & 3 deletions src/app-gocardless/services/tests/gocardless-service.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { jest } from '@jest/globals';
import {
AccessDeniedError,
AccountNotLinedToRequisition,
AccountNotLinkedToRequisition,
GenericGoCardlessError,
InvalidInputDataError,
InvalidGoCardlessTokenError,
Expand Down Expand Up @@ -215,7 +215,7 @@ describe('goCardlessService', () => {
);
});

it('throws AccountNotLinedToRequisition error if requisition accounts not includes requested account', async () => {
it('throws AccountNotLinkedToRequisition error if requisition accounts not includes requested account', async () => {
jest
.spyOn(goCardlessService, 'getLinkedRequisition')
.mockResolvedValue(mockRequisition);
Expand All @@ -227,7 +227,7 @@ describe('goCardlessService', () => {
startDate: undefined,
endDate: undefined,
}),
).rejects.toThrow(AccountNotLinedToRequisition);
).rejects.toThrow(AccountNotLinkedToRequisition);
});
});

Expand Down
6 changes: 6 additions & 0 deletions upcoming-release-notes/465.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [matt-fidd]
---

Fix typo in GoCardless Error type

0 comments on commit 2e70c11

Please sign in to comment.