@happyvertical/smrt-commerce 0.30.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.
Files changed (101) hide show
  1. package/AGENTS.md +44 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/README.md +146 -0
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/collections/ContractCollection.d.ts +87 -0
  8. package/dist/collections/ContractCollection.d.ts.map +1 -0
  9. package/dist/collections/CustomerCollection.d.ts +58 -0
  10. package/dist/collections/CustomerCollection.d.ts.map +1 -0
  11. package/dist/collections/FulfillmentCollection.d.ts +75 -0
  12. package/dist/collections/FulfillmentCollection.d.ts.map +1 -0
  13. package/dist/collections/InvoiceCollection.d.ts +162 -0
  14. package/dist/collections/InvoiceCollection.d.ts.map +1 -0
  15. package/dist/collections/InvoiceLineItemCollection.d.ts +90 -0
  16. package/dist/collections/InvoiceLineItemCollection.d.ts.map +1 -0
  17. package/dist/collections/PaymentAllocationCollection.d.ts +86 -0
  18. package/dist/collections/PaymentAllocationCollection.d.ts.map +1 -0
  19. package/dist/collections/PaymentCollection.d.ts +96 -0
  20. package/dist/collections/PaymentCollection.d.ts.map +1 -0
  21. package/dist/collections/PaymentIntentCollection.d.ts +66 -0
  22. package/dist/collections/PaymentIntentCollection.d.ts.map +1 -0
  23. package/dist/collections/PayoutCollection.d.ts +47 -0
  24. package/dist/collections/PayoutCollection.d.ts.map +1 -0
  25. package/dist/collections/VendorCollection.d.ts +59 -0
  26. package/dist/collections/VendorCollection.d.ts.map +1 -0
  27. package/dist/collections/index.d.ts +15 -0
  28. package/dist/collections/index.d.ts.map +1 -0
  29. package/dist/index.d.ts +5 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +5308 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/manifest.json +13852 -0
  34. package/dist/models/Contract.d.ts +425 -0
  35. package/dist/models/Contract.d.ts.map +1 -0
  36. package/dist/models/ContractLineItem.d.ts +92 -0
  37. package/dist/models/ContractLineItem.d.ts.map +1 -0
  38. package/dist/models/Customer.d.ts +98 -0
  39. package/dist/models/Customer.d.ts.map +1 -0
  40. package/dist/models/Fulfillment.d.ts +99 -0
  41. package/dist/models/Fulfillment.d.ts.map +1 -0
  42. package/dist/models/FulfillmentLineItem.d.ts +42 -0
  43. package/dist/models/FulfillmentLineItem.d.ts.map +1 -0
  44. package/dist/models/Invoice.d.ts +326 -0
  45. package/dist/models/Invoice.d.ts.map +1 -0
  46. package/dist/models/InvoiceLineItem.d.ts +120 -0
  47. package/dist/models/InvoiceLineItem.d.ts.map +1 -0
  48. package/dist/models/Payment.d.ts +269 -0
  49. package/dist/models/Payment.d.ts.map +1 -0
  50. package/dist/models/PaymentAllocation.d.ts +93 -0
  51. package/dist/models/PaymentAllocation.d.ts.map +1 -0
  52. package/dist/models/PaymentIntent.d.ts +341 -0
  53. package/dist/models/PaymentIntent.d.ts.map +1 -0
  54. package/dist/models/Payout.d.ts +200 -0
  55. package/dist/models/Payout.d.ts.map +1 -0
  56. package/dist/models/Vendor.d.ts +153 -0
  57. package/dist/models/Vendor.d.ts.map +1 -0
  58. package/dist/models/index.d.ts +17 -0
  59. package/dist/models/index.d.ts.map +1 -0
  60. package/dist/playground.d.ts +2 -0
  61. package/dist/playground.d.ts.map +1 -0
  62. package/dist/playground.js +108 -0
  63. package/dist/playground.js.map +1 -0
  64. package/dist/smrt-knowledge.json +5494 -0
  65. package/dist/svelte/components/InvoiceActions.svelte +191 -0
  66. package/dist/svelte/components/InvoiceActions.svelte.d.ts +26 -0
  67. package/dist/svelte/components/InvoiceActions.svelte.d.ts.map +1 -0
  68. package/dist/svelte/components/InvoiceCard.svelte +233 -0
  69. package/dist/svelte/components/InvoiceCard.svelte.d.ts +16 -0
  70. package/dist/svelte/components/InvoiceCard.svelte.d.ts.map +1 -0
  71. package/dist/svelte/components/InvoiceHeader.svelte +258 -0
  72. package/dist/svelte/components/InvoiceHeader.svelte.d.ts +26 -0
  73. package/dist/svelte/components/InvoiceHeader.svelte.d.ts.map +1 -0
  74. package/dist/svelte/components/InvoiceLineItems.svelte +322 -0
  75. package/dist/svelte/components/InvoiceLineItems.svelte.d.ts +24 -0
  76. package/dist/svelte/components/InvoiceLineItems.svelte.d.ts.map +1 -0
  77. package/dist/svelte/components/InvoiceTotals.svelte +193 -0
  78. package/dist/svelte/components/InvoiceTotals.svelte.d.ts +27 -0
  79. package/dist/svelte/components/InvoiceTotals.svelte.d.ts.map +1 -0
  80. package/dist/svelte/components/UnbilledItems.svelte +355 -0
  81. package/dist/svelte/components/UnbilledItems.svelte.d.ts +18 -0
  82. package/dist/svelte/components/UnbilledItems.svelte.d.ts.map +1 -0
  83. package/dist/svelte/i18n.d.ts +19 -0
  84. package/dist/svelte/i18n.d.ts.map +1 -0
  85. package/dist/svelte/i18n.js +19 -0
  86. package/dist/svelte/index.d.ts +40 -0
  87. package/dist/svelte/index.d.ts.map +1 -0
  88. package/dist/svelte/index.js +43 -0
  89. package/dist/svelte/playground.d.ts +103 -0
  90. package/dist/svelte/playground.d.ts.map +1 -0
  91. package/dist/svelte/playground.js +103 -0
  92. package/dist/svelte/types.d.ts +47 -0
  93. package/dist/svelte/types.d.ts.map +1 -0
  94. package/dist/svelte/types.js +4 -0
  95. package/dist/types/index.d.ts +234 -0
  96. package/dist/types/index.d.ts.map +1 -0
  97. package/dist/ui.d.ts +10 -0
  98. package/dist/ui.d.ts.map +1 -0
  99. package/dist/ui.js +85 -0
  100. package/dist/ui.js.map +1 -0
  101. package/package.json +87 -0
@@ -0,0 +1,90 @@
1
+ import { SmrtCollection } from '@happyvertical/smrt-core';
2
+ import { InvoiceLineItem } from '../models/InvoiceLineItem.js';
3
+ export declare class InvoiceLineItemCollection extends SmrtCollection<InvoiceLineItem> {
4
+ static readonly _itemClass: typeof InvoiceLineItem;
5
+ /**
6
+ * Find line items by invoice
7
+ *
8
+ * @param invoiceId - Invoice ID
9
+ * @returns Array of line items, sorted by sortOrder
10
+ */
11
+ findByInvoice(invoiceId: string): Promise<InvoiceLineItem[]>;
12
+ /**
13
+ * Find line items by source
14
+ *
15
+ * @param sourceType - Source type (e.g., 'campaign', 'contract')
16
+ * @param sourceId - Source ID
17
+ * @returns Array of line items
18
+ */
19
+ findBySource(sourceType: string, sourceId: string): Promise<InvoiceLineItem[]>;
20
+ /**
21
+ * Find line items by source type only
22
+ *
23
+ * @param sourceType - Source type (e.g., 'campaign')
24
+ * @returns Array of line items
25
+ */
26
+ findBySourceType(sourceType: string): Promise<InvoiceLineItem[]>;
27
+ /**
28
+ * Calculate total amount for an invoice
29
+ *
30
+ * @param invoiceId - Invoice ID
31
+ * @returns Total amount
32
+ */
33
+ getTotalForInvoice(invoiceId: string): Promise<number>;
34
+ /**
35
+ * Calculate subtotal (before tax) for an invoice
36
+ *
37
+ * @param invoiceId - Invoice ID
38
+ * @returns Subtotal
39
+ */
40
+ getSubtotalForInvoice(invoiceId: string): Promise<number>;
41
+ /**
42
+ * Calculate tax amount for an invoice
43
+ *
44
+ * @param invoiceId - Invoice ID
45
+ * @returns Tax amount
46
+ */
47
+ getTaxForInvoice(invoiceId: string): Promise<number>;
48
+ /**
49
+ * Get the next sort order for an invoice
50
+ *
51
+ * @param invoiceId - Invoice ID
52
+ * @returns Next sort order number
53
+ */
54
+ getNextSortOrder(invoiceId: string): Promise<number>;
55
+ /**
56
+ * Recalculate all line item amounts for an invoice
57
+ *
58
+ * @param invoiceId - Invoice ID
59
+ * @returns Updated line items
60
+ */
61
+ recalculateAmounts(invoiceId: string): Promise<InvoiceLineItem[]>;
62
+ /**
63
+ * Convert line items to accounting format for SDK sync
64
+ *
65
+ * @param invoiceId - Invoice ID
66
+ * @returns Array of line items in accounting format
67
+ */
68
+ toAccountingLineItems(invoiceId: string): Promise<any[]>;
69
+ /**
70
+ * Find all invoice line items belonging to a specific tenant
71
+ *
72
+ * @param tenantId - Tenant ID
73
+ * @returns Array of invoice line items for the tenant
74
+ */
75
+ findByTenant(tenantId: string): Promise<InvoiceLineItem[]>;
76
+ /**
77
+ * Find all global invoice line items (not associated with any tenant)
78
+ *
79
+ * @returns Array of global invoice line items
80
+ */
81
+ findGlobal(): Promise<InvoiceLineItem[]>;
82
+ /**
83
+ * Find invoice line items for a tenant including global line items
84
+ *
85
+ * @param tenantId - Tenant ID
86
+ * @returns Array of tenant-specific and global invoice line items
87
+ */
88
+ findWithGlobals(tenantId: string): Promise<InvoiceLineItem[]>;
89
+ }
90
+ //# sourceMappingURL=InvoiceLineItemCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvoiceLineItemCollection.d.ts","sourceRoot":"","sources":["../../src/collections/InvoiceLineItemCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,qBAAa,yBAA0B,SAAQ,cAAc,CAAC,eAAe,CAAC;IAC5E,MAAM,CAAC,QAAQ,CAAC,UAAU,yBAAmB;IAE7C;;;;;OAKG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAOlE;;;;;;OAMG;IACG,YAAY,CAChB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,eAAe,EAAE,CAAC;IAO7B;;;;;OAKG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAOtE;;;;;OAKG;IACG,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK5D;;;;;OAKG;IACG,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK/D;;;;;OAKG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK1D;;;;;OAKG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ1D;;;;;OAKG;IACG,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAYvE;;;;;OAKG;IACG,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAS9D;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAIhE;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAI9C;;;;;OAKG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAMpE"}
@@ -0,0 +1,86 @@
1
+ import { SmrtCollection } from '@happyvertical/smrt-core';
2
+ import { PaymentAllocation } from '../models/PaymentAllocation.js';
3
+ export declare class PaymentAllocationCollection extends SmrtCollection<PaymentAllocation> {
4
+ static readonly _itemClass: typeof PaymentAllocation;
5
+ /**
6
+ * Find allocations by payment
7
+ *
8
+ * @param paymentId - Payment ID
9
+ * @returns Array of allocations
10
+ */
11
+ findByPayment(paymentId: string): Promise<PaymentAllocation[]>;
12
+ /**
13
+ * Find allocations by invoice
14
+ *
15
+ * @param invoiceId - Invoice ID
16
+ * @returns Array of allocations
17
+ */
18
+ findByInvoice(invoiceId: string): Promise<PaymentAllocation[]>;
19
+ /**
20
+ * Get total amount allocated to an invoice
21
+ *
22
+ * @param invoiceId - Invoice ID
23
+ * @returns Total allocated amount
24
+ */
25
+ getTotalAllocatedToInvoice(invoiceId: string): Promise<number>;
26
+ /**
27
+ * Get total amount allocated from a payment
28
+ *
29
+ * @param paymentId - Payment ID
30
+ * @returns Total allocated amount
31
+ */
32
+ getTotalAllocatedFromPayment(paymentId: string): Promise<number>;
33
+ /**
34
+ * Get remaining unallocated amount from a payment.
35
+ *
36
+ * @param paymentId - Payment ID
37
+ * @param paymentAmount - Total payment amount
38
+ * @returns Unallocated amount
39
+ * @throws Error if payment is over-allocated (indicates data integrity issue)
40
+ */
41
+ getUnallocatedFromPayment(paymentId: string, paymentAmount: number): Promise<number>;
42
+ /**
43
+ * Find allocation by payment and invoice
44
+ *
45
+ * @param paymentId - Payment ID
46
+ * @param invoiceId - Invoice ID
47
+ * @returns Allocation or null
48
+ */
49
+ findByPaymentAndInvoice(paymentId: string, invoiceId: string): Promise<PaymentAllocation | null>;
50
+ /**
51
+ * Find allocations by allocator
52
+ *
53
+ * @param allocatedBy - User/agent ID who made the allocation
54
+ * @returns Array of allocations
55
+ */
56
+ findByAllocator(allocatedBy: string): Promise<PaymentAllocation[]>;
57
+ /**
58
+ * Find allocations in date range
59
+ *
60
+ * @param startDate - Start date
61
+ * @param endDate - End date
62
+ * @returns Array of allocations
63
+ */
64
+ findByDateRange(startDate: Date, endDate: Date): Promise<PaymentAllocation[]>;
65
+ /**
66
+ * Find all payment allocations belonging to a specific tenant
67
+ *
68
+ * @param tenantId - Tenant ID
69
+ * @returns Array of payment allocations for the tenant
70
+ */
71
+ findByTenant(tenantId: string): Promise<PaymentAllocation[]>;
72
+ /**
73
+ * Find all global payment allocations (not associated with any tenant)
74
+ *
75
+ * @returns Array of global payment allocations
76
+ */
77
+ findGlobal(): Promise<PaymentAllocation[]>;
78
+ /**
79
+ * Find payment allocations for a tenant including global allocations
80
+ *
81
+ * @param tenantId - Tenant ID
82
+ * @returns Array of tenant-specific and global payment allocations
83
+ */
84
+ findWithGlobals(tenantId: string): Promise<PaymentAllocation[]>;
85
+ }
86
+ //# sourceMappingURL=PaymentAllocationCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentAllocationCollection.d.ts","sourceRoot":"","sources":["../../src/collections/PaymentAllocationCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAEnE,qBAAa,2BAA4B,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,UAAU,2BAAqB;IAE/C;;;;;OAKG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAOpE;;;;;OAKG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAOpE;;;;;OAKG;IACG,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKpE;;;;;OAKG;IACG,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKtE;;;;;;;OAOG;IACG,yBAAyB,CAC7B,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC;IAclB;;;;;;OAMG;IACG,uBAAuB,CAC3B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAQpC;;;;;OAKG;IACG,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAOxE;;;;;;OAMG;IACG,eAAe,CACnB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,GACZ,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAc/B;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAIlE;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAIhD;;;;;OAKG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAMtE"}
@@ -0,0 +1,96 @@
1
+ import { SmrtCollection } from '@happyvertical/smrt-core';
2
+ import { Payment } from '../models/Payment.js';
3
+ import { PaymentMethod, PaymentStatus } from '../types/index.js';
4
+ export declare class PaymentCollection extends SmrtCollection<Payment> {
5
+ static readonly _itemClass: typeof Payment;
6
+ /**
7
+ * Find payments by contract
8
+ *
9
+ * @param contractId - Contract ID
10
+ * @returns Array of payments
11
+ */
12
+ findByContract(contractId: string): Promise<Payment[]>;
13
+ /**
14
+ * Find payments by customer
15
+ *
16
+ * @param customerId - Customer ID
17
+ * @returns Array of payments
18
+ */
19
+ findByCustomer(customerId: string): Promise<Payment[]>;
20
+ /**
21
+ * Find payments by status
22
+ *
23
+ * @param status - Payment status
24
+ * @returns Array of payments
25
+ */
26
+ findByStatus(status: PaymentStatus): Promise<Payment[]>;
27
+ /**
28
+ * Find payments by method
29
+ *
30
+ * @param method - Payment method
31
+ * @returns Array of payments
32
+ */
33
+ findByMethod(method: PaymentMethod): Promise<Payment[]>;
34
+ /**
35
+ * Find all pending payments
36
+ *
37
+ * @returns Array of pending payments
38
+ */
39
+ findPending(): Promise<Payment[]>;
40
+ /**
41
+ * Find all completed payments
42
+ *
43
+ * @returns Array of completed payments
44
+ */
45
+ findCompleted(): Promise<Payment[]>;
46
+ /**
47
+ * Find payment by transaction ID
48
+ *
49
+ * @param transactionId - External transaction ID
50
+ * @returns Payment or null
51
+ */
52
+ findByTransactionId(transactionId: string): Promise<Payment | null>;
53
+ /**
54
+ * Find payments in date range
55
+ *
56
+ * @param startDate - Start date
57
+ * @param endDate - End date
58
+ * @returns Array of payments
59
+ */
60
+ findByDateRange(startDate: Date, endDate: Date): Promise<Payment[]>;
61
+ /**
62
+ * Calculate total payments for a contract
63
+ *
64
+ * @param contractId - Contract ID
65
+ * @returns Total amount paid
66
+ */
67
+ getTotalForContract(contractId: string): Promise<number>;
68
+ /**
69
+ * Find payments linked to a ledger journal
70
+ *
71
+ * @param journalId - Journal ID from smrt-ledgers
72
+ * @returns Payment or null
73
+ */
74
+ findByJournal(journalId: string): Promise<Payment | null>;
75
+ /**
76
+ * Find all payments belonging to a specific tenant
77
+ *
78
+ * @param tenantId - Tenant ID
79
+ * @returns Array of payments for the tenant
80
+ */
81
+ findByTenant(tenantId: string): Promise<Payment[]>;
82
+ /**
83
+ * Find all global payments (not associated with any tenant)
84
+ *
85
+ * @returns Array of global payments
86
+ */
87
+ findGlobal(): Promise<Payment[]>;
88
+ /**
89
+ * Find payments for a tenant including global payments
90
+ *
91
+ * @param tenantId - Tenant ID
92
+ * @returns Array of tenant-specific and global payments
93
+ */
94
+ findWithGlobals(tenantId: string): Promise<Payment[]>;
95
+ }
96
+ //# sourceMappingURL=PaymentCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentCollection.d.ts","sourceRoot":"","sources":["../../src/collections/PaymentCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEtE,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,OAAO,CAAC;IAC5D,MAAM,CAAC,QAAQ,CAAC,UAAU,iBAAW;IAErC;;;;;OAKG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO5D;;;;;OAKG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO5D;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO7D;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAO7D;;;;OAIG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAIvC;;;;OAIG;IACG,aAAa,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAIzC;;;;;OAKG;IACG,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAQzE;;;;;;OAMG;IACG,eAAe,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAUzE;;;;;OAKG;IACG,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAW9D;;;;;OAKG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IAY/D;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAIxD;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAItC;;;;;OAKG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAM5D"}
@@ -0,0 +1,66 @@
1
+ import { SmrtCollection } from '@happyvertical/smrt-core';
2
+ import { PaymentIntent } from '../models/PaymentIntent.js';
3
+ import { PaymentIntentStatus, PaymentOption } from '../types/index.js';
4
+ export interface PaymentIntentIdempotencyArgs {
5
+ /** Caller-supplied scope (Sku id / tier id / etc.) */
6
+ offeringRef: string;
7
+ /** Buyer email — second factor of the natural key */
8
+ licenseeEmail: string;
9
+ /** Caller-supplied idempotency key */
10
+ idempotencyKey: string;
11
+ /** Optional tenant scope, when called outside an active tenant context */
12
+ tenantId?: string | null;
13
+ }
14
+ export interface PaymentIntentSeed extends Partial<Omit<PaymentIntentIdempotencyArgs, 'tenantId'>> {
15
+ tenantId?: string | null;
16
+ skuId?: string;
17
+ customerId?: string;
18
+ paymentOptions: PaymentOption[];
19
+ usdPriceLocked: number;
20
+ priceLockWindowMs?: number;
21
+ }
22
+ export declare class PaymentIntentCollection extends SmrtCollection<PaymentIntent> {
23
+ static readonly _itemClass: typeof PaymentIntent;
24
+ /**
25
+ * Look up an existing intent by its natural key. Returns `null` when
26
+ * any of the three components are empty — empty natural-key inputs
27
+ * disable dedup by design, so a `null` return tells the caller to
28
+ * fall through to a fresh `create`.
29
+ */
30
+ findByIdempotencyKey(args: PaymentIntentIdempotencyArgs): Promise<PaymentIntent | null>;
31
+ /**
32
+ * Idempotency-aware create. If an intent already exists with the
33
+ * same `(tenantId, offeringRef, licenseeEmail, idempotencyKey)`
34
+ * tuple, returns the existing row. Otherwise creates a new one
35
+ * with the supplied seed.
36
+ *
37
+ * Returns a `{ intent, created }` pair so callers can branch on
38
+ * whether they're handling a fresh quote or a replay (e.g. to
39
+ * skip a duplicate "intent created" webhook emission).
40
+ */
41
+ getOrCreateByIdempotencyKey(seed: PaymentIntentSeed): Promise<{
42
+ intent: PaymentIntent;
43
+ created: boolean;
44
+ }>;
45
+ /**
46
+ * Open intents — `AWAITING_PAYMENT` and not yet past the price-
47
+ * lock window. The price-lock check is `Date.now()`-based, so a
48
+ * stale-but-not-yet-marked-EXPIRED row drops out of this list even
49
+ * before a cleanup job advances its status.
50
+ */
51
+ findOpen(): Promise<PaymentIntent[]>;
52
+ /**
53
+ * `AWAITING_PAYMENT` intents whose price-lock window has already
54
+ * passed. The expected use is a periodic cleanup job that loads
55
+ * this list, calls `intent.expire(); await intent.save()` on each,
56
+ * and emits whatever downstream signal the application needs.
57
+ */
58
+ findStale(): Promise<PaymentIntent[]>;
59
+ findByLicenseeEmail(email: string): Promise<PaymentIntent[]>;
60
+ findByOfferingRef(offeringRef: string): Promise<PaymentIntent[]>;
61
+ findByStatus(status: PaymentIntentStatus): Promise<PaymentIntent[]>;
62
+ findByTenant(tenantId: string): Promise<PaymentIntent[]>;
63
+ findGlobal(): Promise<PaymentIntent[]>;
64
+ findWithGlobals(tenantId: string): Promise<PaymentIntent[]>;
65
+ }
66
+ //# sourceMappingURL=PaymentIntentCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaymentIntentCollection.d.ts","sourceRoot":"","sources":["../../src/collections/PaymentIntentCollection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5E,MAAM,WAAW,4BAA4B;IAC3C,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAC;IACtB,sCAAsC;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,iBACf,SAAQ,OAAO,CAAC,IAAI,CAAC,4BAA4B,EAAE,UAAU,CAAC,CAAC;IAC/D,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,qBAAa,uBAAwB,SAAQ,cAAc,CAAC,aAAa,CAAC;IACxE,MAAM,CAAC,QAAQ,CAAC,UAAU,uBAAiB;IAE3C;;;;;OAKG;IACG,oBAAoB,CACxB,IAAI,EAAE,4BAA4B,GACjC,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAgBhC;;;;;;;;;OASG;IACG,2BAA2B,CAC/B,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC;QAAE,MAAM,EAAE,aAAa,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAavD;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAY1C;;;;;OAKG;IACG,SAAS,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAWrC,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAO5D,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAOhE,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAWnE,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAIxD,UAAU,IAAI,OAAO,CAAC,aAAa,EAAE,CAAC;IAItC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;CAMlE"}
@@ -0,0 +1,47 @@
1
+ import { SmrtCollection } from '@happyvertical/smrt-core';
2
+ import { Payment } from '../models/Payment.js';
3
+ import { Payout } from '../models/Payout.js';
4
+ import { PayoutStatus } from '../types/index.js';
5
+ export interface CreatePayoutFromPaymentArgs {
6
+ /** Source Payment row */
7
+ payment: Payment;
8
+ /** Destination vendor id */
9
+ vendorId: string;
10
+ /** Operator fee in the payment's native currency */
11
+ operatorFee: number;
12
+ /** Backend that will send the payout — defaults to the payment's */
13
+ backendId?: string;
14
+ /** Optional initial notes */
15
+ notes?: string;
16
+ }
17
+ export declare class PayoutCollection extends SmrtCollection<Payout> {
18
+ static readonly _itemClass: typeof Payout;
19
+ /**
20
+ * Build a `PENDING` payout linked to a source payment. The gross
21
+ * defaults to the payment's `nativeAmount` (falling back to
22
+ * `amount` if no backend rail was recorded), the currency defaults
23
+ * to the payment's `nativeCurrency` (falling back to `currency`),
24
+ * and `supplierNet` is computed as `gross - operatorFee`.
25
+ *
26
+ * The returned instance is initialized but not persisted. The caller
27
+ * is still responsible for `await payout.save()` — keeping create /
28
+ * save as separate steps lets callers stitch the payout into an
29
+ * application-level transaction.
30
+ */
31
+ createFromPayment(args: CreatePayoutFromPaymentArgs): Promise<Payout>;
32
+ findByPayment(paymentId: string): Promise<Payout[]>;
33
+ findByVendor(vendorId: string): Promise<Payout[]>;
34
+ findByStatus(status: PayoutStatus): Promise<Payout[]>;
35
+ findPending(): Promise<Payout[]>;
36
+ findFailed(): Promise<Payout[]>;
37
+ findByBackendTxRef(backendTxRef: string): Promise<Payout | null>;
38
+ /**
39
+ * Total funds delivered to a vendor in confirmed payouts. Useful for
40
+ * a vendor-balance widget on the operator dashboard.
41
+ */
42
+ getConfirmedTotalForVendor(vendorId: string): Promise<number>;
43
+ findByTenant(tenantId: string): Promise<Payout[]>;
44
+ findGlobal(): Promise<Payout[]>;
45
+ findWithGlobals(tenantId: string): Promise<Payout[]>;
46
+ }
47
+ //# sourceMappingURL=PayoutCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PayoutCollection.d.ts","sourceRoot":"","sources":["../../src/collections/PayoutCollection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,2BAA2B;IAC1C,yBAAyB;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,gBAAiB,SAAQ,cAAc,CAAC,MAAM,CAAC;IAC1D,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAU;IAEpC;;;;;;;;;;;OAWG;IACG,iBAAiB,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC;IA6BrE,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAOnD,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAOjD,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAOrD,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIhC,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/B,kBAAkB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAStE;;;OAGG;IACG,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAW7D,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIjD,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAI/B,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAM3D"}
@@ -0,0 +1,59 @@
1
+ import { SmrtCollection } from '@happyvertical/smrt-core';
2
+ import { Vendor } from '../models/Vendor.js';
3
+ import { VendorStatus } from '../types/index.js';
4
+ export declare class VendorCollection extends SmrtCollection<Vendor> {
5
+ static readonly _itemClass: typeof Vendor;
6
+ /**
7
+ * Find vendors by profile ID
8
+ *
9
+ * @param profileId - Profile ID from smrt-profiles
10
+ * @returns Array of vendors linked to this profile
11
+ */
12
+ findByProfile(profileId: string): Promise<Vendor[]>;
13
+ /**
14
+ * Find all active vendors
15
+ *
16
+ * @returns Array of active vendors
17
+ */
18
+ findActive(): Promise<Vendor[]>;
19
+ /**
20
+ * Find vendors by status
21
+ *
22
+ * @param status - Vendor status
23
+ * @returns Array of vendors
24
+ */
25
+ findByStatus(status: VendorStatus): Promise<Vendor[]>;
26
+ /**
27
+ * Get or create a vendor for a profile
28
+ *
29
+ * @param profileId - Profile ID
30
+ * @param defaults - Default values if creating
31
+ * @returns Vendor
32
+ */
33
+ getOrCreateForProfile(profileId: string, defaults?: Partial<{
34
+ leadTimeDays: number;
35
+ minimumOrderAmount: number;
36
+ paymentTerms: string;
37
+ }>): Promise<Vendor>;
38
+ /**
39
+ * Find all vendors belonging to a specific tenant
40
+ *
41
+ * @param tenantId - Tenant ID
42
+ * @returns Array of vendors for the tenant
43
+ */
44
+ findByTenant(tenantId: string): Promise<Vendor[]>;
45
+ /**
46
+ * Find all global vendors (not associated with any tenant)
47
+ *
48
+ * @returns Array of global vendors
49
+ */
50
+ findGlobal(): Promise<Vendor[]>;
51
+ /**
52
+ * Find vendors for a tenant including global vendors
53
+ *
54
+ * @param tenantId - Tenant ID
55
+ * @returns Array of tenant-specific and global vendors
56
+ */
57
+ findWithGlobals(tenantId: string): Promise<Vendor[]>;
58
+ }
59
+ //# sourceMappingURL=VendorCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VendorCollection.d.ts","sourceRoot":"","sources":["../../src/collections/VendorCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,qBAAa,gBAAiB,SAAQ,cAAc,CAAC,MAAM,CAAC;IAC1D,MAAM,CAAC,QAAQ,CAAC,UAAU,gBAAU;IAEpC;;;;;OAKG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAOzD;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAOrC;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAO3D;;;;;;OAMG;IACG,qBAAqB,CACzB,SAAS,EAAE,MAAM,EACjB,QAAQ,GAAE,OAAO,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,YAAY,EAAE,MAAM,CAAC;KACtB,CAAM,GACN,OAAO,CAAC,MAAM,CAAC;IAqBlB;;;;;OAKG;IACG,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAIvD;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAIrC;;;;;OAKG;IACG,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;CAM3D"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Collection exports for smrt-commerce
3
+ * @packageDocumentation
4
+ */
5
+ export { ContractCollection } from './ContractCollection.js';
6
+ export { CustomerCollection } from './CustomerCollection.js';
7
+ export { FulfillmentCollection } from './FulfillmentCollection.js';
8
+ export { InvoiceCollection, type InvoiceNumberOptions, UNPAID_STATUSES, } from './InvoiceCollection.js';
9
+ export { InvoiceLineItemCollection } from './InvoiceLineItemCollection.js';
10
+ export { PaymentAllocationCollection } from './PaymentAllocationCollection.js';
11
+ export { PaymentCollection } from './PaymentCollection.js';
12
+ export { PaymentIntentCollection, type PaymentIntentIdempotencyArgs, type PaymentIntentSeed, } from './PaymentIntentCollection.js';
13
+ export { type CreatePayoutFromPaymentArgs, PayoutCollection, } from './PayoutCollection.js';
14
+ export { VendorCollection } from './VendorCollection.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EACL,iBAAiB,EACjB,KAAK,oBAAoB,EACzB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,GACvB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,KAAK,2BAA2B,EAChC,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { ContractCollection, type CreatePayoutFromPaymentArgs, CustomerCollection, FulfillmentCollection, InvoiceCollection, InvoiceLineItemCollection, type InvoiceNumberOptions, PaymentAllocationCollection, PaymentCollection, PaymentIntentCollection, type PaymentIntentIdempotencyArgs, type PaymentIntentSeed, PayoutCollection, UNPAID_STATUSES, VendorCollection, } from './collections/index.js';
2
+ export { Agreement, Cart, Contract, ContractLineItem, Customer, Estimate, Fulfillment, FulfillmentLineItem, Invoice, InvoiceLineItem, Lease, type LicenseRightsSnapshot, LicenseSale, Order, Payment, PaymentAllocation, PaymentIntent, Payout, ProductionOrder, PurchaseOrder, Vendor, WholesaleOrder, } from './models/index.js';
3
+ export { type Address, ContractStatus, ContractType, CustomerStatus, CustomerType, FulfillmentStatus, FulfillmentType, InvoiceStatus, PaymentIntentStatus, PaymentMethod, type PaymentOption, PaymentStatus, PayoutStatus, type RecognizeRevenueOptions, type RecordPaymentOptions, VendorStatus, } from './types/index.js';
4
+ export { COMMERCE_MODULE_META, COMMERCE_UI_SLOTS } from './ui.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AAKH,OAAO,wBAAwB,CAAC;AAGhC,OAAO,EACL,kBAAkB,EAClB,KAAK,2BAA2B,EAChC,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,KAAK,oBAAoB,EACzB,2BAA2B,EAC3B,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EACL,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,gBAAgB,EAChB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,KAAK,EACL,KAAK,qBAAqB,EAC1B,WAAW,EACX,KAAK,EACL,OAAO,EACP,iBAAiB,EACjB,aAAa,EACb,MAAM,EACN,eAAe,EACf,aAAa,EACb,MAAM,EACN,cAAc,GACf,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,KAAK,OAAO,EACZ,cAAc,EACd,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,KAAK,aAAa,EAClB,aAAa,EACb,YAAY,EACZ,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}