@happyvertical/smrt-commerce 0.55.23 → 0.56.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 +9 -9
- package/README.md +75 -4
- package/agents/customer-vendor-ui.md +61 -2
- package/agents/purchasing-ui.md +4 -3
- package/agents/quote-ui.md +3 -2
- package/dist/chunks/types-zVnIjSOk.js.map +1 -1
- package/dist/collections/ContractCollection.d.ts +2 -0
- package/dist/collections/ContractCollection.d.ts.map +1 -1
- package/dist/collections/PurchaseContractCollection.d.ts +8 -0
- package/dist/collections/PurchaseContractCollection.d.ts.map +1 -0
- package/dist/collections/SalesContractCollection.d.ts +8 -0
- package/dist/collections/SalesContractCollection.d.ts.map +1 -0
- package/dist/collections/index.d.ts +2 -0
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +502 -88
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +2253 -847
- package/dist/migrations/partyLinks.d.ts +39 -0
- package/dist/migrations/partyLinks.d.ts.map +1 -0
- package/dist/models/Contract.d.ts +37 -27
- package/dist/models/Contract.d.ts.map +1 -1
- package/dist/models/ContractLineItem.d.ts.map +1 -1
- package/dist/models/Customer.d.ts +13 -1
- package/dist/models/Customer.d.ts.map +1 -1
- package/dist/models/Invoice.d.ts.map +1 -1
- package/dist/models/InvoiceLineItem.d.ts.map +1 -1
- package/dist/models/PaymentAllocation.d.ts.map +1 -1
- package/dist/models/Vendor.d.ts +6 -1
- package/dist/models/Vendor.d.ts.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/party-contacts.d.ts +146 -0
- package/dist/party-contacts.d.ts.map +1 -0
- package/dist/recipes.d.ts +2 -32
- package/dist/recipes.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +967 -365
- package/dist/svelte/components/CustomerDetail.svelte +16 -5
- package/dist/svelte/components/CustomerDetail.svelte.d.ts +5 -0
- package/dist/svelte/components/CustomerDetail.svelte.d.ts.map +1 -1
- package/dist/svelte/components/CustomerDirectory.svelte +16 -5
- package/dist/svelte/components/CustomerDirectory.svelte.d.ts +5 -0
- package/dist/svelte/components/CustomerDirectory.svelte.d.ts.map +1 -1
- package/dist/svelte/components/CustomerForm.svelte +23 -0
- package/dist/svelte/components/CustomerForm.svelte.d.ts +9 -2
- package/dist/svelte/components/CustomerForm.svelte.d.ts.map +1 -1
- package/dist/svelte/components/PartyContactFields.svelte +4 -0
- package/dist/svelte/components/PartyContactFields.svelte.d.ts.map +1 -1
- package/dist/svelte/components/VendorDetail.svelte +16 -5
- package/dist/svelte/components/VendorDetail.svelte.d.ts +5 -0
- package/dist/svelte/components/VendorDetail.svelte.d.ts.map +1 -1
- package/dist/svelte/components/VendorDirectory.svelte +16 -5
- package/dist/svelte/components/VendorDirectory.svelte.d.ts +5 -0
- package/dist/svelte/components/VendorDirectory.svelte.d.ts.map +1 -1
- package/dist/svelte/components/VendorForm.svelte +23 -0
- package/dist/svelte/components/VendorForm.svelte.d.ts +9 -2
- package/dist/svelte/components/VendorForm.svelte.d.ts.map +1 -1
- package/dist/svelte/index.d.ts +1 -1
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/party-types.d.ts +15 -1
- package/dist/svelte/party-types.d.ts.map +1 -1
- package/dist/svelte/party-types.js +1 -0
- package/dist/types/index.d.ts +25 -4
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Read-only deployment preflight for the Contract party split (#3898). */
|
|
2
|
+
import type { DatabaseInterface } from '@happyvertical/smrt-core/migrations';
|
|
3
|
+
export interface CommercePartyLinkRow {
|
|
4
|
+
id: string;
|
|
5
|
+
tenant_id: string | null;
|
|
6
|
+
_meta_type: string | null;
|
|
7
|
+
contract_type: string | null;
|
|
8
|
+
customer_id: string | null;
|
|
9
|
+
vendor_id: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface CommerceContractTypeGroup {
|
|
12
|
+
_meta_type: string | null;
|
|
13
|
+
contract_type: string | null;
|
|
14
|
+
count: number;
|
|
15
|
+
}
|
|
16
|
+
/** Existing document whose contract link will fail branch validation on save. */
|
|
17
|
+
export interface CommerceInvalidContractReference {
|
|
18
|
+
source_table: string;
|
|
19
|
+
source_id: string;
|
|
20
|
+
source_tenant_id: string | null;
|
|
21
|
+
contract_id: string;
|
|
22
|
+
contract_meta_type: string | null;
|
|
23
|
+
contract_tenant_id: string | null;
|
|
24
|
+
}
|
|
25
|
+
export interface CommercePartyLinksPreflight {
|
|
26
|
+
purchaseRowsWithCustomer: CommercePartyLinkRow[];
|
|
27
|
+
salesRowsWithVendor: CommercePartyLinkRow[];
|
|
28
|
+
missingRequiredCustomer: CommercePartyLinkRow[];
|
|
29
|
+
missingRequiredVendor: CommercePartyLinkRow[];
|
|
30
|
+
baseTypedRows: CommercePartyLinkRow[];
|
|
31
|
+
unqualifiedDiscriminatorRows: CommercePartyLinkRow[];
|
|
32
|
+
discriminatorGroups: CommerceContractTypeGroup[];
|
|
33
|
+
discriminatorMismatches: CommerceContractTypeGroup[];
|
|
34
|
+
invalidSalesReferences: CommerceInvalidContractReference[];
|
|
35
|
+
invalidPurchaseReferences: CommerceInvalidContractReference[];
|
|
36
|
+
}
|
|
37
|
+
/** Inspect existing party links before deploying the new STI hierarchy. Never writes. */
|
|
38
|
+
export declare function preflightCommercePartyLinks(db: DatabaseInterface): Promise<CommercePartyLinksPreflight>;
|
|
39
|
+
//# sourceMappingURL=partyLinks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"partyLinks.d.ts","sourceRoot":"","sources":["../../src/migrations/partyLinks.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAG3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM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3
|
* @packageDocumentation
|
|
4
4
|
*/
|
|
5
5
|
import { type Meta, SmrtObject } from '@happyvertical/smrt-core';
|
|
6
|
-
import { type ContractOptions, ContractStatus, ContractType, type LicenseSaleOptions, type PurchaseOrderOptions } from '../types/index.js';
|
|
6
|
+
import { type ContractOptions, ContractStatus, ContractType, type LicenseSaleOptions, type PurchaseContractOptions, type PurchaseOrderOptions, type SalesContractOptions } from '../types/index.js';
|
|
7
7
|
/**
|
|
8
8
|
* Contract is the base class for all commercial agreements.
|
|
9
9
|
*
|
|
10
|
-
* Uses Single Table Inheritance (STI)
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* - Agreement: Service/maintenance agreement
|
|
15
|
-
* - PurchaseOrder: Order to vendor/supplier
|
|
10
|
+
* Uses Single Table Inheritance (STI) for nine leaf types. SalesContract owns
|
|
11
|
+
* the customer link for Estimate, Order, WholesaleOrder, Cart, Lease,
|
|
12
|
+
* Agreement, and LicenseSale. PurchaseContract owns the vendor link for
|
|
13
|
+
* PurchaseOrder and ProductionOrder. Both branches share `contracts`.
|
|
16
14
|
*
|
|
17
15
|
* @example
|
|
18
16
|
* ```typescript
|
|
@@ -47,14 +45,6 @@ export declare class Contract extends SmrtObject {
|
|
|
47
45
|
* Current status of the contract
|
|
48
46
|
*/
|
|
49
47
|
status: ContractStatus;
|
|
50
|
-
/**
|
|
51
|
-
* Customer ID (for sales contracts: Estimate, Order, Agreement)
|
|
52
|
-
*/
|
|
53
|
-
customerId: string | null;
|
|
54
|
-
/**
|
|
55
|
-
* Vendor ID (for purchase contracts: PurchaseOrder)
|
|
56
|
-
*/
|
|
57
|
-
vendorId: string | null;
|
|
58
48
|
/**
|
|
59
49
|
* Subtotal before tax, in **integer minor units** (cents, satoshis).
|
|
60
50
|
*
|
|
@@ -179,34 +169,53 @@ export declare class Contract extends SmrtObject {
|
|
|
179
169
|
*/
|
|
180
170
|
protected resolvePriorStatus(): Promise<ContractStatus | undefined>;
|
|
181
171
|
}
|
|
172
|
+
/** Customer-side contracts, including orders, estimates, and licenses. */
|
|
173
|
+
export declare abstract class SalesContract extends Contract {
|
|
174
|
+
customerId: string | null;
|
|
175
|
+
constructor(options?: SalesContractOptions);
|
|
176
|
+
}
|
|
177
|
+
/** Supplier-side contracts, including purchase and production orders. */
|
|
178
|
+
export declare abstract class PurchaseContract extends Contract {
|
|
179
|
+
vendorId: string | null;
|
|
180
|
+
constructor(options?: PurchaseContractOptions);
|
|
181
|
+
}
|
|
182
182
|
/**
|
|
183
183
|
* Estimate - Quote or proposal for a customer
|
|
184
184
|
*/
|
|
185
|
-
export declare class Estimate extends
|
|
185
|
+
export declare class Estimate extends SalesContract {
|
|
186
|
+
customerId: string | null;
|
|
186
187
|
contractType: ContractType;
|
|
188
|
+
constructor(options?: SalesContractOptions);
|
|
187
189
|
}
|
|
188
190
|
/**
|
|
189
191
|
* Order - Customer purchase order
|
|
190
192
|
*/
|
|
191
|
-
export declare class Order extends
|
|
193
|
+
export declare class Order extends SalesContract {
|
|
194
|
+
customerId: string | null;
|
|
192
195
|
contractType: ContractType;
|
|
196
|
+
constructor(options?: SalesContractOptions);
|
|
193
197
|
}
|
|
194
198
|
/**
|
|
195
199
|
* Lease - Rental or lease agreement
|
|
196
200
|
*/
|
|
197
|
-
export declare class Lease extends
|
|
201
|
+
export declare class Lease extends SalesContract {
|
|
202
|
+
customerId: string | null;
|
|
198
203
|
contractType: ContractType;
|
|
204
|
+
constructor(options?: SalesContractOptions);
|
|
199
205
|
}
|
|
200
206
|
/**
|
|
201
207
|
* Agreement - Service or maintenance agreement
|
|
202
208
|
*/
|
|
203
|
-
export declare class Agreement extends
|
|
209
|
+
export declare class Agreement extends SalesContract {
|
|
210
|
+
customerId: string | null;
|
|
204
211
|
contractType: ContractType;
|
|
212
|
+
constructor(options?: SalesContractOptions);
|
|
205
213
|
}
|
|
206
214
|
/**
|
|
207
215
|
* PurchaseOrder - Order sent to vendor/supplier
|
|
208
216
|
*/
|
|
209
|
-
export declare class PurchaseOrder extends
|
|
217
|
+
export declare class PurchaseOrder extends PurchaseContract {
|
|
218
|
+
vendorId: string | null;
|
|
210
219
|
contractType: ContractType;
|
|
211
220
|
/** Expected delivery calendar date (YYYY-MM-DD), or empty when unspecified. */
|
|
212
221
|
expectedDate: Meta<string>;
|
|
@@ -222,8 +231,10 @@ export declare class PurchaseOrder extends Contract {
|
|
|
222
231
|
* `customerType: 'wholesale'`, uses NET-30/60 payment terms, and is delivered
|
|
223
232
|
* via the wholesale-portal channel rather than retail checkout.
|
|
224
233
|
*/
|
|
225
|
-
export declare class WholesaleOrder extends
|
|
234
|
+
export declare class WholesaleOrder extends SalesContract {
|
|
235
|
+
customerId: string | null;
|
|
226
236
|
contractType: ContractType;
|
|
237
|
+
constructor(options?: SalesContractOptions);
|
|
227
238
|
}
|
|
228
239
|
/**
|
|
229
240
|
* ProductionOrder - instruction to commission goods from an internal or
|
|
@@ -251,7 +262,7 @@ export declare class WholesaleOrder extends Contract {
|
|
|
251
262
|
* shared `_meta_data` JSON column on the Contract STI table instead of
|
|
252
263
|
* widening the base schema with manufacturing-specific columns.
|
|
253
264
|
*/
|
|
254
|
-
export declare class ProductionOrder extends
|
|
265
|
+
export declare class ProductionOrder extends PurchaseContract {
|
|
255
266
|
contractType: ContractType;
|
|
256
267
|
/**
|
|
257
268
|
* Plain string reference to the upstream product the order is asked
|
|
@@ -277,11 +288,10 @@ export declare class ProductionOrder extends Contract {
|
|
|
277
288
|
*
|
|
278
289
|
* A Cart starts in {@link ContractStatus.DRAFT} via the base `Contract.status`
|
|
279
290
|
* default — the subclass doesn't need its own override. Application code
|
|
280
|
-
* is responsible for
|
|
281
|
-
*
|
|
282
|
-
* machine on the cart → order transition.
|
|
291
|
+
* is responsible for assigning the appropriate Order status at checkout;
|
|
292
|
+
* the framework doesn't enforce a state machine on the cart → order transition.
|
|
283
293
|
*/
|
|
284
|
-
export declare class Cart extends
|
|
294
|
+
export declare class Cart extends SalesContract {
|
|
285
295
|
contractType: ContractType;
|
|
286
296
|
}
|
|
287
297
|
/**
|
|
@@ -334,7 +344,7 @@ export interface LicenseRightsSnapshot {
|
|
|
334
344
|
* the `contracts` STI table — no migration of the base schema needed
|
|
335
345
|
* to land this subtype.
|
|
336
346
|
*/
|
|
337
|
-
export declare class LicenseSale extends
|
|
347
|
+
export declare class LicenseSale extends SalesContract {
|
|
338
348
|
contractType: ContractType;
|
|
339
349
|
/**
|
|
340
350
|
* Plain string reference to the upstream `Sku` (from
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contract.d.ts","sourceRoot":"","sources":["../../src/models/Contract.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGL,KAAK,IAAI,EACT,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,KAAK,eAAe,EACpB,cAAc,EACd,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AA2C3B
|
|
1
|
+
{"version":3,"file":"Contract.d.ts","sourceRoot":"","sources":["../../src/models/Contract.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGL,KAAK,IAAI,EACT,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,KAAK,eAAe,EACpB,cAAc,EACd,YAAY,EACZ,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AA2C3B;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAOa,QAAS,SAAQ,UAAU;IACtC;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAKH,YAAY,EAAE,YAAY,CAAsB;IAEhD;;OAEG;IAKH,MAAM,EAAE,cAAc,CAAwB;IAE9C;;;;;;;OAOG;IAEH,QAAQ,EAAE,MAAM,CAAK;IAErB;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d.ts","sourceRoot":"","sources":["../../src/models/ContractLineItem.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAEjE;;;;;;;;;;;;;;;;GAgBG;AACH,qBAOa,gBAAiB,SAAQ,UAAU;IAC9C;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAGH,UAAU,EAAE,MAAM,CAAM;IAExB;;OAEG;IAEH,WAAW,EAAE,MAAM,CAAM;IAEzB;;;OAGG;IAEH,QAAQ,EAAE,MAAM,CAAO;IAEvB;;;;;;OAMG;IAKH,SAAS,EAAE,MAAM,CAAK;IAEtB;;OAEG;IAEH,QAAQ,EAAE,MAAM,CAAK;IAErB;;;OAGG;IAIH,OAAO,EAAE,MAAM,CAAO;IAEtB;;;;OAIG;IAEH,MAAM,EAAE,MAAM,CAAK;IAEnB;;OAEG;IAKH,SAAS,EAAE,MAAM,CAAM;IAEvB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAM;IAEjB;;OAEG;IACH,SAAS,EAAE,IAAI,GAAG,IAAI,CAAQ;IAE9B;;OAEG;IACH,OAAO,EAAE,IAAI,GAAG,IAAI,CAAQ;IAE5B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAM;IAE3B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAK;gBAEV,OAAO,GAAE,uBAA4B;IAoBjD;;;;;;;;OAQG;IACH,eAAe,IAAI,MAAM;IAMzB;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,oBAAoB,IAAI,OAAO;CAUhC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @packageDocumentation
|
|
4
4
|
*/
|
|
5
5
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
6
|
-
import { type Address, type CustomerOptions, CustomerStatus, CustomerType } from '../types/index.js';
|
|
6
|
+
import { type Address, type CustomerOptions, CustomerStatus, CustomerType, type PartyContact } from '../types/index.js';
|
|
7
7
|
/**
|
|
8
8
|
* Customer represents the customer role for a Profile.
|
|
9
9
|
*
|
|
@@ -78,7 +78,19 @@ export declare class Customer extends SmrtObject {
|
|
|
78
78
|
* Internal notes about this customer
|
|
79
79
|
*/
|
|
80
80
|
notes: string;
|
|
81
|
+
/**
|
|
82
|
+
* People to reach at this customer, stored as a JSON column (#3501). Write
|
|
83
|
+
* form rows through `savePartyContacts()`; every save normalizes the shape.
|
|
84
|
+
*/
|
|
85
|
+
contacts: PartyContact[];
|
|
81
86
|
constructor(options?: CustomerOptions);
|
|
87
|
+
/**
|
|
88
|
+
* Re-normalize contacts after the framework's option-override pass, which
|
|
89
|
+
* re-applies raw option values (including a stored JSON string).
|
|
90
|
+
*/
|
|
91
|
+
initialize(): Promise<this>;
|
|
92
|
+
/** Save with a final contacts normalization against direct assignment. */
|
|
93
|
+
save(): Promise<this>;
|
|
82
94
|
/**
|
|
83
95
|
* Convenience predicate: is this a wholesale customer?
|
|
84
96
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Customer.d.ts","sourceRoot":"","sources":["../../src/models/Customer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGL,UAAU,EAEX,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"Customer.d.ts","sourceRoot":"","sources":["../../src/models/Customer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,cAAc,EACd,YAAY,EACZ,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;GAcG;AACH,qBAMa,QAAS,SAAQ,UAAU;IACtC;;;OAGG;IAEH,QAAQ,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,iBAAiB,IAAI,OAAO,CAAC,sBAAsB,CAAC;CAsC3D;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvoiceLineItem.d.ts","sourceRoot":"","sources":["../../src/models/InvoiceLineItem.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EAEtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAMa,eAAgB,SAAQ,UAAU;IAC7C;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAGH,SAAS,EAAE,MAAM,CAAM;IAEvB;;OAEG;IAEH,WAAW,EAAE,MAAM,CAAM;IAEzB;;OAEG;IACH,GAAG,EAAE,MAAM,CAAM;IAEjB,wFAAwF;IAExF,QAAQ,EAAE,MAAM,CAAO;IAEvB,2FAA2F;IAC3F,sBAAsB,EAAE,MAAM,CAAM;IAEpC,gFAAgF;IAChF,IAAI,kBAAkB,IAAI,sBAAsB,GAAG,IAAI,CAkBtD;IAED,2EAA2E;IAC3E,IAAI,kBAAkB,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,EAE1D;IAED;;;;;;OAMG;
|
|
1
|
+
{"version":3,"file":"InvoiceLineItem.d.ts","sourceRoot":"","sources":["../../src/models/InvoiceLineItem.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAIL,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EAEtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACV,uBAAuB,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AAE,gBAAgB,EACvB,OAAO,EAAE,yBAAyB,GACjC,IAAI;IAMP,kGAAkG;IAClG,cAAc,CACZ,iBAAiB,EAAE,yBAAyB,GAC3C,gBAAgB,GAAG,IAAI;IA0B1B,gHAAgH;IACjG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAWpC;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;;;;;OAMG;IACH,oBAAoB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,uBAAuB;CAejE;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaymentAllocation.d.ts","sourceRoot":"","sources":["../../src/models/PaymentAllocation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAqB,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAI/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAYlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAoBa,iBAAkB,SAAQ,UAAU;IAC/C;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAGH,SAAS,EAAE,MAAM,CAAM;IAEvB;;OAEG;IAGH,SAAS,EAAE,MAAM,CAAM;IAEvB;;;;;;;;;OASG;
|
|
1
|
+
{"version":3,"file":"PaymentAllocation.d.ts","sourceRoot":"","sources":["../../src/models/PaymentAllocation.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAqB,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAI/E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAYlE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBAoBa,iBAAkB,SAAQ,UAAU;IAC/C;;;OAGG;IAEH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE/B;;OAEG;IAGH,SAAS,EAAE,MAAM,CAAM;IAEvB;;OAEG;IAGH,SAAS,EAAE,MAAM,CAAM;IAEvB;;;;;;;;;OASG;IAKH,MAAM,EAAE,MAAM,CAAK;IAEnB;;OAEG;IAEH,WAAW,EAAE,IAAI,CAAc;IAE/B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAM;IAEzB;;OAEG;IAEH,KAAK,EAAE,MAAM,CAAM;gBAEP,OAAO,GAAE,wBAA6B;IAalD,6EAA6E;IAC9D,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAgFrC;AAED,eAAe,iBAAiB,CAAC"}
|
package/dist/models/Vendor.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @packageDocumentation
|
|
4
4
|
*/
|
|
5
5
|
import { SmrtObject } from '@happyvertical/smrt-core';
|
|
6
|
-
import { type VendorOptions, VendorStatus } from '../types/index.js';
|
|
6
|
+
import { type PartyContact, type VendorOptions, VendorStatus } from '../types/index.js';
|
|
7
7
|
/**
|
|
8
8
|
* Vendor represents the vendor/supplier role for a Profile.
|
|
9
9
|
*
|
|
@@ -86,6 +86,11 @@ export declare class Vendor extends SmrtObject {
|
|
|
86
86
|
* responses and rejected as a `where` filter key.
|
|
87
87
|
*/
|
|
88
88
|
payoutAddresses: Record<string, string>;
|
|
89
|
+
/**
|
|
90
|
+
* People to reach at this vendor, stored as a JSON column (#3501). Write
|
|
91
|
+
* form rows through `savePartyContacts()`; every save normalizes the shape.
|
|
92
|
+
*/
|
|
93
|
+
contacts: PartyContact[];
|
|
89
94
|
constructor(options?: VendorOptions);
|
|
90
95
|
/**
|
|
91
96
|
* The framework's {@link SmrtObject.initialize} re-applies `options` keys on
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Vendor.d.ts","sourceRoot":"","sources":["../../src/models/Vendor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO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ACH,YAAY,IAAI,MAAM;IAItB;;;;;;;OAOG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,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"}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @packageDocumentation
|
|
4
4
|
*/
|
|
5
5
|
export { BillingAccount, type BillingCloseKind, BillingLineSource, type BillingLineSourceType, BillingPaymentAttempt, type BillingPaymentAttemptFlag, type BillingPaymentAttemptPurpose, type BillingPaymentAttemptTransition, BillingPeriodClose, type BillingPeriodCloseStatus, type BillingStanding, } from './billing.js';
|
|
6
|
-
export { Agreement, Cart, Contract, Estimate, Lease, type LicenseRightsSnapshot, LicenseSale, Order, ProductionOrder, PurchaseOrder, WholesaleOrder, } from './Contract.js';
|
|
6
|
+
export { Agreement, Cart, Contract, Estimate, Lease, type LicenseRightsSnapshot, LicenseSale, Order, ProductionOrder, PurchaseContract, PurchaseOrder, SalesContract, WholesaleOrder, } from './Contract.js';
|
|
7
7
|
export { ContractLineItem } from './ContractLineItem.js';
|
|
8
8
|
export { Customer } from './Customer.js';
|
|
9
9
|
export { Fulfillment } from './Fulfillment.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,cAAc,EACd,KAAK,gBAAgB,EACrB,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,qBAAqB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KA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,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,KAAK,qBAAqB,EAC1B,WAAW,EACX,KAAK,EACL,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,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,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,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contact rows for customers and vendors (#3501).
|
|
3
|
+
*
|
|
4
|
+
* `CustomerForm` and `VendorForm` (`./svelte`) post contacts as repeated
|
|
5
|
+
* field names in DOM order, one value per row for each of `contactId`,
|
|
6
|
+
* `contactName`, `contactLabel`, `contactEmail`, `contactPhone`, and
|
|
7
|
+
* `contactAddress` (all overridable through the forms' `fieldNames`). The
|
|
8
|
+
* helpers here read that payload, apply the native add/remove intents, and
|
|
9
|
+
* write the rows to `Customer.contacts` / `Vendor.contacts`.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import type { CustomerCollection } from './collections/CustomerCollection.js';
|
|
14
|
+
import type { VendorCollection } from './collections/VendorCollection.js';
|
|
15
|
+
import type { PartyContact } from './types/index.js';
|
|
16
|
+
/** One submitted contact row, exactly as posted (untrimmed strings). */
|
|
17
|
+
export type PartyContactInput = Partial<PartyContact>;
|
|
18
|
+
/** The text fields of a contact, which are also its error keys. */
|
|
19
|
+
export type PartyContactField = Exclude<keyof PartyContact, 'id'>;
|
|
20
|
+
/** HTML names of the repeated contact fields; defaults match the forms. */
|
|
21
|
+
export interface PartyContactFieldNames {
|
|
22
|
+
contactId: string;
|
|
23
|
+
contactName: string;
|
|
24
|
+
contactLabel: string;
|
|
25
|
+
contactEmail: string;
|
|
26
|
+
contactPhone: string;
|
|
27
|
+
contactAddress: string;
|
|
28
|
+
/** Hidden presence marker: the number of contact rows the form rendered. */
|
|
29
|
+
contactCount: string;
|
|
30
|
+
}
|
|
31
|
+
/** Default contact field names, matching `DEFAULT_PARTY_FIELD_NAMES` in `./svelte`. */
|
|
32
|
+
export declare const DEFAULT_PARTY_CONTACT_FIELD_NAMES: PartyContactFieldNames;
|
|
33
|
+
/** Maximum lengths, matching the form controls' `maxlength`. */
|
|
34
|
+
export declare const PARTY_CONTACT_MAX_LENGTHS: Readonly<Record<PartyContactField, number>>;
|
|
35
|
+
/**
|
|
36
|
+
* Per-row validation error codes, keyed by field. `unknown_contact` (on
|
|
37
|
+
* `id`) means the posted id is not one of the party's saved contacts — a
|
|
38
|
+
* stale or altered form; reload the party and show its current rows.
|
|
39
|
+
*/
|
|
40
|
+
export type PartyContactErrorCode = 'too_long' | 'invalid_email' | 'unknown_contact';
|
|
41
|
+
/** Errors for one submitted row; indexes match the submitted rows. */
|
|
42
|
+
export type PartyContactRowErrors = Partial<Record<PartyContactField | 'id', PartyContactErrorCode>>;
|
|
43
|
+
/** Thrown by {@link savePartyContacts} when any row is invalid; nothing is written. */
|
|
44
|
+
export declare class PartyContactValidationError extends Error {
|
|
45
|
+
/** Errors aligned with the submitted rows; `undefined` for a valid row. */
|
|
46
|
+
readonly errors: Array<PartyContactRowErrors | undefined>;
|
|
47
|
+
constructor(errors: Array<PartyContactRowErrors | undefined>);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Thrown by {@link readPartyContactRows} (and so {@link savePartyContacts}
|
|
51
|
+
* given a form) when the posted contact payload cannot be trusted:
|
|
52
|
+
* `missing` — no `contactCount` marker, so the editable contact block did
|
|
53
|
+
* not render or was posted under other field names (treating that as "no
|
|
54
|
+
* contacts" would delete them all); `misaligned` — the repeated fields or
|
|
55
|
+
* the marker disagree on the row count. Nothing is written.
|
|
56
|
+
*/
|
|
57
|
+
export declare class PartyContactPayloadError extends Error {
|
|
58
|
+
readonly reason: 'missing' | 'misaligned';
|
|
59
|
+
constructor(reason: 'missing' | 'misaligned', message: string);
|
|
60
|
+
}
|
|
61
|
+
/** Thrown by {@link savePartyContacts} when the party is not visible in the current tenant. */
|
|
62
|
+
export declare class PartyContactPartyNotFoundError extends Error {
|
|
63
|
+
constructor(partyId: string);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Normalize stored contacts (an array, a JSON string, or nothing) into
|
|
67
|
+
* well-formed {@link PartyContact} rows. Non-object entries and non-string
|
|
68
|
+
* values are dropped; a row without an id is given one.
|
|
69
|
+
*/
|
|
70
|
+
export declare function normalizePartyContacts(value: unknown): PartyContact[];
|
|
71
|
+
/** Minimal form-data reader; `FormData` and `URLSearchParams` both satisfy it. */
|
|
72
|
+
export interface PartyContactFormSource {
|
|
73
|
+
getAll(name: string): unknown[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Read the contact rows a party form posted, in DOM order. The editable
|
|
77
|
+
* contact block always posts a `contactCount` marker with its row count, and
|
|
78
|
+
* every row renders all six fields. A missing marker (the block did not
|
|
79
|
+
* render, or `fieldNames` differ from the form's) or any disagreeing count
|
|
80
|
+
* throws {@link PartyContactPayloadError}, so zero rows is only ever read
|
|
81
|
+
* when the form really posted an empty contact list.
|
|
82
|
+
*/
|
|
83
|
+
export declare function readPartyContactRows(form: PartyContactFormSource, fieldNames?: Partial<PartyContactFieldNames>): PartyContactInput[];
|
|
84
|
+
/** Submitter values for the forms' native contact row actions. */
|
|
85
|
+
export interface PartyContactIntents {
|
|
86
|
+
/** Defaults to the forms' `addContact`. */
|
|
87
|
+
addIntent?: string;
|
|
88
|
+
/** Parses a remove submitter into a row index; defaults to `removeContact:<index>`. */
|
|
89
|
+
parseRemoveIntent?: (intent: string) => number | undefined;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Apply an add or remove submitter to the posted rows and return the rows
|
|
93
|
+
* to render back into the form. Nothing is persisted: a row action is a
|
|
94
|
+
* round trip, and only the save intent writes. `handled` is `false` for any
|
|
95
|
+
* other intent (including save), with the rows unchanged; when it is `true`,
|
|
96
|
+
* render the returned rows and do not save.
|
|
97
|
+
*/
|
|
98
|
+
export declare function applyPartyContactIntent(rows: readonly PartyContactInput[], intent: string, intents?: PartyContactIntents): {
|
|
99
|
+
contacts: PartyContactInput[];
|
|
100
|
+
handled: boolean;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Validate posted rows without persisting them. Returns the trimmed rows
|
|
104
|
+
* that would be written (blank rows dropped) and, when any row is invalid,
|
|
105
|
+
* errors aligned with the submitted rows. Ids are checked against the
|
|
106
|
+
* party's saved contacts only by {@link savePartyContacts}.
|
|
107
|
+
*/
|
|
108
|
+
export declare function validatePartyContactRows(rows: readonly PartyContactInput[]): {
|
|
109
|
+
contacts: PartyContactInput[];
|
|
110
|
+
errors?: Array<PartyContactRowErrors | undefined>;
|
|
111
|
+
};
|
|
112
|
+
/** Options for {@link savePartyContacts}. */
|
|
113
|
+
export interface SavePartyContactsOptions {
|
|
114
|
+
/** Field names used to read a posted form; must match the form's `fieldNames`. */
|
|
115
|
+
fieldNames?: Partial<PartyContactFieldNames>;
|
|
116
|
+
/**
|
|
117
|
+
* When set, the party must belong to this tenant. Use it to bind a form's
|
|
118
|
+
* posted tenant to the loaded row in addition to the active tenant
|
|
119
|
+
* context, which already scopes the lookup.
|
|
120
|
+
*/
|
|
121
|
+
expectedTenantId?: string | null;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Replace a customer's or vendor's contacts with the rows its form posted.
|
|
125
|
+
*
|
|
126
|
+
* Pass the posted `FormData` (with `options.fieldNames` when the form
|
|
127
|
+
* overrides them): it is read with {@link readPartyContactRows}, so a payload
|
|
128
|
+
* without the contact block's presence marker throws
|
|
129
|
+
* {@link PartyContactPayloadError} instead of removing every contact. An
|
|
130
|
+
* array is taken as rows the caller already read through that function.
|
|
131
|
+
*
|
|
132
|
+
* The party is loaded through `collection.get()`, so the active tenant
|
|
133
|
+
* context scopes it: a party in another tenant is not found. Rows are
|
|
134
|
+
* validated ({@link validatePartyContactRows}), blank rows dropped, kept
|
|
135
|
+
* rows matched to saved contacts by id (new rows get a fresh id), and rows
|
|
136
|
+
* that were not posted are removed. A posted id the party does not have is
|
|
137
|
+
* an `unknown_contact` error. On any error nothing is written and a
|
|
138
|
+
* {@link PartyContactValidationError} is thrown.
|
|
139
|
+
*
|
|
140
|
+
* This is a read-modify-write of one row: concurrent saves of the same party
|
|
141
|
+
* are last-writer-wins, like any other field edit.
|
|
142
|
+
*
|
|
143
|
+
* @returns The saved contacts, in submitted order.
|
|
144
|
+
*/
|
|
145
|
+
export declare function savePartyContacts(collection: CustomerCollection | VendorCollection, partyId: string, posted: PartyContactFormSource | readonly PartyContactInput[], options?: SavePartyContactsOptions): Promise<PartyContact[]>;
|
|
146
|
+
//# sourceMappingURL=party-contacts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"party-contacts.d.ts","sourceRoot":"","sources":["../src/party-contacts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAC9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM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B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,kBAAkB,GAAG,gBAAgB,EACjD,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,sBAAsB,GAAG,SAAS,iBAAiB,EAAE,EAC7D,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAAC,YAAY,EAAE,CAAC,CAqDzB"}
|
package/dist/recipes.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import { SmrtRecipe } from '@happyvertical/smrt-core';
|
|
10
|
-
import {
|
|
10
|
+
import { Contract, Estimate, Lease, LicenseSale, Order, PurchaseOrder, WholesaleOrder } from './models/Contract.js';
|
|
11
11
|
import { ContractLineItem } from './models/ContractLineItem.js';
|
|
12
12
|
import { Customer } from './models/Customer.js';
|
|
13
13
|
import { Fulfillment } from './models/Fulfillment.js';
|
|
@@ -77,10 +77,6 @@ export declare class PurchasesRecipe extends SmrtRecipe {
|
|
|
77
77
|
readonly visibility: "hidden";
|
|
78
78
|
readonly locked: true;
|
|
79
79
|
};
|
|
80
|
-
readonly customerId: {
|
|
81
|
-
readonly visibility: "hidden";
|
|
82
|
-
readonly locked: true;
|
|
83
|
-
};
|
|
84
80
|
readonly vendorId: {
|
|
85
81
|
readonly label: "Vendor";
|
|
86
82
|
readonly order: 1;
|
|
@@ -149,14 +145,9 @@ export declare class SalesRecipe extends SmrtRecipe {
|
|
|
149
145
|
readonly visibility: "hidden";
|
|
150
146
|
readonly locked: true;
|
|
151
147
|
};
|
|
152
|
-
readonly vendorId: {
|
|
153
|
-
readonly visibility: "hidden";
|
|
154
|
-
readonly locked: true;
|
|
155
|
-
};
|
|
156
148
|
readonly customerId: {
|
|
157
149
|
readonly label: "Customer";
|
|
158
150
|
readonly order: 1;
|
|
159
|
-
readonly required: true;
|
|
160
151
|
};
|
|
161
152
|
readonly channelId: {
|
|
162
153
|
readonly visibility: "hidden";
|
|
@@ -253,14 +244,9 @@ export declare class EstimatesRecipe extends SmrtRecipe {
|
|
|
253
244
|
readonly visibility: "hidden";
|
|
254
245
|
readonly locked: true;
|
|
255
246
|
};
|
|
256
|
-
readonly vendorId: {
|
|
257
|
-
readonly visibility: "hidden";
|
|
258
|
-
readonly locked: true;
|
|
259
|
-
};
|
|
260
247
|
readonly customerId: {
|
|
261
248
|
readonly label: "Customer";
|
|
262
249
|
readonly order: 1;
|
|
263
|
-
readonly required: true;
|
|
264
250
|
};
|
|
265
251
|
readonly channelId: {
|
|
266
252
|
readonly visibility: "hidden";
|
|
@@ -323,10 +309,6 @@ export declare class WholesaleRecipe extends SmrtRecipe {
|
|
|
323
309
|
readonly visibility: "hidden";
|
|
324
310
|
readonly locked: true;
|
|
325
311
|
};
|
|
326
|
-
readonly vendorId: {
|
|
327
|
-
readonly visibility: "hidden";
|
|
328
|
-
readonly locked: true;
|
|
329
|
-
};
|
|
330
312
|
readonly customerId: {
|
|
331
313
|
readonly label: "Customer";
|
|
332
314
|
readonly order: 1;
|
|
@@ -591,7 +573,7 @@ export declare class AgreementsRecipe extends SmrtRecipe {
|
|
|
591
573
|
static models: (typeof Contract | typeof ContractLineItem)[];
|
|
592
574
|
static nav: {
|
|
593
575
|
label: string;
|
|
594
|
-
model: typeof
|
|
576
|
+
model: typeof Contract;
|
|
595
577
|
icon: string;
|
|
596
578
|
description: string;
|
|
597
579
|
}[];
|
|
@@ -607,10 +589,6 @@ export declare class AgreementsRecipe extends SmrtRecipe {
|
|
|
607
589
|
readonly customerId: {
|
|
608
590
|
readonly label: "Customer";
|
|
609
591
|
readonly order: 1;
|
|
610
|
-
readonly required: true;
|
|
611
|
-
};
|
|
612
|
-
readonly vendorId: {
|
|
613
|
-
readonly visibility: "hidden";
|
|
614
592
|
};
|
|
615
593
|
readonly subtotal: {
|
|
616
594
|
readonly visibility: "hidden";
|
|
@@ -694,10 +672,6 @@ export declare class LeasesRecipe extends SmrtRecipe {
|
|
|
694
672
|
readonly customerId: {
|
|
695
673
|
readonly label: "Customer";
|
|
696
674
|
readonly order: 1;
|
|
697
|
-
readonly required: true;
|
|
698
|
-
};
|
|
699
|
-
readonly vendorId: {
|
|
700
|
-
readonly visibility: "hidden";
|
|
701
675
|
};
|
|
702
676
|
readonly subtotal: {
|
|
703
677
|
readonly visibility: "hidden";
|
|
@@ -774,10 +748,6 @@ export declare class LicensesRecipe extends SmrtRecipe {
|
|
|
774
748
|
readonly customerId: {
|
|
775
749
|
readonly label: "Customer";
|
|
776
750
|
readonly order: 1;
|
|
777
|
-
readonly required: true;
|
|
778
|
-
};
|
|
779
|
-
readonly vendorId: {
|
|
780
|
-
readonly visibility: "hidden";
|
|
781
751
|
};
|
|
782
752
|
readonly subtotal: {
|
|
783
753
|
readonly visibility: "hidden";
|
package/dist/recipes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../src/recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,
|
|
1
|
+
{"version":3,"file":"recipes.d.ts","sourceRoot":"","sources":["../src/recipes.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAEL,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,WAAW,EACX,KAAK,EACL,aAAa,EACb,cAAc,EACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,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