← All examples
CreateInvoice
examples/CreateInvoice.intent
CreateInvoice.intent
1# CreateInvoice.intent2# The canonical mission: notes, guarantees, never-rules, targets, and verification.34mission CreateInvoice56note pm:7 One placed order should become one invoice, even if checkout retries.89note beginner:10 This mission is about safe invoice creation, not charging the card.1112goal13 Generate an invoice from approved orders1415why16 Customers need accurate invoices that are auditable and never duplicated.1718requires19 Customer20 ApprovedOrders2122input23 customer: Customer24 orders: List<Order>25 idempotencyKey: IdempotencyKey26 note beginner:27 A retry key. The same key returns the same invoice instead of creating another.28 note qa:29 Send the same order twice with the same idempotency key and expect one invoice.3031output32 invoice: Invoice3334guarantees35 invoice.total is never negative36 duplicate invoices are not created37 every invoice is auditable3839guarantee duplicate invoices are not created40 because duplicate billing damages customer trust41 note risk:42 Duplicate billing creates refunds, support tickets, finance cleanup, and lost trust.43 verify duplicate prevention test4445never46 create invoice for unapproved order47 expose payment token in logs4849never expose payment token in logs50 because logs may be visible to support and observability tools51 note security:52 Payment tokens must not appear in logs, events, debug output, proof artifacts, or AI context.53 verify security scan5455target56 TypeScript57 DotNet58 OpenAPI59 Tests60 Markdown61 Mermaid6263style64 CleanArchitecture65 CQRS6667verify68 unit tests69 duplicate prevention test70 audit trail test71 security scanDraft syntax. This file is illustrative and does not run yet.
More examples
AlertRoutingApiGatewayBillingServiceCalculateRiskScoreCertificationAttemptCertificationCheckoutCertificationEligibilityCertificationStudyPlanCreateStudyPlanCustomerDataRequestDuplicateInvoicePreventionGroundedAnswerIngestClickstreamInvoiceCreatedNetworkEgressPolicyPlaceOrderResearchAgentRunResetPasswordStorefrontStyleSubscriptionUpgradeTenantIsolationUploadStudyMaterial