@campfire-interactive/master-data-client 5.21.0 → 5.22.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/dist/types.d.ts CHANGED
@@ -48,86 +48,6 @@ export interface Location {
48
48
  createdAt: string;
49
49
  updatedAt: string;
50
50
  }
51
- /** LEGACY: the old program (master-data table `programs_legacy`), in practice
52
- * an OEM's vehicle program scoped to one customer. Unchanged on the wire for
53
- * the apps still on it; the tenant's own program is {@link TenantProgram}
54
- * (`client.tenantPrograms`). */
55
- export interface Program {
56
- id: string;
57
- tenantId: string;
58
- customerCompanyId: string;
59
- /** @deprecated Use customerCompanyId. Removed in the next major. Mirrors customerCompanyId during the additive-deprecate window. */
60
- oemCompanyId: string;
61
- name: string;
62
- code: string;
63
- description: string | null;
64
- sopDate: string | null;
65
- eopDate: string | null;
66
- status: 'active' | 'archived';
67
- quality: 'draft' | 'verified';
68
- createdBy: string;
69
- updatedBy: string;
70
- createdAt: string;
71
- updatedAt: string;
72
- /** The scope dimensions this program belongs to. Null means NOT SET, which is
73
- * legal and is where every record starts — resolve the id through
74
- * `geographicScopes` / `productScopes`, and label the field with the
75
- * tenant's alias from `scopeDimensionSettings`, never "Region". */
76
- geographicScopeId: string | null;
77
- productScopeId: string | null;
78
- customerCompany?: Company;
79
- /** @deprecated Use customerCompany. Removed in the next major. Mirrors customerCompany. */
80
- oemCompany?: Company;
81
- }
82
- export interface CreateProgramInput {
83
- customerCompanyId?: string;
84
- /** @deprecated Use customerCompanyId. Removed in the next major. Server rejects when both are set to differing values. */
85
- oemCompanyId?: string;
86
- name: string;
87
- code: string;
88
- description?: string;
89
- sopDate?: string;
90
- eopDate?: string;
91
- /** Must name an ACTIVE scope in this tenant, or the server 400s naming the
92
- * field. Omit (or send null) to leave it unset. */
93
- geographicScopeId?: string | null;
94
- productScopeId?: string | null;
95
- }
96
- export interface UpdateProgramInput {
97
- name?: string;
98
- code?: string;
99
- description?: string;
100
- sopDate?: string | null;
101
- eopDate?: string | null;
102
- quality?: 'draft' | 'verified';
103
- /** Set, change, or clear with null. Must name an ACTIVE scope. */
104
- geographicScopeId?: string | null;
105
- productScopeId?: string | null;
106
- }
107
- export interface ListProgramsOptions {
108
- limit?: number;
109
- cursor?: string;
110
- sort?: string;
111
- q?: string;
112
- status?: 'active' | 'archived' | 'all';
113
- quality?: 'draft' | 'verified';
114
- customerCompanyId?: string;
115
- /** @deprecated Use customerCompanyId. Removed in the next major. */
116
- oemCompanyId?: string;
117
- /** Batch-get a specific set of programs by id — returns them regardless of
118
- * status. Comma-joined server-side; cap ~100/call for URL length and chunk
119
- * larger sets. The server bumps the page size to cover the ids. */
120
- ids?: string[];
121
- include?: ('customerCompany' | 'oemCompany')[];
122
- /** Filter to one scope, or pass `'none'` for programs with NO scope set —
123
- * the bucket every tenant starts in, and how you ask "what still needs a
124
- * scope?". */
125
- geographicScopeId?: string;
126
- productScopeId?: string;
127
- }
128
- export interface GetProgramOptions {
129
- include?: ('customerCompany' | 'oemCompany')[];
130
- }
131
51
  export interface TenantProgram {
132
52
  id: string;
133
53
  tenantId: string;
@@ -151,6 +71,10 @@ export interface TenantProgram {
151
71
  createdAt: string;
152
72
  updatedAt: string;
153
73
  }
74
+ /** A quote's program as `include=program` embeds it: the tenant program's own
75
+ * fields, without the derived customers or the attribute values, which
76
+ * `client.tenantPrograms.get` serves. */
77
+ export type QuoteProgram = Pick<TenantProgram, 'id' | 'tenantId' | 'code' | 'name' | 'description' | 'status' | 'geographicScopeId' | 'productScopeId' | 'createdBy' | 'updatedBy' | 'createdAt' | 'updatedAt'>;
154
78
  export interface ListTenantProgramsOptions {
155
79
  limit?: number;
156
80
  cursor?: string;
@@ -497,7 +421,8 @@ export interface Quote {
497
421
  createdAt: string;
498
422
  updatedAt: string;
499
423
  customerCompany?: Company;
500
- program?: Program;
424
+ /** The quote's tenant program, present when the read includes `program`. */
425
+ program?: QuoteProgram | null;
501
426
  /** Expanded region — present only when the read includes the relation. */
502
427
  region?: Region;
503
428
  }
@@ -1352,7 +1277,7 @@ export interface PlantMatchBatchInput {
1352
1277
  limit?: number;
1353
1278
  }
1354
1279
  /** Parallel arrays — `data[i]` is the matches for `queries[i]`. Failed
1355
- * per-query lookups surface as empty arrays (mirrors Program match batch). */
1280
+ * per-query lookups surface as empty arrays. */
1356
1281
  export interface PlantMatchBatchResponse {
1357
1282
  data: PlantMatch[][];
1358
1283
  meta: ApiMeta;
@@ -3906,51 +3831,6 @@ export interface MatchBatchResponse {
3906
3831
  data: Record<string, CompanyMatch[]>;
3907
3832
  meta: ApiMeta;
3908
3833
  }
3909
- /** Discriminates the high-confidence (exact (tenantId, customerCompanyId,
3910
- * code) match) from the fuzzy pg_trgm-on-name match. Callers can auto-resolve
3911
- * `exact_code` without re-scoring; `trgm_name` typically requires operator
3912
- * confirmation. */
3913
- export type ProgramMatchType = 'exact_code' | 'trgm_name';
3914
- export interface ProgramMatch {
3915
- id: string;
3916
- name: string;
3917
- code: string;
3918
- customerCompanyId: string;
3919
- /** @deprecated Use customerCompanyId. Removed in the next major. Mirrors customerCompanyId. */
3920
- oemCompanyId?: string;
3921
- /** 1.0 for exact-code match; pg_trgm similarity in (threshold..1] otherwise. */
3922
- score: number;
3923
- matchType: ProgramMatchType;
3924
- }
3925
- export interface ProgramMatchQuery {
3926
- name: string;
3927
- customerCompanyId?: string;
3928
- /** @deprecated Use customerCompanyId. Removed in the next major. Server rejects when both are set to differing values. */
3929
- oemCompanyId?: string;
3930
- /** When present, an exact match on (tenantId, customerCompanyId, code) is
3931
- * unioned at score=1.0 ahead of fuzzy matches. */
3932
- code?: string;
3933
- }
3934
- export interface ProgramMatchByNameInput extends ProgramMatchQuery {
3935
- /** Similarity floor, 0.05..0.95 (clamped server-side). Default 0.3. */
3936
- threshold?: number;
3937
- /** Max trgm matches returned, 1..25 (clamped). Default 5. An exact-code
3938
- * hit is returned in addition to the trgm matches. */
3939
- limit?: number;
3940
- }
3941
- export interface ProgramMatchBatchInput {
3942
- /** Non-empty; max 500 queries per request. */
3943
- queries: ProgramMatchQuery[];
3944
- threshold?: number;
3945
- limit?: number;
3946
- }
3947
- /** Response shape for the batch endpoint — parallel arrays. `data[i]` is
3948
- * the matches for `queries[i]`. Failed queries surface as empty arrays
3949
- * (per-query failures don't fail the batch, mirroring Company match). */
3950
- export interface ProgramMatchBatchResponse {
3951
- data: ProgramMatch[][];
3952
- meta: ApiMeta;
3953
- }
3954
3834
  export interface ListLocationsOptions {
3955
3835
  type?: LocationType;
3956
3836
  }