@campfire-interactive/master-data-client 5.0.0 → 5.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"rates.d.ts","sourceRoot":"","sources":["../src/rates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE/F;;;GAGG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAE1C,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAoB/E;;;OAGG;IACG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;CASrE"}
1
+ {"version":3,"file":"rates.d.ts","sourceRoot":"","sources":["../src/rates.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EACV,eAAe,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EACjE,iBAAiB,EAAE,cAAc,EAClC,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAE1C,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAoB/E;;;OAGG;IACG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAUpE;;;;;;;;;;OAUG;IACG,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;CAOvF"}
package/dist/rates.js CHANGED
@@ -54,6 +54,24 @@ class RatesResource {
54
54
  query,
55
55
  });
56
56
  }
57
+ /**
58
+ * Cutover maintenance: move `RateElement.plantId` (and the `identityKey`
59
+ * derived from it) off a consumer's own plant uuids and onto master-data's.
60
+ * Needed exactly once per tenant, when that consumer stops owning plants.
61
+ *
62
+ * **Defaults to a dry run.** Call it without `dryRun:false` first and read
63
+ * `distinctPlantIds[].classification` — that is how you find out whether an
64
+ * environment needs the move at all, rather than assuming.
65
+ *
66
+ * Requires owner/admin (or a system principal).
67
+ */
68
+ async rekeyPlants(input) {
69
+ return this.http.request({
70
+ method: 'POST',
71
+ path: '/v1/rates/rekey-plants',
72
+ body: input,
73
+ });
74
+ }
57
75
  }
58
76
  exports.RatesResource = RatesResource;
59
77
  //# sourceMappingURL=rates.js.map
package/dist/rates.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"rates.js","sourceRoot":"","sources":["../src/rates.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACH,MAAa,aAAa;IACK;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD,KAAK,CAAC,MAAM,CAAC,KAAsB;QACjC,MAAM,KAAK,GAAuC,EAAE,CAAC;QACrD,IAAI,KAAK,CAAC,UAAU;YAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;QAC1D,IAAI,KAAK,CAAC,IAAI;YAAE,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACxC,IAAI,KAAK,CAAC,OAAO;YAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QACjD,IAAI,KAAK,CAAC,aAAa;YAAE,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAAC;QACnE,IAAI,KAAK,CAAC,WAAW;YAAE,KAAK,CAAC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AO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA+B;YACrD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,oBAAoB;YAC1B,KAAK;SACN,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,WAAW,CAAC,KAAuB;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAoC;YAC1D,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,wBAAwB;YAC9B,IAAI,EAAE,KAAK;SACZ,CAAC,CAAC;IACL,CAAC;CACF;AAvDD,sCAuDC"}
package/dist/regions.d.ts CHANGED
@@ -1,5 +1,17 @@
1
1
  import { HttpTransport } from './http';
2
2
  import type { Region, CreateRegionInput, UpdateRegionInput, SingleResponse, ListResponse, CreateResponse } from './types';
3
+ /**
4
+ * @deprecated Superseded by `geographicScopes` — the per-tenant catalog with a
5
+ * per-tenant alias. Do not build new consumers on this.
6
+ *
7
+ * Still served, and still correct for one thing only: keeping an existing
8
+ * `regionId` column fed while every environment catches up. New code that
9
+ * needs a geography should read `client.geographicScopes` and label it with
10
+ * `client.scopeDimensionSettings` — one tenant calls it Region, another
11
+ * Division, another Business Unit, and this list can express none of that.
12
+ *
13
+ * Removal is master-data docs/plans/2026-09-16-region-retirement.md phase C.
14
+ */
3
15
  export declare class RegionResource {
4
16
  private readonly http;
5
17
  constructor(http: HttpTransport);
@@ -1 +1 @@
1
- {"version":3,"file":"regions.d.ts","sourceRoot":"","sources":["../src/regions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EACV,MAAM,EACN,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,qBAAa,cAAc;IACb,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAE1C,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC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AC,IAAI,CAAC;CAMxC"}
package/dist/regions.js CHANGED
@@ -1,6 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RegionResource = void 0;
4
+ /**
5
+ * @deprecated Superseded by `geographicScopes` — the per-tenant catalog with a
6
+ * per-tenant alias. Do not build new consumers on this.
7
+ *
8
+ * Still served, and still correct for one thing only: keeping an existing
9
+ * `regionId` column fed while every environment catches up. New code that
10
+ * needs a geography should read `client.geographicScopes` and label it with
11
+ * `client.scopeDimensionSettings` — one tenant calls it Region, another
12
+ * Division, another Business Unit, and this list can express none of that.
13
+ *
14
+ * Removal is master-data docs/plans/2026-09-16-region-retirement.md phase C.
15
+ */
4
16
  class RegionResource {
5
17
  http;
6
18
  constructor(http) {
@@ -1 +1 @@
1
- {"version":3,"file":"regions.js","sourceRoot":"","sources":["../src/regions.ts"],"names":[],"mappings":";;;AAUA,MAAa,cAAc;IACI;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD,KAAK,CAAC,IAAI;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAuB;YAC7C,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,aAAa;SACpB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,EAAU;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAyB;YAC/C,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,eAAe,kBAAkB,CAAC,EAAE,CAAC,EAAE;SAC9C,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAwB,EAAE,cAAuB;QAC5D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAyB;YAC/C,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,KAAK;YACX,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,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B,cAAuB;QAEvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAyB;YAC/C,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,eAAe,kBAAkB,CAAC,EAAE,CAAC,EAAE;YAC7C,IAAI,EAAE,KAAK;YACX,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EAAU;QACrB,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAY;YACjC,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,eAAe,kBAAkB,CAAC,EAAE,CAAC,EAAE;SAC9C,CAAC,CAAC;IACL,CAAC;CACF;AA7CD,wCA6CC"}
@@ -0,0 +1,25 @@
1
+ import { HttpTransport } from './http';
2
+ import type { StandardAttribute, UpdateStandardAttributeInput, StandardAttributeValue, SetStandardAttributeValueInput, SetStandardAttributeValueResult, StandardAttributeHistoryEntry, SingleResponse, ListResponse } from './types';
3
+ export declare class StandardAttributeResource {
4
+ private readonly http;
5
+ constructor(http: HttpTransport);
6
+ /** This tenant's attribute catalog, in display order. */
7
+ list(options?: {
8
+ enabledOnly?: boolean;
9
+ }): Promise<ListResponse<StandardAttribute>>;
10
+ /** Rename, reorder, enable or disable one attribute. `key` is immutable. */
11
+ update(id: string, input: UpdateStandardAttributeInput, idempotencyKey?: string): Promise<SingleResponse<StandardAttribute>>;
12
+ /** Every stored value on one quote, in catalog order. */
13
+ listValues(quoteId: string): Promise<ListResponse<StandardAttributeValue>>;
14
+ /**
15
+ * Write values on a quote.
16
+ *
17
+ * Send the whole set in one call rather than looping: the server writes them
18
+ * in a single transaction, and `onlyIfBlank` on each input is what makes the
19
+ * enrichment pass fill blanks without ever overwriting a rep's correction.
20
+ */
21
+ setValues(quoteId: string, values: SetStandardAttributeValueInput[], idempotencyKey?: string): Promise<ListResponse<SetStandardAttributeValueResult>>;
22
+ /** One attribute's timeline on a quote, or the whole quote's when no key. */
23
+ listHistory(quoteId: string, key?: string): Promise<ListResponse<StandardAttributeHistoryEntry>>;
24
+ }
25
+ //# sourceMappingURL=standardAttributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standardAttributes.d.ts","sourceRoot":"","sources":["../src/standardAttributes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,sBAAsB,EACtB,8BAA8B,EAC9B,+BAA+B,EAC/B,6BAA6B,EAC7B,cAAc,EACd,YAAY,EACb,MAAM,SAAS,CAAC;AASjB,qBAAa,yBAAyB;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,aAAa;IAEhD,yDAAyD;IACnD,IAAI,CAAC,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC;IAQzF,4EAA4E;IACtE,MAAM,CACV,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,4BAA4B,EACnC,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;IAS7C,yDAAyD;IACnD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAC;IAOhF;;;;;;OAMG;IACG,SAAS,CACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,8BAA8B,EAAE,EACxC,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC;IASzD,6EAA6E;IACvE,WAAW,CACf,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,YAAY,CAAC,6BAA6B,CAAC,CAAC;CAOxD"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StandardAttributeResource = void 0;
4
+ // Standard Attributes: the platform-owned set of vehicle and program facts a
5
+ // quote carries, each with the source it came from and a full change history.
6
+ // See nextgen docs/decisions/2026-09-18-standard-attributes.md.
7
+ //
8
+ // The catalog is landlord-owned and provisioned per tenant, so there is no
9
+ // create and no delete: a tenant renames or disables an attribute, it cannot
10
+ // invent or destroy one.
11
+ class StandardAttributeResource {
12
+ http;
13
+ constructor(http) {
14
+ this.http = http;
15
+ }
16
+ /** This tenant's attribute catalog, in display order. */
17
+ async list(options) {
18
+ const query = options?.enabledOnly ? '?enabledOnly=true' : '';
19
+ return this.http.request({
20
+ method: 'GET',
21
+ path: `/v1/standard-attributes${query}`,
22
+ });
23
+ }
24
+ /** Rename, reorder, enable or disable one attribute. `key` is immutable. */
25
+ async update(id, input, idempotencyKey) {
26
+ return this.http.request({
27
+ method: 'PATCH',
28
+ path: `/v1/standard-attributes/${encodeURIComponent(id)}`,
29
+ body: input,
30
+ idempotencyKey,
31
+ });
32
+ }
33
+ /** Every stored value on one quote, in catalog order. */
34
+ async listValues(quoteId) {
35
+ return this.http.request({
36
+ method: 'GET',
37
+ path: `/v1/quotes/${encodeURIComponent(quoteId)}/standard-attributes`,
38
+ });
39
+ }
40
+ /**
41
+ * Write values on a quote.
42
+ *
43
+ * Send the whole set in one call rather than looping: the server writes them
44
+ * in a single transaction, and `onlyIfBlank` on each input is what makes the
45
+ * enrichment pass fill blanks without ever overwriting a rep's correction.
46
+ */
47
+ async setValues(quoteId, values, idempotencyKey) {
48
+ return this.http.request({
49
+ method: 'PUT',
50
+ path: `/v1/quotes/${encodeURIComponent(quoteId)}/standard-attributes`,
51
+ body: { values },
52
+ idempotencyKey,
53
+ });
54
+ }
55
+ /** One attribute's timeline on a quote, or the whole quote's when no key. */
56
+ async listHistory(quoteId, key) {
57
+ const query = key ? `?key=${encodeURIComponent(key)}` : '';
58
+ return this.http.request({
59
+ method: 'GET',
60
+ path: `/v1/quotes/${encodeURIComponent(quoteId)}/standard-attributes/history${query}`,
61
+ });
62
+ }
63
+ }
64
+ exports.StandardAttributeResource = StandardAttributeResource;
65
+ //# sourceMappingURL=standardAttributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standardAttributes.js","sourceRoot":"","sources":["../src/standardAttributes.ts"],"names":[],"mappings":";;;AAYA,6EAA6E;AAC7E,8EAA8E;AAC9E,gEAAgE;AAChE,EAAE;AACF,2EAA2E;AAC3E,6EAA6E;AAC7E,yBAAyB;AACzB,MAAa,yBAAyB;IACP;IAA7B,YAA6B,IAAmB;QAAnB,SAAI,GAAJ,IAAI,CAAe;IAAG,CAAC;IAEpD,yDAAyD;IACzD,KAAK,CAAC,IAAI,CAAC,OAAmC;QAC5C,MAAM,KAAK,GAAG,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAkC;YACxD,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,0BAA0B,KAAK,EAAE;SACxC,CAAC,CAAC;IACL,CAAC;IAED,4EAA4E;IAC5E,KAAK,CAAC,MAAM,CACV,EAAU,EACV,KAAmC,EACnC,cAAuB;QAEvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAoC;YAC1D,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,2BAA2B,kBAAkB,CAAC,EAAE,CAAC,EAAE;YACzD,IAAI,EAAE,KAAK;YACX,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED,yDAAyD;IACzD,KAAK,CAAC,UAAU,CAAC,OAAe;QAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAuC;YAC7D,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,cAAc,kBAAkB,CAAC,OAAO,CAAC,sBAAsB;SACtE,CAAC,CAAC;IACL,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,SAAS,CACb,OAAe,EACf,MAAwC,EACxC,cAAuB;QAEvB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAgD;YACtE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,cAAc,kBAAkB,CAAC,OAAO,CAAC,sBAAsB;YACrE,IAAI,EAAE,EAAE,MAAM,EAAE;YAChB,cAAc;SACf,CAAC,CAAC;IACL,CAAC;IAED,6EAA6E;IAC7E,KAAK,CAAC,WAAW,CACf,OAAe,EACf,GAAY;QAEZ,MAAM,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAA8C;YACpE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,cAAc,kBAAkB,CAAC,OAAO,CAAC,+BAA+B,KAAK,EAAE;SACtF,CAAC,CAAC;IACL,CAAC;CACF;AAjED,8DAiEC"}
package/dist/types.d.ts CHANGED
@@ -1088,10 +1088,17 @@ export interface ListPlantsOptions {
1088
1088
  active?: boolean;
1089
1089
  country?: string;
1090
1090
  region?: string;
1091
+ /** Relations to expand. Only `'equipment'` is supported. Forwarded as
1092
+ * `?include=` — the backend has honoured it since the plant/equipment
1093
+ * consolidation; the client simply dropped it until 5.1.0. Expanding
1094
+ * equipment turns a plant page plus a per-plant equipment call into one
1095
+ * request. */
1096
+ include?: Array<'equipment'>;
1091
1097
  }
1092
1098
  export interface GetPlantOptions {
1093
- /** Reserved for future relation expansions; currently no-op. */
1094
- include?: string[];
1099
+ /** Relations to expand. Only `'equipment'` is supported. Forwarded as
1100
+ * `?include=` from 5.1.0 — previously declared but never sent. */
1101
+ include?: Array<'equipment'>;
1095
1102
  }
1096
1103
  export type PlantMatchType = 'exact_code' | 'trgm_name';
1097
1104
  export interface PlantMatch {
@@ -1446,6 +1453,58 @@ export interface RateLookupResult {
1446
1453
  * active legacy rate tables — enough to resolve rates in-memory for a whole
1447
1454
  * calc run instead of N×M live `rates.lookup` calls. Decimals are strings.
1448
1455
  */
1456
+ /** How a rate element's `plantId` relates to master-data's own plant registry.
1457
+ * `already-master-data` on every row means the environment is keyed our way
1458
+ * and a re-key would be a no-op; `unmapped` rows carry a consumer-side uuid
1459
+ * and are what the cutover has to move. */
1460
+ export type PlantKeyClassification = 'already-master-data' | 'unmapped' | 'mapped';
1461
+ /** Input for `rates.rekeyPlants` — the one-shot cutover step that moves
1462
+ * `RateElement.plantId` (and its derived `identityKey`) from a consumer's own
1463
+ * plant uuids onto master-data's. See the route docs for why it is staged. */
1464
+ export interface RekeyPlantsInput {
1465
+ /** 'by-code' lets master-data resolve the target from its own registry, which
1466
+ * is ALSO how a caller discovers which keying an environment is in.
1467
+ * 'explicit' is for a mapping a human has already reviewed. */
1468
+ mode: 'by-code' | 'explicit';
1469
+ mapping: Array<{
1470
+ fromPlantId: string;
1471
+ code?: string;
1472
+ toPlantId?: string;
1473
+ }>;
1474
+ /** Defaults to 'fail': a collision means the tenant holds the same logical
1475
+ * rate twice and a person has to choose. */
1476
+ onCollision?: 'fail' | 'keep-target' | 'keep-source';
1477
+ /** Defaults to TRUE — omitting it gives you a dry run, never a write. */
1478
+ dryRun?: boolean;
1479
+ }
1480
+ export interface RekeyPlantsReport {
1481
+ dryRun: boolean;
1482
+ tenantId: string;
1483
+ distinctPlantIds: Array<{
1484
+ plantId: string;
1485
+ classification: PlantKeyClassification;
1486
+ resolvedCode: string | null;
1487
+ toPlantId: string | null;
1488
+ elementCount: number;
1489
+ legacyEntryCount: number;
1490
+ }>;
1491
+ /** scope='global' elements (`pl:_`), which a re-key never touches. */
1492
+ globalElements: number;
1493
+ collisions: Array<{
1494
+ identityKeyAfter: string;
1495
+ elementIds: string[];
1496
+ }>;
1497
+ wouldRewrite: {
1498
+ elements: number;
1499
+ legacyEntries: number;
1500
+ equipmentIds: number;
1501
+ };
1502
+ applied: {
1503
+ elements: number;
1504
+ legacyEntries: number;
1505
+ equipmentIds: number;
1506
+ };
1507
+ }
1449
1508
  export interface RateSnapshot {
1450
1509
  asOf: string;
1451
1510
  books: Array<{
@@ -1519,6 +1578,50 @@ export interface RateSnapshot {
1519
1578
  needsDensity: boolean;
1520
1579
  active: boolean;
1521
1580
  }>;
1581
+ /** Every plant in the tenant, ARCHIVED INCLUDED — an archived plant is still
1582
+ * referenced by historical routing and must stay resolvable by id. Filter for
1583
+ * pickers on the consumer side. Added 2026-09-17 for the plant/equipment
1584
+ * consumer cutover: CPQ resolves plants out of this snapshot (which it
1585
+ * already fetches once per calc run and caches) instead of reading its own
1586
+ * plant table, so the cost path costs no extra round-trips and the whole
1587
+ * reference set shares one invalidation lever. */
1588
+ plants: Array<{
1589
+ id: string;
1590
+ code: string;
1591
+ name: string;
1592
+ location: string | null;
1593
+ country: string | null;
1594
+ region: string | null;
1595
+ headcount: number | null;
1596
+ annualCapacity: number | null;
1597
+ currentUtilization: number | null;
1598
+ laborCostPerHour: number | null;
1599
+ riskLevel: string | null;
1600
+ currency: string;
1601
+ numShifts: number;
1602
+ hoursPerShift: number;
1603
+ workingDaysPerYear: number;
1604
+ indirectHeadcountPct: number;
1605
+ active: boolean;
1606
+ }>;
1607
+ /** Every machine in the tenant, archived included — same reasoning as `plants`.
1608
+ * Note `equipmentCode` (not id) is what the rate identity key is built from. */
1609
+ equipment: Array<{
1610
+ id: string;
1611
+ plantId: string;
1612
+ code: string;
1613
+ name: string;
1614
+ processFamily: string;
1615
+ capacityHoursPerYear: number;
1616
+ cavities: number;
1617
+ availabilityPct: number;
1618
+ performancePct: number;
1619
+ defaultHeadcount: number;
1620
+ defaultAutomationPct: number;
1621
+ defaultMachinesPerOperator: number;
1622
+ defaultSetupCrew: number;
1623
+ active: boolean;
1624
+ }>;
1522
1625
  legacyRateTables: Array<{
1523
1626
  id: string;
1524
1627
  name: string;
@@ -1864,6 +1967,18 @@ export interface UpdateEquipmentInput {
1864
1967
  defaultSetupCrew?: number;
1865
1968
  active?: boolean;
1866
1969
  }
1970
+ /** Outcome of `equipment.batchUpsert`. A bad row is reported, not fatal — a
1971
+ * migration that names its three failures is more useful than one that rolls
1972
+ * back 500 rows and says nothing about which. */
1973
+ export interface BatchUpsertEquipmentResult {
1974
+ created: number;
1975
+ updated: number;
1976
+ errors: Array<{
1977
+ index: number;
1978
+ code: string;
1979
+ message: string;
1980
+ }>;
1981
+ }
1867
1982
  export interface ListEquipmentOptions {
1868
1983
  limit?: number;
1869
1984
  cursor?: string;
@@ -1877,6 +1992,29 @@ export interface ListEquipmentOptions {
1877
1992
  * existing caller that sets this doesn't hit a type error; has no effect. */
1878
1993
  active?: boolean;
1879
1994
  }
1995
+ /** A governed category for `ProcessFamily.category`. Two-tier: `tenantId` null
1996
+ * is a platform default, shared and read-only to tenants. */
1997
+ export interface ProcessFamilyCategory {
1998
+ id: string;
1999
+ tenantId: string | null;
2000
+ code: string;
2001
+ label: string;
2002
+ sortOrder: number;
2003
+ /** System categories can be renamed and archived, never hard-deleted. */
2004
+ isSystem: boolean;
2005
+ active: boolean;
2006
+ }
2007
+ export interface CreateProcessFamilyCategoryInput {
2008
+ /** `code` is derived from this server-side and is immutable thereafter,
2009
+ * because stored `ProcessFamily.category` values resolve against it. */
2010
+ label: string;
2011
+ sortOrder?: number;
2012
+ }
2013
+ export interface UpdateProcessFamilyCategoryInput {
2014
+ label?: string;
2015
+ sortOrder?: number;
2016
+ active?: boolean;
2017
+ }
1880
2018
  export interface ProcessFamily {
1881
2019
  id: string;
1882
2020
  tenantId: string | null;
@@ -3484,4 +3622,66 @@ export interface UpdateScopeDimensionSettingInput {
3484
3622
  labelPlural?: string;
3485
3623
  enabled?: boolean;
3486
3624
  }
3625
+ /** The five sources a stored value can name. */
3626
+ export type StandardAttributeSource = 'customer_rfq' | 'volume_intelligence' | 'master_data' | 'prior_quote' | 'user';
3627
+ export interface StandardAttribute {
3628
+ id: string;
3629
+ /** Immutable. The cross-tenant reporting key every stored value references. */
3630
+ key: string;
3631
+ label: string;
3632
+ position: number;
3633
+ /** 'string' | 'date' — matches VI's dimension catalog vocabulary. */
3634
+ dataType: string;
3635
+ /** The VI dimension this resolves through, when it has one. */
3636
+ viCatalogKey: string | null;
3637
+ /** Whether THIS TENANT tracks it. Distinct from the platform lifecycle below. */
3638
+ enabled: boolean;
3639
+ status: 'active' | 'archived';
3640
+ createdAt: string;
3641
+ updatedAt: string;
3642
+ }
3643
+ /** `key` is absent by design — it is immutable after create. */
3644
+ export interface UpdateStandardAttributeInput {
3645
+ label?: string;
3646
+ position?: number;
3647
+ enabled?: boolean;
3648
+ status?: 'active' | 'archived';
3649
+ }
3650
+ export interface StandardAttributeValue {
3651
+ key: string;
3652
+ value: string;
3653
+ /** Which system supplied it. */
3654
+ source: StandardAttributeSource;
3655
+ /** Why this value — free text, e.g. "Prior quote Q-2026-118". */
3656
+ sourceDetail: string | null;
3657
+ setAt: string;
3658
+ setBy: string;
3659
+ }
3660
+ export interface SetStandardAttributeValueInput {
3661
+ key: string;
3662
+ value: string;
3663
+ source: StandardAttributeSource;
3664
+ sourceDetail?: string | null;
3665
+ /**
3666
+ * Leave an existing value alone. The enrichment pass sets this; a person
3667
+ * editing the card does not.
3668
+ */
3669
+ onlyIfBlank?: boolean;
3670
+ }
3671
+ export interface SetStandardAttributeValueResult {
3672
+ key: string;
3673
+ written: boolean;
3674
+ skipped?: 'already-set';
3675
+ }
3676
+ export interface StandardAttributeHistoryEntry {
3677
+ id: string;
3678
+ quoteId: string;
3679
+ key: string;
3680
+ /** NULL on the first write — no previous value, which is not an empty one. */
3681
+ oldValue: string | null;
3682
+ newValue: string;
3683
+ source: StandardAttributeSource;
3684
+ changedAt: string;
3685
+ changedBy: string;
3686
+ }
3487
3687
  //# sourceMappingURL=types.d.ts.map