@substrat-run/engine-invoicing 0.1.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -33
- package/dist/index.d.ts +11 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +146 -8
- package/dist/index.js.map +1 -1
- package/package.json +9 -6
package/README.md
CHANGED
|
@@ -9,49 +9,37 @@ with frozen prices and provenance, ready to hand to whatever actually issues inv
|
|
|
9
9
|
(typically an accounting connector). It is **not** a ledger, not accounts receivable,
|
|
10
10
|
not payment tracking.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
## What it owns
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
- **Exported means immutable** — nothing appends, nothing edits, exporting twice throws.
|
|
15
|
+
- **One document, one currency** — a mixed-currency delivery is rejected at write time.
|
|
16
|
+
- **Snapshot, not join** — prices are frozen from the event payload, with provenance kept.
|
|
17
|
+
- **Idempotent on replay** — the source order is the dedup key, so a redelivery never
|
|
18
|
+
bills twice.
|
|
15
19
|
|
|
16
|
-
|
|
17
|
-
engine — star topology. The consumer parses its own Zod view of the event payload,
|
|
18
|
-
finds or creates the open underlag for that customer, and copies the billable lines
|
|
19
|
-
with provenance (`source_type`, `source_id`):
|
|
20
|
+
## Install
|
|
20
21
|
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
consumes: [{ type: 'workorder.completed', schemaVersion: 1 }],
|
|
24
|
-
}
|
|
22
|
+
```sh
|
|
23
|
+
pnpm add @substrat-run/engine-invoicing
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
delivered at-least-once; find-or-create plus the kernel's delivery journal keep the
|
|
30
|
-
handler idempotent.
|
|
31
|
-
|
|
32
|
-
## The immutability invariant
|
|
33
|
-
|
|
34
|
-
An underlag is `open` or `exported`:
|
|
26
|
+
```ts
|
|
27
|
+
import { invoicingModule } from '@substrat-run/engine-invoicing';
|
|
35
28
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Nothing appends, nothing edits, exporting again throws.
|
|
39
|
-
- Billable work arriving *after* export opens a **new** underlag. History is never
|
|
40
|
-
rewritten; late facts become new facts.
|
|
29
|
+
host.registerModule(invoicingModule);
|
|
30
|
+
```
|
|
41
31
|
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
That's the whole integration. Lines arrive by **event**, never by call: the engine consumes
|
|
33
|
+
`workorder.completed` and `commerce.order-placed` with **zero imports** from either producer,
|
|
34
|
+
parsing its own Zod view of each payload. To make a new domain billable, emit an event — you
|
|
35
|
+
never import this engine to do it.
|
|
44
36
|
|
|
45
|
-
##
|
|
37
|
+
## Documentation
|
|
46
38
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| `invoicing/list` | `invoicing:read` | list underlag, each with computed total |
|
|
50
|
-
| `invoicing/get` | `invoicing:read` | one underlag with all lines and total |
|
|
51
|
-
| `invoicing/export` | `invoicing:export` | flip to `exported` — the point of no return |
|
|
39
|
+
**https://substrat.ahlstrand.es/engines/invoicing/** — the domain model and invariants, the
|
|
40
|
+
operation/permission surface, event contracts and versioning, and how to compose or extend it.
|
|
52
41
|
|
|
53
|
-
|
|
54
|
-
[`@substrat-run/contracts`](https://npmjs.com/package/@substrat-run/contracts), never floats.
|
|
42
|
+
The docs site is the single source of truth; this README deliberately doesn't restate it.
|
|
55
43
|
|
|
56
44
|
## Related packages
|
|
57
45
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { type ModuleRegistration } from '@substrat-run/kernel';
|
|
3
3
|
export declare const INVOICING_PERM: {
|
|
4
|
-
read: string & z.
|
|
5
|
-
export: string & z.
|
|
4
|
+
read: string & z.core.$brand<"PermissionKey">;
|
|
5
|
+
export: string & z.core.$brand<"PermissionKey">;
|
|
6
6
|
};
|
|
7
7
|
export declare const invoicingManifest: {
|
|
8
|
-
id: string & z.
|
|
8
|
+
id: string & z.core.$brand<"ModuleId">;
|
|
9
|
+
version: string;
|
|
10
|
+
kernelContract: string;
|
|
9
11
|
permissions: {
|
|
10
|
-
key: string & z.
|
|
12
|
+
key: string & z.core.$brand<"PermissionKey">;
|
|
11
13
|
description: string;
|
|
12
14
|
}[];
|
|
13
|
-
version: string;
|
|
14
|
-
kernelContract: string;
|
|
15
15
|
events: {
|
|
16
16
|
emits: {
|
|
17
17
|
type: string;
|
|
@@ -28,7 +28,7 @@ export declare const invoicingManifest: {
|
|
|
28
28
|
};
|
|
29
29
|
attachmentTargets: {
|
|
30
30
|
entityType: string;
|
|
31
|
-
readPermission: string & z.
|
|
31
|
+
readPermission: string & z.core.$brand<"PermissionKey">;
|
|
32
32
|
}[];
|
|
33
33
|
entitlementKey: string;
|
|
34
34
|
entityRelations?: {
|
|
@@ -49,13 +49,13 @@ export declare const invoicingManifest: {
|
|
|
49
49
|
ui?: {
|
|
50
50
|
routes?: {
|
|
51
51
|
path: string;
|
|
52
|
-
permission: string & z.BRAND<"PermissionKey">;
|
|
53
52
|
screen: string;
|
|
53
|
+
permission: string & z.core.$brand<"PermissionKey">;
|
|
54
54
|
}[] | undefined;
|
|
55
55
|
nav?: {
|
|
56
|
-
permission: string & z.BRAND<"PermissionKey">;
|
|
57
56
|
label: string;
|
|
58
57
|
to: string;
|
|
58
|
+
permission: string & z.core.$brand<"PermissionKey">;
|
|
59
59
|
icon?: string | undefined;
|
|
60
60
|
}[] | undefined;
|
|
61
61
|
entityViews?: {
|
|
@@ -63,14 +63,14 @@ export declare const invoicingManifest: {
|
|
|
63
63
|
view: string;
|
|
64
64
|
}[] | undefined;
|
|
65
65
|
widgets?: {
|
|
66
|
-
permission: string & z.BRAND<"PermissionKey">;
|
|
67
66
|
slot: string;
|
|
68
67
|
component: string;
|
|
68
|
+
permission: string & z.core.$brand<"PermissionKey">;
|
|
69
69
|
}[] | undefined;
|
|
70
70
|
settingsPanels?: {
|
|
71
|
-
permission: string & z.BRAND<"PermissionKey">;
|
|
72
71
|
label: string;
|
|
73
72
|
component: string;
|
|
73
|
+
permission: string & z.core.$brand<"PermissionKey">;
|
|
74
74
|
}[] | undefined;
|
|
75
75
|
} | undefined;
|
|
76
76
|
};
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,OAAO,EAIL,KAAK,kBAAkB,EAGxB,MAAM,sBAAsB,CAAC;AAS9B,eAAO,MAAM,cAAc;;;CAG1B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsC5B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;GA6B/B,CAAC;AA6CF,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,CAAC;CACpB;AA0QD,eAAO,MAAM,eAAe,EAAE,kBAY7B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
2
|
+
import { addMoney, entityRef, money, moduleManifest, moneyOf, permissionKey, } from '@substrat-run/contracts';
|
|
3
3
|
import { assertAllowed, ulid, } from '@substrat-run/kernel';
|
|
4
4
|
// ============================================================================
|
|
5
5
|
// The invoicing engine (demos/fsm/spec/testrun.md §4.3/§5.3). Consumes
|
|
@@ -22,9 +22,24 @@ export const invoicingManifest = moduleManifest.parse({
|
|
|
22
22
|
events: {
|
|
23
23
|
emits: [
|
|
24
24
|
{ type: 'invoicing.underlag-updated', schemaVersion: 1 },
|
|
25
|
-
|
|
25
|
+
// v2: `total` is Money, not a bare amount string. v1 stated a number with
|
|
26
|
+
// no currency on a financial artifact — and `demos/fsm/spec/testrun.md`
|
|
27
|
+
// always specified `total: Money`, so this is the code meeting its own
|
|
28
|
+
// spec rather than a change of intent.
|
|
29
|
+
//
|
|
30
|
+
// NOT dual-emitted, despite D-28's deprecation-window rule: consumer
|
|
31
|
+
// dispatch keys on event TYPE only (`WHERE o.type = ?`; the schemaVersion
|
|
32
|
+
// in `consumes` is discarded at registration), so emitting v1 and v2 would
|
|
33
|
+
// deliver BOTH to every consumer of this type. For an export event that
|
|
34
|
+
// means a connector could invoice twice, silently. A clean replace instead
|
|
35
|
+
// fails loudly — a v1 consumer's strict parse rejects v2 and dead-letters,
|
|
36
|
+
// which is visible. See kernel-design open question on version routing.
|
|
37
|
+
{ type: 'invoicing.underlag-exported', schemaVersion: 2 },
|
|
38
|
+
],
|
|
39
|
+
consumes: [
|
|
40
|
+
{ type: 'workorder.completed', schemaVersion: 1 },
|
|
41
|
+
{ type: 'commerce.order-placed', schemaVersion: 1 },
|
|
26
42
|
],
|
|
27
|
-
consumes: [{ type: 'workorder.completed', schemaVersion: 1 }],
|
|
28
43
|
},
|
|
29
44
|
migrations: { journalDir: './migrations', compatibleFrom: '0.0.1' },
|
|
30
45
|
attachmentTargets: [{ entityType: 'underlag', readPermission: 'invoicing:read' }],
|
|
@@ -83,15 +98,81 @@ const completedPayload = z.object({
|
|
|
83
98
|
})),
|
|
84
99
|
total: money,
|
|
85
100
|
});
|
|
101
|
+
// ADDITIVE (D-28): a SECOND input event. The engine learns to build a
|
|
102
|
+
// fakturaunderlag from a retail order without touching the workorder path — new
|
|
103
|
+
// `consumes` entry + this parse + the consumer below, no migration, no
|
|
104
|
+
// permission. Its OWN Zod view of the contract; zero imports from the producer.
|
|
105
|
+
const commercePlacedPayload = z.object({
|
|
106
|
+
orderId: z.string().min(1),
|
|
107
|
+
number: z.number().int(),
|
|
108
|
+
customer: entityRef,
|
|
109
|
+
paymentMethod: z.string().min(1),
|
|
110
|
+
billable: z.array(z.object({
|
|
111
|
+
article: z.string().min(1),
|
|
112
|
+
description: z.string().min(1),
|
|
113
|
+
qty: z.string().min(1),
|
|
114
|
+
unit: z.string().min(1),
|
|
115
|
+
unitPrice: money,
|
|
116
|
+
lineTotal: money,
|
|
117
|
+
})),
|
|
118
|
+
total: money,
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* The underlag's total, as Money.
|
|
122
|
+
*
|
|
123
|
+
* Uses `addMoney`, not `addDecimal`: an invoice basis that sums 100 SEK and
|
|
124
|
+
* 100 EUR into "200" is not a rounding bug, it is a financial artifact stating
|
|
125
|
+
* a number that means nothing. `addMoney` throws on a currency mismatch, so the
|
|
126
|
+
* engine refuses rather than invents. `assertSingleCurrency` in the consumers is
|
|
127
|
+
* the real guard — this is defence in depth behind it.
|
|
128
|
+
*/
|
|
129
|
+
function underlagTotalMoney(ctx, underlagId) {
|
|
130
|
+
const rows = ctx.sql.query('SELECT line_total_amount, currency FROM invoicing_lines WHERE underlag_id = ?', [underlagId]);
|
|
131
|
+
// An underlag with no lines is unreachable in practice — find-or-create and
|
|
132
|
+
// the line inserts share one transaction — but a zero total must still have a
|
|
133
|
+
// currency to be Money at all. Attributing a currency to an empty document is
|
|
134
|
+
// exactly the guess this engine should not make; SEK is the demo default and
|
|
135
|
+
// the honest fix is a currency column on the underlag, which needs a migration
|
|
136
|
+
// and therefore a human checkpoint (see docs/design/commerce-gaps.md §3.1).
|
|
137
|
+
if (rows.length === 0)
|
|
138
|
+
return moneyOf('0', 'SEK');
|
|
139
|
+
return rows
|
|
140
|
+
.map((r) => moneyOf(r.line_total_amount, r.currency))
|
|
141
|
+
.reduce((sum, m) => addMoney(sum, m));
|
|
142
|
+
}
|
|
143
|
+
/** Back-compat shim: the operation surface has always returned a bare string. */
|
|
86
144
|
function underlagTotal(ctx, underlagId) {
|
|
87
|
-
return ctx.
|
|
88
|
-
|
|
89
|
-
|
|
145
|
+
return underlagTotalMoney(ctx, underlagId).amount;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* A document has one currency. Reject at write time, so a mixed-currency
|
|
149
|
+
* delivery dead-letters and the underlag is never corrupted — rejecting at read
|
|
150
|
+
* time instead would leave a document that can never be listed or exported
|
|
151
|
+
* again.
|
|
152
|
+
*/
|
|
153
|
+
function assertSingleCurrency(ctx, underlagId, incoming) {
|
|
154
|
+
const existing = ctx.sql.query('SELECT DISTINCT currency FROM invoicing_lines WHERE underlag_id = ?', [underlagId]);
|
|
155
|
+
const currencies = new Set([
|
|
156
|
+
...existing.map((r) => r.currency),
|
|
157
|
+
...incoming.map((l) => l.lineTotal.currency),
|
|
158
|
+
...incoming.map((l) => l.unitPrice.currency),
|
|
159
|
+
]);
|
|
160
|
+
if (currencies.size > 1) {
|
|
161
|
+
throw new Error(`currency mismatch on underlag ${underlagId}: ${[...currencies].sort().join(', ')} — an underlag is one document in one currency`);
|
|
162
|
+
}
|
|
90
163
|
}
|
|
91
164
|
const onWorkOrderCompleted = (ctx, event) => {
|
|
92
165
|
const p = completedPayload.parse(event.payload);
|
|
93
166
|
if (p.billable.length === 0)
|
|
94
167
|
return;
|
|
168
|
+
// Idempotent on at-least-once redelivery (K-11): the order is the dedup key.
|
|
169
|
+
// Its lines are already present → this delivery is a replay, do nothing.
|
|
170
|
+
// This guard was missing while `onCommerceOrderPlaced` had it, so the two
|
|
171
|
+
// consumers of one engine disagreed about whether replay was possible — and
|
|
172
|
+
// the docs promised the guard for both.
|
|
173
|
+
const already = ctx.sql.query(`SELECT 1 AS found FROM invoicing_lines WHERE source_type = 'workorder' AND source_id = ? LIMIT 1`, [p.orderId])[0];
|
|
174
|
+
if (already)
|
|
175
|
+
return;
|
|
95
176
|
// Find-or-create the OPEN underlag for this customer; an exported underlag
|
|
96
177
|
// is immutable — late deliveries open a new one (engine invariant on top of
|
|
97
178
|
// the kernel's delivery journal).
|
|
@@ -103,6 +184,7 @@ const onWorkOrderCompleted = (ctx, event) => {
|
|
|
103
184
|
VALUES (?, ?, ?, ?, 'open', ?)`, [id, number, p.customer.entityType, p.customer.entityId, new Date().toISOString()]);
|
|
104
185
|
underlag = ctx.sql.query('SELECT * FROM invoicing_underlag WHERE id = ?', [id])[0];
|
|
105
186
|
}
|
|
187
|
+
assertSingleCurrency(ctx, underlag.id, p.billable);
|
|
106
188
|
for (const line of p.billable) {
|
|
107
189
|
ctx.sql.exec(`INSERT INTO invoicing_lines
|
|
108
190
|
(id, underlag_id, source_type, source_id, article, description, qty, unit,
|
|
@@ -133,6 +215,59 @@ const onWorkOrderCompleted = (ctx, event) => {
|
|
|
133
215
|
},
|
|
134
216
|
});
|
|
135
217
|
};
|
|
218
|
+
// ADDITIVE consumer for the retail order event (concept §7). Same snapshot,
|
|
219
|
+
// -not-join discipline as `onWorkOrderCompleted`; source_type is 'order'. Only
|
|
220
|
+
// invoice-payment orders bill — card/Swish settle through a payment connector.
|
|
221
|
+
const onCommerceOrderPlaced = (ctx, event) => {
|
|
222
|
+
const p = commercePlacedPayload.parse(event.payload);
|
|
223
|
+
if (p.paymentMethod !== 'invoice')
|
|
224
|
+
return;
|
|
225
|
+
if (p.billable.length === 0)
|
|
226
|
+
return;
|
|
227
|
+
// Idempotent on at-least-once redelivery (K-11): the order is the dedup key.
|
|
228
|
+
// Its lines are already present → this delivery is a replay, do nothing.
|
|
229
|
+
const already = ctx.sql.query(`SELECT 1 AS found FROM invoicing_lines WHERE source_type = 'order' AND source_id = ? LIMIT 1`, [p.orderId])[0];
|
|
230
|
+
if (already)
|
|
231
|
+
return;
|
|
232
|
+
let underlag = ctx.sql.query(`SELECT * FROM invoicing_underlag WHERE customer_type = ? AND customer_id = ? AND status = 'open'`, [p.customer.entityType, p.customer.entityId])[0];
|
|
233
|
+
if (!underlag) {
|
|
234
|
+
const id = ulid();
|
|
235
|
+
const number = ctx.sql.query('SELECT COALESCE(MAX(number), 0) + 1 AS n FROM invoicing_underlag')[0]?.n ?? 1;
|
|
236
|
+
ctx.sql.exec(`INSERT INTO invoicing_underlag (id, number, customer_type, customer_id, status, created_at)
|
|
237
|
+
VALUES (?, ?, ?, ?, 'open', ?)`, [id, number, p.customer.entityType, p.customer.entityId, new Date().toISOString()]);
|
|
238
|
+
underlag = ctx.sql.query('SELECT * FROM invoicing_underlag WHERE id = ?', [id])[0];
|
|
239
|
+
}
|
|
240
|
+
assertSingleCurrency(ctx, underlag.id, p.billable);
|
|
241
|
+
for (const line of p.billable) {
|
|
242
|
+
ctx.sql.exec(`INSERT INTO invoicing_lines
|
|
243
|
+
(id, underlag_id, source_type, source_id, article, description, qty, unit,
|
|
244
|
+
unit_price_amount, currency, line_total_amount, created_at)
|
|
245
|
+
VALUES (?, ?, 'order', ?, ?, ?, ?, ?, ?, ?, ?, ?)`, [
|
|
246
|
+
ulid(),
|
|
247
|
+
underlag.id,
|
|
248
|
+
p.orderId,
|
|
249
|
+
line.article,
|
|
250
|
+
line.description,
|
|
251
|
+
line.qty,
|
|
252
|
+
line.unit,
|
|
253
|
+
line.unitPrice.amount,
|
|
254
|
+
line.unitPrice.currency,
|
|
255
|
+
line.lineTotal.amount,
|
|
256
|
+
new Date().toISOString(),
|
|
257
|
+
]);
|
|
258
|
+
}
|
|
259
|
+
ctx.emit({
|
|
260
|
+
type: 'invoicing.underlag-updated',
|
|
261
|
+
schemaVersion: 1,
|
|
262
|
+
entity: { entityType: 'underlag', entityId: underlag.id },
|
|
263
|
+
piiClass: 'none',
|
|
264
|
+
payload: {
|
|
265
|
+
underlagId: underlag.id,
|
|
266
|
+
addedLines: p.billable.length,
|
|
267
|
+
source: { entityType: 'order', entityId: p.orderId },
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
};
|
|
136
271
|
const listOp = async (ctx, input) => {
|
|
137
272
|
assertAllowed(await ctx.check(INVOICING_PERM.read));
|
|
138
273
|
const rows = input?.status
|
|
@@ -163,13 +298,15 @@ const exportOp = async (ctx, input) => {
|
|
|
163
298
|
ctx.sql.exec(`UPDATE invoicing_underlag SET status = 'exported', exported_at = ? WHERE id = ?`, [new Date().toISOString(), underlag.id]);
|
|
164
299
|
ctx.emit({
|
|
165
300
|
type: 'invoicing.underlag-exported',
|
|
166
|
-
schemaVersion:
|
|
301
|
+
schemaVersion: 2,
|
|
167
302
|
entity: { entityType: 'underlag', entityId: underlag.id },
|
|
168
303
|
piiClass: 'none',
|
|
169
304
|
payload: {
|
|
170
305
|
underlagId: underlag.id,
|
|
171
306
|
number: underlag.number,
|
|
172
|
-
|
|
307
|
+
// Money, not a bare string: the consumer of an export event is an
|
|
308
|
+
// accounting connector, and "1550" without a currency is not an amount.
|
|
309
|
+
total: underlagTotalMoney(ctx, underlag.id),
|
|
173
310
|
},
|
|
174
311
|
});
|
|
175
312
|
return ctx.sql.query('SELECT * FROM invoicing_underlag WHERE id = ?', [
|
|
@@ -186,6 +323,7 @@ export const invoicingModule = {
|
|
|
186
323
|
},
|
|
187
324
|
consumers: {
|
|
188
325
|
'workorder.completed': onWorkOrderCompleted,
|
|
326
|
+
'commerce.order-placed': onCommerceOrderPlaced,
|
|
189
327
|
},
|
|
190
328
|
};
|
|
191
329
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,UAAU,EACV,SAAS,EACT,KAAK,EACL,cAAc,EACd,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,aAAa,EACb,IAAI,GAKL,MAAM,sBAAsB,CAAC;AAE9B,+EAA+E;AAC/E,uEAAuE;AACvE,+EAA+E;AAC/E,6EAA6E;AAC7E,mDAAmD;AACnD,+EAA+E;AAE/E,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAC3C,MAAM,EAAE,aAAa,CAAC,KAAK,CAAC,kBAAkB,CAAC;CAChD,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC;IACpD,EAAE,EAAE,gCAAgC;IACpC,OAAO,EAAE,OAAO;IAChB,cAAc,EAAE,QAAQ;IACxB,WAAW,EAAE;QACX,EAAE,GAAG,EAAE,gBAAgB,EAAE,WAAW,EAAE,sBAAsB,EAAE;QAC9D,EAAE,GAAG,EAAE,kBAAkB,EAAE,WAAW,EAAE,+CAA+C,EAAE;KAC1F;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,4BAA4B,EAAE,aAAa,EAAE,CAAC,EAAE;YACxD,EAAE,IAAI,EAAE,6BAA6B,EAAE,aAAa,EAAE,CAAC,EAAE;SAC1D;QACD,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC;KAC9D;IACD,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iB;IAC3B,UAAU,EAAE,mBAAmB;IAC/B,UAAU,EAAE;QACV,gBAAgB,EAAE,MAAe;QACjC,eAAe,EAAE,KAAc;QAC/B,kBAAkB,EAAE,QAAiB;KACtC;IACD,SAAS,EAAE;QACT,qBAAqB,EAAE,oBAAoB;QAC3C,uBAAuB,EAAE,qBAAqB;KAC/C;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@substrat-run/engine-invoicing",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Substrat engine: fakturaunderlag — consumes billable events, snapshots lines with provenance, immutable once exported",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -25,15 +25,18 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"zod": "^
|
|
29
|
-
"@substrat-run/contracts": "^0.
|
|
30
|
-
"@substrat-run/kernel": "^0.
|
|
28
|
+
"zod": "^4.4.3",
|
|
29
|
+
"@substrat-run/contracts": "^0.4.0",
|
|
30
|
+
"@substrat-run/kernel": "^0.4.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"typescript": "^5.6.0"
|
|
33
|
+
"typescript": "^5.6.0",
|
|
34
|
+
"vitest": "^3.0.0",
|
|
35
|
+
"@substrat-run/engine-test-kit": "^0.0.2"
|
|
34
36
|
},
|
|
35
37
|
"scripts": {
|
|
36
38
|
"build": "tsc -p tsconfig.json",
|
|
37
|
-
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
39
|
+
"typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
40
|
+
"test": "vitest run"
|
|
38
41
|
}
|
|
39
42
|
}
|