Skip to content

Commit 9c6b9d1

Browse files
authored
chore: remove unused pos & card service components (#3737)
* chore(testenv): remove port * chore(localenv): removed card & pos volumes, ports, seed * chore(card-service): remove init script * chore(backend): remove unused card service * chore(backend): remove card expiry from outgoing payment errors
1 parent 4d1e1e4 commit 9c6b9d1

File tree

9 files changed

+4
-186
lines changed

9 files changed

+4
-186
lines changed

localenv/admin-auth/dbinit.sql

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ CREATE USER cloud_nine_wallet_auth WITH PASSWORD 'cloud_nine_wallet_auth';
66
CREATE DATABASE cloud_nine_wallet_auth;
77
ALTER DATABASE cloud_nine_wallet_auth OWNER TO cloud_nine_wallet_auth;
88

9-
CREATE USER cloud_nine_wallet_card WITH PASSWORD 'cloud_nine_wallet_card';
10-
CREATE DATABASE cloud_nine_wallet_card;
11-
ALTER DATABASE cloud_nine_wallet_card OWNER TO cloud_nine_wallet_card;
12-
139
CREATE USER happy_life_bank_backend WITH PASSWORD 'happy_life_bank_backend';
1410
CREATE DATABASE happy_life_bank_backend;
1511
ALTER DATABASE happy_life_bank_backend OWNER TO happy_life_bank_backend;
@@ -18,10 +14,6 @@ CREATE USER happy_life_bank_auth WITH PASSWORD 'happy_life_bank_auth';
1814
CREATE DATABASE happy_life_bank_auth;
1915
ALTER DATABASE happy_life_bank_auth OWNER TO happy_life_bank_auth;
2016

21-
CREATE USER happy_life_bank_card WITH PASSWORD 'happy_life_bank_card';
22-
CREATE DATABASE happy_life_bank_card;
23-
ALTER DATABASE happy_life_bank_card OWNER TO happy_life_bank_card;
24-
2517
CREATE USER happy_life_kratos WITH PASSWORD 'kratos_password';
2618
CREATE DATABASE happy_life_kratos;
2719
ALTER DATABASE happy_life_kratos OWNER TO happy_life_kratos;

localenv/cloud-nine-wallet/docker-compose.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,7 @@ services:
1010
networks:
1111
- rafiki
1212
ports:
13-
- '3007:3007'
1413
- '9234:9229'
15-
volumes:
16-
- type: bind
17-
source: ../../packages/card-service/src
18-
target: /home/rafiki/packages/card-service/src
19-
read_only: true
2014
environment:
2115
NODE_ENV: ${NODE_ENV:-development}
2216
INSTANCE_NAME: CLOUD-NINE

localenv/happy-life-bank/docker-compose.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ services:
1212
ports:
1313
- '4008:4008'
1414
- '9233:9229'
15-
volumes:
16-
- type: bind
17-
source: ../../packages/point-of-sale/src
18-
target: /home/rafiki/packages/point-of-sale/src
19-
read_only: true
2015
environment:
2116
NODE_ENV: ${NODE_ENV:-development}
2217
INSTANCE_NAME: HAPPY-LIFE

packages/backend/src/card/service.test.ts

Lines changed: 0 additions & 71 deletions
This file was deleted.

packages/backend/src/card/service.ts

Lines changed: 0 additions & 67 deletions
This file was deleted.

packages/backend/src/index.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ import { createTenantService } from './tenants/service'
6464
import { AuthServiceClient } from './auth-service-client/client'
6565
import { createTenantSettingService } from './tenants/settings/service'
6666
import { createPaymentMethodProviderService } from './payment-method/provider/service'
67-
import { createCardService, createNoopCardService } from './card/service'
6867

6968
BigInt.prototype.toJSON = function () {
7069
return this.toString()
@@ -596,16 +595,6 @@ export function initIocContainer(
596595
})
597596
})
598597

599-
container.singleton('cardService', async (deps) => {
600-
return config.cardServiceUrl
601-
? createCardService({
602-
axios: await deps.use('axios'),
603-
logger: await deps.use('logger'),
604-
cardServiceUrl: config.cardServiceUrl
605-
})
606-
: createNoopCardService(await deps.use('logger'))
607-
})
608-
609598
return container
610599
}
611600

packages/backend/src/open_payments/payment/outgoing/errors.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ export enum OutgoingPaymentError {
1818
InvalidAmount = 'InvalidAmount',
1919
NegativeReceiveAmount = 'NegativeReceiveAmount',
2020
InvalidReceiver = 'InvalidReceiver',
21-
OnlyOneGrantAmountAllowed = 'OnlyOneGrantAmountAllowed',
22-
InvalidCardExpiry = 'InvalidCardExpiry'
21+
OnlyOneGrantAmountAllowed = 'OnlyOneGrantAmountAllowed'
2322
}
2423

2524
export const quoteErrorToOutgoingPaymentError: Record<
@@ -53,8 +52,7 @@ export const errorToHTTPCode: {
5352
[OutgoingPaymentError.InvalidAmount]: 400,
5453
[OutgoingPaymentError.NegativeReceiveAmount]: 400,
5554
[OutgoingPaymentError.InvalidReceiver]: 400,
56-
[OutgoingPaymentError.OnlyOneGrantAmountAllowed]: 500,
57-
[OutgoingPaymentError.InvalidCardExpiry]: 400
55+
[OutgoingPaymentError.OnlyOneGrantAmountAllowed]: 500
5856
}
5957

6058
export const errorToCode: {
@@ -71,8 +69,7 @@ export const errorToCode: {
7169
[OutgoingPaymentError.NegativeReceiveAmount]: GraphQLErrorCode.BadUserInput,
7270
[OutgoingPaymentError.InvalidReceiver]: GraphQLErrorCode.BadUserInput,
7371
[OutgoingPaymentError.OnlyOneGrantAmountAllowed]:
74-
GraphQLErrorCode.BadUserInput,
75-
[OutgoingPaymentError.InvalidCardExpiry]: GraphQLErrorCode.BadUserInput
72+
GraphQLErrorCode.BadUserInput
7673
}
7774

7875
export const errorToMessage: {
@@ -89,8 +86,7 @@ export const errorToMessage: {
8986
[OutgoingPaymentError.NegativeReceiveAmount]: 'negative receive amount',
9087
[OutgoingPaymentError.InvalidReceiver]: 'invalid receiver',
9188
[OutgoingPaymentError.OnlyOneGrantAmountAllowed]:
92-
'only one of receiveAmount or debitAmount allowed',
93-
[OutgoingPaymentError.InvalidCardExpiry]: 'expired card format MM/YY'
89+
'only one of receiveAmount or debitAmount allowed'
9490
}
9591

9692
export const FundingError = { ...OutgoingPaymentError, ...TransferError }

packages/card-service/scripts/init.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/testenv/cloud-nine-wallet/docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ services:
9494
restart: always
9595
networks:
9696
- rafiki-test
97-
ports:
98-
- '3104:3104'
9997
environment:
10098
NODE_ENV: ${NODE_ENV:-development}
10199
INSTANCE_NAME: CLOUD-NINE

0 commit comments

Comments
 (0)