Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

Commit 39693b1

Browse files
committed
Add isSameSign flag to transaction and recurring transaction links
- Introduced `isSameSign` boolean flag to indicate whether linked amounts should share the same sign or use opposite signs. - Updated related schemas, examples, and tests to reflect the new flag. - Enhanced validation tests to ensure proper handling of the `isSameSign` property.
1 parent 3b2eceb commit 39693b1

11 files changed

Lines changed: 65 additions & 5 deletions

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.3.1] - 2026-04-05
9+
10+
### Changed
11+
12+
- Require `isSameSign` on both `transactionLink` and `recurringTransactionLink` so linked amounts can explicitly indicate same-sign versus opposite-sign matching behavior.
13+
- Update bundled examples, fixtures, tests, and README documentation to reflect the new required link-sign behavior flag.
14+
815
## [3.3.0] - 2026-04-05
916

1017
### Added

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ const recurringTransactionLink = {
219219
id: string;
220220
sourceRecurringTransactionId: string;
221221
destinationRecurringTransactionId: string;
222+
isSameSign: boolean;
222223
createdAt: string;
223224
updatedAt: string | null;
224225
deletedAt?: string | null;
@@ -235,14 +236,15 @@ const transactionLink = {
235236
id: string;
236237
sourceTransactionId: string;
237238
destinationTransactionId: string;
239+
isSameSign: boolean;
238240
createdAt: string;
239241
updatedAt: string | null;
240242
deletedAt?: string | null;
241243
version?: number;
242244
};
243245
```
244246

245-
Cross-transaction rules like matching dates, matching amounts, or opposite signs are not enforced by this schema and should be handled in application logic.
247+
`isSameSign` indicates whether linked amounts should share the same sign (`true`) or use opposite signs (`false`) while still matching by absolute value. Cross-transaction rules like matching dates or verifying absolute-value equality are not enforced by this schema and should be handled in application logic.
246248

247249
### LucaSchema
248250

examples/luca-schema-example.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@
406406
"id": "54b10a24-6511-48c2-bf3c-1cc7a794e2ab",
407407
"sourceRecurringTransactionId": "be4ac69f-89d0-444d-bf22-d4d8ec1b34a8",
408408
"destinationRecurringTransactionId": "37017f0d-8b46-47eb-929a-28e98ba9f84a",
409+
"isSameSign": false,
409410
"createdAt": "2024-01-01T00:05:00Z",
410411
"updatedAt": null
411412
}
@@ -795,6 +796,7 @@
795796
"id": "d6ae6cc3-5949-4bb2-8187-d1be36df94a1",
796797
"sourceTransactionId": "75b5faeb-acde-4c4c-8401-0bf2c4f1e9d1",
797798
"destinationTransactionId": "08bfed71-ab12-4898-ac9c-f2980eefa945",
799+
"isSameSign": false,
798800
"createdAt": "2024-02-01T00:05:00Z",
799801
"updatedAt": null
800802
}

src/examples/lucaSchema.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
"id": "42000000-0000-0000-0000-000000000001",
100100
"sourceRecurringTransactionId": "40000000-0000-0000-0000-000000000011",
101101
"destinationRecurringTransactionId": "40000000-0000-0000-0000-000000000012",
102+
"isSameSign": false,
102103
"createdAt": "2024-01-10T00:05:00Z",
103104
"updatedAt": null
104105
}
@@ -170,6 +171,7 @@
170171
"id": "12000000-0000-0000-0000-000000000001",
171172
"sourceTransactionId": "10000000-0000-0000-0000-000000000004",
172173
"destinationTransactionId": "10000000-0000-0000-0000-000000000005",
174+
"isSameSign": false,
173175
"createdAt": "2024-01-12T09:05:00Z",
174176
"updatedAt": null
175177
}

src/examples/recurringTransactionLinks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "42000000-0000-0000-0000-000000000001",
44
"sourceRecurringTransactionId": "40000000-0000-0000-0000-000000000011",
55
"destinationRecurringTransactionId": "40000000-0000-0000-0000-000000000012",
6+
"isSameSign": false,
67
"createdAt": "2024-03-01T09:00:00Z",
78
"updatedAt": null
89
}

src/examples/transactionLinks.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"id": "12000000-0000-0000-0000-000000000001",
44
"sourceTransactionId": "10000000-0000-0000-0000-000000000011",
55
"destinationTransactionId": "10000000-0000-0000-0000-000000000012",
6+
"isSameSign": false,
67
"createdAt": "2024-03-05T10:05:00Z",
78
"updatedAt": null
89
}

src/schemas/recurringTransactionLink.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,17 @@
2121
"title": "Destination Recurring Transaction ID",
2222
"format": "uuid",
2323
"description": "UUID of the destination recurring transaction in the link."
24+
},
25+
"isSameSign": {
26+
"type": "boolean",
27+
"title": "Is Same Sign",
28+
"description": "Whether the linked recurring transactions are expected to have matching signs. When false, the linked recurring transactions are expected to have opposite signs."
2429
}
2530
},
2631
"unevaluatedProperties": false,
2732
"required": [
2833
"sourceRecurringTransactionId",
29-
"destinationRecurringTransactionId"
34+
"destinationRecurringTransactionId",
35+
"isSameSign"
3036
]
3137
}

src/schemas/transactionLink.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@
2121
"title": "Destination Transaction ID",
2222
"format": "uuid",
2323
"description": "UUID of the destination transaction in the link."
24+
},
25+
"isSameSign": {
26+
"type": "boolean",
27+
"title": "Is Same Sign",
28+
"description": "Whether the linked transactions are expected to have matching signs. When false, the linked transactions are expected to have opposite signs."
2429
}
2530
},
2631
"unevaluatedProperties": false,
27-
"required": ["sourceTransactionId", "destinationTransactionId"]
32+
"required": ["sourceTransactionId", "destinationTransactionId", "isSameSign"]
2833
}

src/tests/recurringTransactionLink.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,27 @@ describe('recurringTransactionLink schema', () => {
2222
);
2323
});
2424

25+
test('missing isSameSign is invalid', () => {
26+
const recurringTransactionLink = makeRecurringTransactionLink();
27+
delete recurringTransactionLink.isSameSign;
28+
expectInvalid(
29+
validate,
30+
'recurringTransactionLink',
31+
recurringTransactionLink
32+
);
33+
});
34+
35+
test('non-boolean isSameSign is invalid', () => {
36+
const recurringTransactionLink = makeRecurringTransactionLink({
37+
isSameSign: 'false'
38+
});
39+
expectInvalid(
40+
validate,
41+
'recurringTransactionLink',
42+
recurringTransactionLink
43+
);
44+
});
45+
2546
test('unknown fields are invalid', () => {
2647
const recurringTransactionLink = makeRecurringTransactionLink({
2748
unexpectedField: 'x'

src/tests/test-fixtures.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ const recurringTransactionLinkTemplate = {
6666
id: ids.recurringTransactionLinkId,
6767
...commonBase,
6868
sourceRecurringTransactionId: ids.recurringTransactionId,
69-
destinationRecurringTransactionId: ids.linkedRecurringTransactionId
69+
destinationRecurringTransactionId: ids.linkedRecurringTransactionId,
70+
isSameSign: false
7071
};
7172

7273
const transactionTemplate = {
@@ -101,7 +102,8 @@ const transactionLinkTemplate = {
101102
id: ids.transactionLinkId,
102103
...commonBase,
103104
sourceTransactionId: ids.transactionId,
104-
destinationTransactionId: ids.linkedTransactionId
105+
destinationTransactionId: ids.linkedTransactionId,
106+
isSameSign: false
105107
};
106108

107109
const statementTemplate = {

0 commit comments

Comments
 (0)