Skip to content

Commit b0b099d

Browse files
authored
add sepa_instant_limits api (#262)
1 parent 9417715 commit b0b099d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/app.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,12 @@ router.post(
897897
safeRequestHandler(instantCreditTransferAPI.createInstantCreditTransfer)
898898
);
899899

900+
// SEPA INSTANT LIMITS
901+
router.get(
902+
"/accounts/:accountId/sepa_instant_limits",
903+
safeRequestHandler(instantCreditTransferAPI.getInstantLimits)
904+
);
905+
900906
// ACCOUNT OPENING REQUEST
901907

902908
router.post(

src/routes/instantCreditTransfer.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,25 @@ export const confirmInstantCreditTransfer = async (person: MockPerson) => {
192192

193193
return instantCreditTransfer;
194194
};
195+
196+
export const getInstantLimits = async (req, res) => {
197+
const { accountId } = req.params;
198+
const person = await findPersonByAccount({ id: accountId });
199+
const business = await findBusinessByAccount({ id: accountId });
200+
const entity = business || person;
201+
202+
if (!entity) {
203+
throw new Error("Account not found");
204+
}
205+
206+
return res.send({
207+
daily_limit: { value: 1000000, unit: "cents", currency: "EUR" },
208+
daily_used: { value: 350000, unit: "cents", currency: "EUR" },
209+
daily_remaining: { value: 650000, unit: "cents", currency: "EUR" },
210+
per_transaction_limit: {
211+
value: 500000,
212+
unit: "cents",
213+
currency: "EUR",
214+
},
215+
});
216+
};

0 commit comments

Comments
 (0)