Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/config/liechtenstein-bank-holiday.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Util } from 'src/shared/utils/util';

export const LiechtensteinBankHolidays = [
'2026-01-01',
'2026-01-02',
'2026-01-06',
'2026-04-06',
'2026-05-01',
'2026-05-14',
'2026-05-25',
'2026-06-04',
'2026-08-15',
'2026-09-08',
'2026-11-01',
'2026-12-08',
'2026-12-24',
'2026-12-25',
'2026-12-26',
'2026-12-31',
];
Comment on lines +3 to +20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should export the data in a separated csv? @davidleomay

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


export function isLiechtensteinBankHoliday(date = new Date()): boolean {
const isWeekend = [0, 6].includes(date.getDay());
return LiechtensteinBankHolidays.includes(Util.isoDate(date)) || isWeekend;
}
11 changes: 11 additions & 0 deletions src/subdomains/supporting/fiat-output/fiat-output-job.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { forwardRef, Inject, Injectable } from '@nestjs/common';
import { CronExpression } from '@nestjs/schedule';
import { Config } from 'src/config/config';
import { isLiechtensteinBankHoliday } from 'src/config/liechtenstein-bank-holiday.config';
import { Pain001Payment } from 'src/integration/bank/services/iso20022.service';
import { YapealService } from 'src/integration/bank/services/yapeal.service';
import { AzureStorageService } from 'src/integration/infrastructure/azure-storage.service';
Expand Down Expand Up @@ -208,6 +209,16 @@ export class FiatOutputJobService {
entity.buyFiats?.[0]?.cryptoInput.asset.blockchain &&
(asset.name !== 'CHF' || ['CH', 'LI'].includes(ibanCountry)))
) {
if (ibanCountry === 'LI' && entity.type === FiatOutputType.LIQ_MANAGEMENT) {
if (
isLiechtensteinBankHoliday() ||
(isLiechtensteinBankHoliday(Util.daysAfter(1)) && new Date().getHours() >= 16)
) {
this.logger.verbose(`FiatOutput ${entity.id} blocked: Liechtenstein bank holiday`);
continue;
}
}

await this.fiatOutputRepo.update(entity.id, { isReadyDate: new Date() });
this.logger.info(
`FiatOutput ${entity.id} ready: LiqBalance ${asset.balance.amount} ${
Expand Down