@compassdigital/sdk.typescript 4.936.0 → 4.938.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.
@@ -16,6 +16,15 @@ export interface CreateProductionSheetDto {
16
16
  autoGenerated?: boolean;
17
17
  }
18
18
 
19
+ export interface SheetPlanDto {
20
+ planned_amount: number;
21
+ suggested_amount: number | null;
22
+ source: ('typed' | 'accepted') | null;
23
+ updated_by: string;
24
+ // Send back as expected_updated_at when saving this row
25
+ updated_at: string;
26
+ }
27
+
19
28
  export interface ProductionSheetItemDto {
20
29
  item_name: string;
21
30
  pos_id: string;
@@ -34,6 +43,8 @@ export interface ProductionSheetItemDto {
34
43
  accuracy?: ('good' | 'low' | 'pending' | 'error') | null;
35
44
  // Luna flags explaining reduced forecast accuracy for the item
36
45
  accuracy_flags?: string[] | null;
46
+ // The saved plan; absent when none
47
+ plan?: SheetPlanDto;
37
48
  }
38
49
 
39
50
  export interface ProductionSheetModifierDto {
@@ -95,10 +106,39 @@ export interface ProductionSheetFacetsDto {
95
106
  menus: ProductionSheetMenuFacetDto[];
96
107
  }
97
108
 
109
+ export interface PlanDto {
110
+ // Absent on forecast-only rows Luna could not place
111
+ brand_id?: string;
112
+ // Absent on forecast-only rows Luna could not place
113
+ menu_id?: string;
114
+ // Absent on forecast-only rows
115
+ menu_item_id?: string;
116
+ // Empty on forecast-only rows with no POS id
117
+ pos_id: string;
118
+ item_name: string;
119
+ site_id: string;
120
+ // Service date, yyyy-mm-dd
121
+ date: string;
122
+ planned_amount: number;
123
+ suggested_amount: number | null;
124
+ // Null when the stored value is not a known source
125
+ source: ('typed' | 'accepted') | null;
126
+ updated_by: string;
127
+ updated_at: string;
128
+ }
129
+
130
+ export interface ProductionSheetPlansDto {
131
+ // Plans for the sheet's date whose row is no longer on the sheet
132
+ orphaned: PlanDto[];
133
+ // True when plans could not be read; rows carry no plan
134
+ unavailable: boolean;
135
+ }
136
+
98
137
  export interface ProductionSheetPaginatedResponseDto {
99
138
  meta: ProductionSheetPaginatedMetaDto;
100
139
  results: ProductionSheetPaginatedResultsDto;
101
140
  facets: ProductionSheetFacetsDto;
141
+ plans: ProductionSheetPlansDto;
102
142
  }
103
143
 
104
144
  export interface ProductionSheetItemForecastDiffDto {
@@ -142,6 +182,88 @@ export interface ItemForecastDiffResponse {
142
182
  data: string;
143
183
  }
144
184
 
185
+ export interface PlanInputDto {
186
+ // Absent on forecast-only rows Luna could not place
187
+ brand_id?: string;
188
+ // Absent on forecast-only rows Luna could not place
189
+ menu_id?: string;
190
+ // Absent on forecast-only rows
191
+ menu_item_id?: string;
192
+ // Empty on forecast-only rows with no POS id
193
+ pos_id: string;
194
+ item_name: string;
195
+ planned_amount: number;
196
+ // The suggested amount the operator saw when they saved
197
+ suggested_amount?: number | null;
198
+ source: 'typed' | 'accepted';
199
+ // The plan's updated_at when it was read; null or absent for a new plan
200
+ expected_updated_at?: string | null;
201
+ }
202
+
203
+ export interface PutPlansRequestDto {
204
+ // Site ID the plans are for
205
+ siteId: string;
206
+ // Service date of the sheet, yyyy-mm-dd
207
+ date: string;
208
+ items: PlanInputDto[];
209
+ }
210
+
211
+ export interface PutPlansResponseDto {
212
+ plans: PlanDto[];
213
+ }
214
+
215
+ export interface PlanConflictDto {
216
+ // Absent on forecast-only rows Luna could not place
217
+ brand_id?: string;
218
+ // Absent on forecast-only rows Luna could not place
219
+ menu_id?: string;
220
+ // Absent on forecast-only rows
221
+ menu_item_id?: string;
222
+ // Empty on forecast-only rows with no POS id
223
+ pos_id: string;
224
+ item_name: string;
225
+ // The stored plan; null if it was deleted
226
+ current: PlanDto;
227
+ }
228
+
229
+ export interface PlansConflictDataDto {
230
+ // Items in the request that were saved
231
+ saved: PlanDto[];
232
+ // Items another write changed first
233
+ conflicts: PlanConflictDto[];
234
+ }
235
+
236
+ export interface PlansConflictResponseDto {
237
+ message: string;
238
+ data: PlansConflictDataDto;
239
+ }
240
+
241
+ export interface PlanItemKeyDto {
242
+ // Absent on forecast-only rows Luna could not place
243
+ brand_id?: string;
244
+ // Absent on forecast-only rows Luna could not place
245
+ menu_id?: string;
246
+ // Absent on forecast-only rows
247
+ menu_item_id?: string;
248
+ // Empty on forecast-only rows with no POS id
249
+ pos_id: string;
250
+ item_name: string;
251
+ }
252
+
253
+ export interface PlansFailedDataDto {
254
+ // Items in the request that were saved
255
+ saved: PlanDto[];
256
+ // Items another write changed first
257
+ conflicts: PlanConflictDto[];
258
+ // Items whose write failed; safe to retry
259
+ failed: PlanItemKeyDto[];
260
+ }
261
+
262
+ export interface PlansFailedResponseDto {
263
+ message: string;
264
+ data: PlansFailedDataDto;
265
+ }
266
+
145
267
  export interface ChatItemDto {
146
268
  // Item's display name
147
269
  name: string;
@@ -230,14 +352,15 @@ export interface GetForecastingProductionSheetQuery {
230
352
  responseId?: string;
231
353
  // When true, skip S3 cache read and rebuild; write replaces any existing object
232
354
  nocache?: boolean;
233
- // Sort column before pagination (matches CentricOS DataTable). total_to_produce uses max(0, forecasted_amount - on_hand).
355
+ // Sort column before pagination (matches CentricOS DataTable). total_to_produce uses max(0, forecasted_amount - on_hand); planned_amount falls back to forecasted_amount on rows with no plan.
234
356
  sortBy?:
235
357
  | 'item_name'
236
358
  | 'last_week_amount'
237
359
  | 'forecasted_amount'
238
360
  | 'actual_amount'
239
361
  | 'on_hand'
240
- | 'total_to_produce';
362
+ | 'total_to_produce'
363
+ | 'planned_amount';
241
364
  // Sort direction; default desc matches CentricOS default on forecast column
242
365
  sortOrder?: 'asc' | 'desc';
243
366
  }
@@ -271,6 +394,12 @@ export type GetForecastingForecastMetadataResponse = {};
271
394
 
272
395
  export type GetForecastingPingResponse = {};
273
396
 
397
+ // PUT /forecasting/plans - Save planned amounts for production sheet rows
398
+
399
+ export type PutForecastingPlansBody = PutPlansRequestDto;
400
+
401
+ export type PutForecastingPlansResponse = PutPlansResponseDto;
402
+
274
403
  // POST /forecasting/chat - Relay a user chat message to Luna
275
404
 
276
405
  export type PostForecastingChatBody = ChatMessageDto;