Skip to main content
IntentLang
← All examples

CreateInvoice

examples/CreateInvoice.intent

CreateInvoice.intent
1# CreateInvoice.intent
2# Draft IntentLang (v0). Illustrative only; there is no compiler yet.
3
4mission CreateInvoice
5
6goal
7 Generate an invoice from approved orders
8
9why
10 Customers need accurate invoices that are auditable and never duplicated.
11
12requires
13 Customer
14 ApprovedOrders
15
16input
17 customer: Customer
18 orders: List<Order>
19 idempotencyKey: IdempotencyKey
20
21output
22 invoice: Invoice
23
24guarantees
25 invoice.total is never negative
26 duplicate invoices are not created
27 every invoice is auditable
28
29guarantee duplicate invoices are not created
30 because duplicate billing damages customer trust
31 verify duplicate prevention test
32
33never
34 create invoice for unapproved order
35 expose payment token in logs
36
37never expose payment token in logs
38 because logs may be visible to support and observability tools
39 verify security scan
40
41target
42 TypeScript
43 DotNet
44 OpenAPI
45 Tests
46 Markdown
47 Mermaid
48
49style
50 CleanArchitecture
51 CQRS
52
53verify
54 unit tests
55 duplicate prevention test
56 audit trail test
57 security scan
Draft syntax. This file is illustrative and does not run yet.