@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.
- package/AGENTS.md +44 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +146 -0
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/collections/ContractCollection.d.ts +87 -0
- package/dist/collections/ContractCollection.d.ts.map +1 -0
- package/dist/collections/CustomerCollection.d.ts +58 -0
- package/dist/collections/CustomerCollection.d.ts.map +1 -0
- package/dist/collections/FulfillmentCollection.d.ts +75 -0
- package/dist/collections/FulfillmentCollection.d.ts.map +1 -0
- package/dist/collections/InvoiceCollection.d.ts +162 -0
- package/dist/collections/InvoiceCollection.d.ts.map +1 -0
- package/dist/collections/InvoiceLineItemCollection.d.ts +90 -0
- package/dist/collections/InvoiceLineItemCollection.d.ts.map +1 -0
- package/dist/collections/PaymentAllocationCollection.d.ts +86 -0
- package/dist/collections/PaymentAllocationCollection.d.ts.map +1 -0
- package/dist/collections/PaymentCollection.d.ts +96 -0
- package/dist/collections/PaymentCollection.d.ts.map +1 -0
- package/dist/collections/PaymentIntentCollection.d.ts +66 -0
- package/dist/collections/PaymentIntentCollection.d.ts.map +1 -0
- package/dist/collections/PayoutCollection.d.ts +47 -0
- package/dist/collections/PayoutCollection.d.ts.map +1 -0
- package/dist/collections/VendorCollection.d.ts +59 -0
- package/dist/collections/VendorCollection.d.ts.map +1 -0
- package/dist/collections/index.d.ts +15 -0
- package/dist/collections/index.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5308 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.json +13852 -0
- package/dist/models/Contract.d.ts +425 -0
- package/dist/models/Contract.d.ts.map +1 -0
- package/dist/models/ContractLineItem.d.ts +92 -0
- package/dist/models/ContractLineItem.d.ts.map +1 -0
- package/dist/models/Customer.d.ts +98 -0
- package/dist/models/Customer.d.ts.map +1 -0
- package/dist/models/Fulfillment.d.ts +99 -0
- package/dist/models/Fulfillment.d.ts.map +1 -0
- package/dist/models/FulfillmentLineItem.d.ts +42 -0
- package/dist/models/FulfillmentLineItem.d.ts.map +1 -0
- package/dist/models/Invoice.d.ts +326 -0
- package/dist/models/Invoice.d.ts.map +1 -0
- package/dist/models/InvoiceLineItem.d.ts +120 -0
- package/dist/models/InvoiceLineItem.d.ts.map +1 -0
- package/dist/models/Payment.d.ts +269 -0
- package/dist/models/Payment.d.ts.map +1 -0
- package/dist/models/PaymentAllocation.d.ts +93 -0
- package/dist/models/PaymentAllocation.d.ts.map +1 -0
- package/dist/models/PaymentIntent.d.ts +341 -0
- package/dist/models/PaymentIntent.d.ts.map +1 -0
- package/dist/models/Payout.d.ts +200 -0
- package/dist/models/Payout.d.ts.map +1 -0
- package/dist/models/Vendor.d.ts +153 -0
- package/dist/models/Vendor.d.ts.map +1 -0
- package/dist/models/index.d.ts +17 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/playground.d.ts +2 -0
- package/dist/playground.d.ts.map +1 -0
- package/dist/playground.js +108 -0
- package/dist/playground.js.map +1 -0
- package/dist/smrt-knowledge.json +5494 -0
- package/dist/svelte/components/InvoiceActions.svelte +191 -0
- package/dist/svelte/components/InvoiceActions.svelte.d.ts +26 -0
- package/dist/svelte/components/InvoiceActions.svelte.d.ts.map +1 -0
- package/dist/svelte/components/InvoiceCard.svelte +233 -0
- package/dist/svelte/components/InvoiceCard.svelte.d.ts +16 -0
- package/dist/svelte/components/InvoiceCard.svelte.d.ts.map +1 -0
- package/dist/svelte/components/InvoiceHeader.svelte +258 -0
- package/dist/svelte/components/InvoiceHeader.svelte.d.ts +26 -0
- package/dist/svelte/components/InvoiceHeader.svelte.d.ts.map +1 -0
- package/dist/svelte/components/InvoiceLineItems.svelte +322 -0
- package/dist/svelte/components/InvoiceLineItems.svelte.d.ts +24 -0
- package/dist/svelte/components/InvoiceLineItems.svelte.d.ts.map +1 -0
- package/dist/svelte/components/InvoiceTotals.svelte +193 -0
- package/dist/svelte/components/InvoiceTotals.svelte.d.ts +27 -0
- package/dist/svelte/components/InvoiceTotals.svelte.d.ts.map +1 -0
- package/dist/svelte/components/UnbilledItems.svelte +355 -0
- package/dist/svelte/components/UnbilledItems.svelte.d.ts +18 -0
- package/dist/svelte/components/UnbilledItems.svelte.d.ts.map +1 -0
- package/dist/svelte/i18n.d.ts +19 -0
- package/dist/svelte/i18n.d.ts.map +1 -0
- package/dist/svelte/i18n.js +19 -0
- package/dist/svelte/index.d.ts +40 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +43 -0
- package/dist/svelte/playground.d.ts +103 -0
- package/dist/svelte/playground.d.ts.map +1 -0
- package/dist/svelte/playground.js +103 -0
- package/dist/svelte/types.d.ts +47 -0
- package/dist/svelte/types.d.ts.map +1 -0
- package/dist/svelte/types.js +4 -0
- package/dist/types/index.d.ts +234 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +85 -0
- package/dist/ui.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
+
import { VendorStatus } from '../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Vendor represents the vendor/supplier role for a Profile.
|
|
5
|
+
*
|
|
6
|
+
* One Profile can have both Customer and Vendor records - e.g., a company
|
|
7
|
+
* you both buy from and sell to.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const vendor = await vendors.create({
|
|
12
|
+
* profileId: 'profile-uuid',
|
|
13
|
+
* leadTimeDays: 14,
|
|
14
|
+
* minimumOrderAmount: 500,
|
|
15
|
+
* paymentTerms: 'Net 60'
|
|
16
|
+
* });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare class Vendor extends SmrtObject {
|
|
20
|
+
/**
|
|
21
|
+
* Tenant ID for multi-tenant isolation
|
|
22
|
+
* Nullable to support both tenant-scoped and global vendors
|
|
23
|
+
*/
|
|
24
|
+
tenantId: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Reference to smrt-profiles Profile
|
|
27
|
+
* Plain string for cross-package reference
|
|
28
|
+
*/
|
|
29
|
+
profileId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Typical lead time in days for orders
|
|
32
|
+
*/
|
|
33
|
+
leadTimeDays: number;
|
|
34
|
+
/**
|
|
35
|
+
* Minimum order amount required
|
|
36
|
+
*/
|
|
37
|
+
minimumOrderAmount: number;
|
|
38
|
+
/**
|
|
39
|
+
* Payment terms for this vendor (e.g., "Net 60")
|
|
40
|
+
*/
|
|
41
|
+
paymentTerms: string;
|
|
42
|
+
/**
|
|
43
|
+
* Default currency for transactions with this vendor
|
|
44
|
+
*/
|
|
45
|
+
currency: string;
|
|
46
|
+
/**
|
|
47
|
+
* Default contact email for orders
|
|
48
|
+
*/
|
|
49
|
+
defaultContactEmail: string;
|
|
50
|
+
/**
|
|
51
|
+
* Default contact phone for orders
|
|
52
|
+
*/
|
|
53
|
+
defaultContactPhone: string;
|
|
54
|
+
/**
|
|
55
|
+
* Vendor status
|
|
56
|
+
*/
|
|
57
|
+
status: VendorStatus;
|
|
58
|
+
/**
|
|
59
|
+
* Internal notes about this vendor
|
|
60
|
+
*/
|
|
61
|
+
notes: string;
|
|
62
|
+
/**
|
|
63
|
+
* Per-currency payout destinations for this vendor.
|
|
64
|
+
*
|
|
65
|
+
* Stored as a JSON column. Keys are payout-rail-qualified currency codes —
|
|
66
|
+
* the code must encode both the asset and the rail (e.g. `USDC-base`,
|
|
67
|
+
* `USDC-solana`, `BTC`, `USD-stripe`, `USD-wire`). Values are whatever the
|
|
68
|
+
* receiving rail needs as a destination (EVM address, BTC address, Stripe
|
|
69
|
+
* Connect account id, IBAN, etc.).
|
|
70
|
+
*
|
|
71
|
+
* MVP shape: a flat map on the vendor row. A vendor with no entry for a
|
|
72
|
+
* given currency cannot be paid in that currency — filtering is the
|
|
73
|
+
* consumer's responsibility (the upstream `PaymentIntent` builder filters
|
|
74
|
+
* `paymentOptions` at quote time against this map).
|
|
75
|
+
*
|
|
76
|
+
* Use {@link getPayoutAddress} for a `Map.get`-style lookup that returns
|
|
77
|
+
* `undefined` for missing entries; direct property access is also fine.
|
|
78
|
+
*
|
|
79
|
+
* Sensitive (#1540): payout destinations are excluded from generated API/MCP
|
|
80
|
+
* responses and rejected as a `where` filter key.
|
|
81
|
+
*/
|
|
82
|
+
payoutAddresses: Record<string, string>;
|
|
83
|
+
constructor(options?: any);
|
|
84
|
+
/**
|
|
85
|
+
* The framework's {@link SmrtObject.initialize} re-applies `options` keys on
|
|
86
|
+
* top of constructor-set values so option data always wins over field
|
|
87
|
+
* initializers. That means our constructor's normalization runs *before*
|
|
88
|
+
* `initializePropertiesFromOptions` overwrites `payoutAddresses` with the
|
|
89
|
+
* raw cloned value. Re-normalize once super has finished so consumers
|
|
90
|
+
* who pass a string, a partially-typed map, or `null` end up with a
|
|
91
|
+
* clean `Record<string, string>` before any save / read happens.
|
|
92
|
+
*/
|
|
93
|
+
initialize(): Promise<this>;
|
|
94
|
+
/**
|
|
95
|
+
* Save with a final normalization pass so direct field assignments
|
|
96
|
+
* (`vendor.payoutAddresses = somethingFunny`) can't smuggle non-string
|
|
97
|
+
* values into the persisted row.
|
|
98
|
+
*/
|
|
99
|
+
save(): Promise<this>;
|
|
100
|
+
/**
|
|
101
|
+
* Check if vendor is active
|
|
102
|
+
*/
|
|
103
|
+
isActive(): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Check if order meets minimum requirements
|
|
106
|
+
*/
|
|
107
|
+
meetsMinimumOrder(amount: number): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Get the profile ID for external lookup.
|
|
110
|
+
*
|
|
111
|
+
* To get the actual Profile object, use the ProfileCollection from smrt-profiles:
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const profiles = await ProfileCollection.create(options);
|
|
114
|
+
* const profile = await profiles.get({ id: vendor.profileId });
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @returns The profile ID or empty string if not set
|
|
118
|
+
*/
|
|
119
|
+
getProfileId(): string;
|
|
120
|
+
/**
|
|
121
|
+
* Look up the payout destination for a single currency. Returns
|
|
122
|
+
* `undefined` if the vendor has no entry for that currency — caller's
|
|
123
|
+
* job to decide whether that means "skip the option" or "raise a
|
|
124
|
+
* configuration error". The lookup is case-sensitive; the contract is
|
|
125
|
+
* that the currency code passed in matches exactly what was stored
|
|
126
|
+
* (`USDC-base`, not `usdc-base`).
|
|
127
|
+
*/
|
|
128
|
+
getPayoutAddress(currency: string): string | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* Set the payout destination for a single currency. Mutates the live
|
|
131
|
+
* map and returns `this` for chaining. Use {@link clearPayoutAddress}
|
|
132
|
+
* to remove a single entry.
|
|
133
|
+
*/
|
|
134
|
+
setPayoutAddress(currency: string, destination: string): this;
|
|
135
|
+
/**
|
|
136
|
+
* Remove a single currency entry from the payout map. No-op if the
|
|
137
|
+
* currency was already absent.
|
|
138
|
+
*/
|
|
139
|
+
clearPayoutAddress(currency: string): this;
|
|
140
|
+
/**
|
|
141
|
+
* Normalize an input value (object, pre-serialized JSON string, or
|
|
142
|
+
* `null`/`undefined`) into a plain `Record<string, string>`. Used by
|
|
143
|
+
* the constructor so consumers can pass either shape into
|
|
144
|
+
* `VendorCollection.create({ payoutAddresses: ... })`.
|
|
145
|
+
*
|
|
146
|
+
* Non-string values inside an input object are silently dropped — a
|
|
147
|
+
* `Record<string, string>` invariant is what consumers downstream
|
|
148
|
+
* (`PaymentIntent` builders, payout SDK adapters) rely on.
|
|
149
|
+
*/
|
|
150
|
+
private static normalizePayoutAddresses;
|
|
151
|
+
}
|
|
152
|
+
export default Vendor;
|
|
153
|
+
//# sourceM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AG,SAAS;IAOtD;;;;OAIG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IAQ7D;;;OAGG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAU1C;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;CAqBxC;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model exports for smrt-commerce
|
|
3
|
+
* @packageDocumentation
|
|
4
|
+
*/
|
|
5
|
+
export { Agreement, Cart, Contract, Estimate, Lease, type LicenseRightsSnapshot, LicenseSale, Order, ProductionOrder, PurchaseOrder, WholesaleOrder, } from './Contract.js';
|
|
6
|
+
export { ContractLineItem } from './ContractLineItem.js';
|
|
7
|
+
export { Customer } from './Customer.js';
|
|
8
|
+
export { Fulfillment } from './Fulfillment.js';
|
|
9
|
+
export { FulfillmentLineItem } from './FulfillmentLineItem.js';
|
|
10
|
+
export { Invoice } from './Invoice.js';
|
|
11
|
+
export { InvoiceLineItem } from './InvoiceLineItem.js';
|
|
12
|
+
export { Payment } from './Payment.js';
|
|
13
|
+
export { PaymentAllocation } from './PaymentAllocation.js';
|
|
14
|
+
export { PaymentIntent } from './PaymentIntent.js';
|
|
15
|
+
export { Payout } from './Payout.js';
|
|
16
|
+
export { Vendor } from './Vendor.js';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,KAAK,qBAAqB,EAC1B,WAAW,EACX,KAAK,EACL,eAAe,EACf,aAAa,EACb,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { COMMERCE_MODULE_META } from "./ui.js";
|
|
2
|
+
const noop = () => {
|
|
3
|
+
};
|
|
4
|
+
const sampleInvoice = {
|
|
5
|
+
id: "invoice-2026-0142",
|
|
6
|
+
invoiceNumber: "INV-2026-0142",
|
|
7
|
+
status: "sent",
|
|
8
|
+
issueDate: "2026-03-15T00:00:00.000Z",
|
|
9
|
+
dueDate: "2026-03-29T00:00:00.000Z",
|
|
10
|
+
totalAmount: 128450,
|
|
11
|
+
customerName: "Riverstone Newsroom",
|
|
12
|
+
projectName: "Editorial Systems Retainer"
|
|
13
|
+
};
|
|
14
|
+
const sampleUnbilledItems = [
|
|
15
|
+
{
|
|
16
|
+
id: "unbilled-time-1",
|
|
17
|
+
type: "time",
|
|
18
|
+
description: "Governance workflow setup",
|
|
19
|
+
date: "2026-03-12T00:00:00.000Z",
|
|
20
|
+
amount: 42e3,
|
|
21
|
+
category: "Implementation",
|
|
22
|
+
selected: true
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "unbilled-expense-1",
|
|
26
|
+
type: "expense",
|
|
27
|
+
description: "Contributor QA workshop",
|
|
28
|
+
date: "2026-03-14T00:00:00.000Z",
|
|
29
|
+
amount: 18500,
|
|
30
|
+
category: "Training"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "unbilled-time-2",
|
|
34
|
+
type: "time",
|
|
35
|
+
description: "Release validation and docs cleanup",
|
|
36
|
+
date: "2026-03-18T00:00:00.000Z",
|
|
37
|
+
amount: 33950,
|
|
38
|
+
category: "QA"
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
const loadInvoiceActions = () => import("./svelte/components/InvoiceActions.svelte");
|
|
42
|
+
const loadInvoiceCard = () => import("./svelte/components/InvoiceCard.svelte");
|
|
43
|
+
const loadUnbilledItems = () => import("./svelte/components/UnbilledItems.svelte");
|
|
44
|
+
const playground = {
|
|
45
|
+
packageName: "@happyvertical/smrt-commerce",
|
|
46
|
+
displayName: COMMERCE_MODULE_META.displayName,
|
|
47
|
+
description: COMMERCE_MODULE_META.description,
|
|
48
|
+
moduleMeta: COMMERCE_MODULE_META,
|
|
49
|
+
entries: [
|
|
50
|
+
{
|
|
51
|
+
id: "invoice-card",
|
|
52
|
+
title: "Invoice Card",
|
|
53
|
+
description: "Compact invoice summary card used in billing and receivables views.",
|
|
54
|
+
loadComponent: loadInvoiceCard,
|
|
55
|
+
order: 1,
|
|
56
|
+
props: {
|
|
57
|
+
invoice: sampleInvoice,
|
|
58
|
+
currency: "CAD",
|
|
59
|
+
onclick: noop
|
|
60
|
+
},
|
|
61
|
+
modes: {
|
|
62
|
+
mock: {
|
|
63
|
+
label: "Mock"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "invoice-actions",
|
|
69
|
+
title: "Invoice Actions",
|
|
70
|
+
description: "Status-aware billing actions for sending, printing, exporting, and payment confirmation.",
|
|
71
|
+
loadComponent: loadInvoiceActions,
|
|
72
|
+
order: 2,
|
|
73
|
+
props: {
|
|
74
|
+
status: "sent",
|
|
75
|
+
onmarkpaid: noop,
|
|
76
|
+
onprint: noop,
|
|
77
|
+
onexport: noop
|
|
78
|
+
},
|
|
79
|
+
modes: {
|
|
80
|
+
mock: {
|
|
81
|
+
label: "Mock"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: "unbilled-items",
|
|
87
|
+
title: "Unbilled Items",
|
|
88
|
+
description: "Selectable unbilled work list for creating a new invoice from accumulated items.",
|
|
89
|
+
loadComponent: loadUnbilledItems,
|
|
90
|
+
order: 3,
|
|
91
|
+
props: {
|
|
92
|
+
items: sampleUnbilledItems,
|
|
93
|
+
currency: "CAD",
|
|
94
|
+
onselectionchange: noop,
|
|
95
|
+
oncreate: noop
|
|
96
|
+
},
|
|
97
|
+
modes: {
|
|
98
|
+
mock: {
|
|
99
|
+
label: "Mock"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
};
|
|
105
|
+
export {
|
|
106
|
+
playground as default
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=playground.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playground.js","sources":["../src/svelte/playground.ts"],"sourcesContent":["import { COMMERCE_MODULE_META } from '../ui.js';\n\nconst noop = () => {};\n\nconst sampleInvoice = {\n id: 'invoice-2026-0142',\n invoiceNumber: 'INV-2026-0142',\n status: 'sent',\n issueDate: '2026-03-15T00:00:00.000Z',\n dueDate: '2026-03-29T00:00:00.000Z',\n totalAmount: 128450,\n customerName: 'Riverstone Newsroom',\n projectName: 'Editorial Systems Retainer',\n};\n\nconst sampleUnbilledItems = [\n {\n id: 'unbilled-time-1',\n type: 'time',\n description: 'Governance workflow setup',\n date: '2026-03-12T00:00:00.000Z',\n amount: 42000,\n category: 'Implementation',\n selected: true,\n },\n {\n id: 'unbilled-expense-1',\n type: 'expense',\n description: 'Contributor QA workshop',\n date: '2026-03-14T00:00:00.000Z',\n amount: 18500,\n category: 'Training',\n },\n {\n id: 'unbilled-time-2',\n type: 'time',\n description: 'Release validation and docs cleanup',\n date: '2026-03-18T00:00:00.000Z',\n amount: 33950,\n category: 'QA',\n },\n];\n\nconst loadInvoiceActions = () => import('./components/InvoiceActions.svelte');\nconst loadInvoiceCard = () => import('./components/InvoiceCard.svelte');\nconst loadUnbilledItems = () => import('./components/UnbilledItems.svelte');\n\nexport default {\n packageName: '@happyvertical/smrt-commerce',\n displayName: COMMERCE_MODULE_META.displayName,\n description: COMMERCE_MODULE_META.description,\n moduleMeta: COMMERCE_MODULE_META,\n entries: [\n {\n id: 'invoice-card',\n title: 'Invoice Card',\n description:\n 'Compact invoice summary card used in billing and receivables views.',\n loadComponent: loadInvoiceCard,\n order: 1,\n props: {\n invoice: sampleInvoice,\n currency: 'CAD',\n onclick: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'invoice-actions',\n title: 'Invoice Actions',\n description:\n 'Status-aware billing actions for sending, printing, exporting, and payment confirmation.',\n loadComponent: loadInvoiceActions,\n order: 2,\n props: {\n status: 'sent',\n onmarkpaid: noop,\n onprint: noop,\n onexport: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'unbilled-items',\n title: 'Unbilled Items',\n description:\n 'Selectable unbilled work list for creating a new invoice from accumulated items.',\n loadComponent: loadUnbilledItems,\n order: 3,\n props: {\n items: sampleUnbilledItems,\n currency: 'CAD',\n onselectionchange: noop,\n oncreate: noop,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n ],\n};\n"],"names":[],"mappings":";AAEA,MAAM,OAAO,MAAM;AAAC;AAEpB,MAAM,gBAAgB;AAAA,E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