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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: latest
version: 10

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
},
"devDependencies": {
"@biomejs/biome": "2.3.10",
"@types/node": "^20.19.30",
"@types/node": "^20.19.41",
"typescript": "^5.9.3",
"vitest": "^4.0.17"
"vitest": "^4.0.18"
},
Comment on lines 41 to 46
"dependencies": {
"fast-xml-parser": "^5.3.3"
"fast-xml-parser": "^5.8.0"
}
}
681 changes: 364 additions & 317 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packages:
- '.'
allowBuilds:
esbuild: true
Comment thread
Copilot marked this conversation as resolved.
20 changes: 0 additions & 20 deletions src/dataGroups/CamtAccount.ts

This file was deleted.

22 changes: 17 additions & 5 deletions src/dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export class Dialog {
header: { segId: HKTAN.Id, segNr: 0, version: tanMethod?.version ?? 0 },
tanProcess: TanProcess.Process4,
segId: this.currentInteraction.segId,
tanMedia: this.getTanMediaName(),
};

message.addSegment(hktan);
Expand Down Expand Up @@ -240,18 +241,29 @@ export class Dialog {
segId: this.currentInteraction.segId,
orderRef: tanOrderReference,
nextTan: false,
tanMedia:
(this.config.selectedTanMethod?.tanMediaRequirement ??
TanMediaRequirement.NotAllowed >= TanMediaRequirement.Optional)
? this.config.tanMediaName
: undefined,
tanMedia: this.getTanMediaName(),
};

message.addSegment(hktan);
}
return message;
}

private getTanMediaName(): string | undefined {
const requirement =
this.config.selectedTanMethod?.tanMediaRequirement ?? TanMediaRequirement.NotAllowed;

if (requirement === TanMediaRequirement.NotAllowed) {
return undefined;
}

if (requirement === TanMediaRequirement.Required) {
return this.config.tanMediaName ?? 'default';
}

return this.config.tanMediaName;
}
Comment thread
robocode13 marked this conversation as resolved.

private async handlePartedMessages(
message: CustomerMessage,
responseMessage: Message,
Expand Down
34 changes: 18 additions & 16 deletions src/interactions/initDialogInteraction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,22 +189,24 @@ export class InitDialogInteraction extends CustomerInteraction {

if (hiupa) {
const hiupds = response.findAllSegments<HIUPDSegment>(HIUPD.Id);
const accounts: BankAccount[] = hiupds.map((upd) => {
return {
accountNumber: upd.account.accountNumber,
subAccountId: upd.account.subAccountId,
bank: upd.account.bank,
iban: upd.iban,
customerId: upd.customerId,
accountType: finTsAccountTypeToEnum(upd.accountType),
currency: upd.currency,
holder1: upd.accountHolder1,
holder2: upd.accountHolder2,
product: upd.accountProduct,
limit: upd.accountLimit,
allowedTransactions: upd.allowedTransactions?.filter((t) => !!t),
};
});
const accounts: BankAccount[] = hiupds
.filter((upd) => upd.account)
.map((upd) => {
return {
accountNumber: upd.account.accountNumber,
subAccountId: upd.account.subAccountId,
bank: upd.account.bank,
iban: upd.iban,
customerId: upd.customerId,
accountType: finTsAccountTypeToEnum(upd.accountType),
currency: upd.currency,
holder1: upd.accountHolder1,
holder2: upd.accountHolder2,
product: upd.accountProduct,
limit: upd.accountLimit,
allowedTransactions: upd.allowedTransactions?.filter((t) => !!t),
};
});

const upd = {
version: hiupa.updVersion,
Expand Down
9 changes: 6 additions & 3 deletions src/segments/HKCAZ.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import { Dat } from '../dataElements/Dat.js';
import { Numeric } from '../dataElements/Numeric.js';
import { Text } from '../dataElements/Text.js';
import { YesNo } from '../dataElements/YesNo.js';
import { type CamtAccount, CamtAccountGroup } from '../dataGroups/CamtAccount.js';
import { DataGroup } from '../dataGroups/DataGroup.js';
import {
type InternationalAccount,
InternationalAccountGroup,
} from '../dataGroups/InternationalAccount.js';
import type { SegmentWithContinuationMark } from '../segment.js';
import { SegmentDefinition } from '../segmentDefinition.js';

export type HKCAZSegment = SegmentWithContinuationMark & {
account: CamtAccount;
account: InternationalAccount;
acceptedCamtFormats: string[];
allAccounts: boolean;
from?: Date;
Expand All @@ -28,7 +31,7 @@ export class HKCAZ extends SegmentDefinition {
}
version = HKCAZ.Version;
elements = [
new CamtAccountGroup('account', 1, 1),
new InternationalAccountGroup('account', 1, 1),
new DataGroup('acceptedCamtFormats', [new Text('camtFormat', 1, 99)], 1, 1), // Support multiple camt-formats
new YesNo('allAccounts', 1, 1),
new Dat('from', 0, 1),
Expand Down
Loading