@tonytang99/integration-canonical 1.0.0 → 1.1.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/README.md +414 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -15
- package/dist/index.js.map +1 -1
- package/dist/schemas/customer.d.ts +746 -0
- package/dist/schemas/customer.d.ts.map +1 -0
- package/dist/schemas/customer.js +282 -0
- package/dist/schemas/customer.js.map +1 -0
- package/dist/schemas/index.d.ts +13 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +33 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/inventory.d.ts +1642 -0
- package/dist/schemas/inventory.d.ts.map +1 -0
- package/dist/schemas/inventory.js +302 -0
- package/dist/schemas/inventory.js.map +1 -0
- package/dist/schemas/order.d.ts +1339 -0
- package/dist/schemas/order.d.ts.map +1 -0
- package/dist/schemas/order.js +310 -0
- package/dist/schemas/order.js.map +1 -0
- package/dist/schemas/product.d.ts +717 -0
- package/dist/schemas/product.d.ts.map +1 -0
- package/dist/schemas/product.js +303 -0
- package/dist/schemas/product.js.map +1 -0
- package/dist/slots.d.ts +572 -0
- package/dist/slots.d.ts.map +1 -0
- package/dist/slots.js +20 -0
- package/dist/slots.js.map +1 -0
- package/dist/types/common.d.ts +284 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +401 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/enrichments.d.ts +378 -0
- package/dist/types/enrichments.d.ts.map +1 -0
- package/dist/types/enrichments.js +96 -0
- package/dist/types/enrichments.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventory.d.ts","sourceRoot":"","sources":["../../src/schemas/inventory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,YAAY,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM1E,eAAO,MAAM,eAAe;IAC1B;;OAEG;yBACkB,kBAAkB,GAAG,OAAO;IAQjD;;OAEG;0BACmB,kBAAkB,GAAG,OAAO;IAQlD;;OAEG;4BACqB,kBAAkB,GAAG,OAAO;IASpD;;OAEG;gCAEU,kBAAkB,cACjB,MAAM,GACjB,cAAc,GAAG,IAAI;IAIxB;;OAEG;uCACgC,kBAAkB,GAAG,cAAc,EAAE;IAcxE;;OAEG;0CAEU,kBAAkB,YACnB,MAAM,GACf,cAAc,GAAG,IAAI;IAaxB;;OAEG;6BACsB,kBAAkB,GAAG;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAYzF;;OAEG;+BAEU,kBAAkB,qBACV,MAAM,GACxB,MAAM,GAAG,IAAI;IAQhB;;OAEG;4BACqB,kBAAkB,GAAG,OAAO;IAWpD;;OAEG;kCAC2B,kBAAkB,GAAG,MAAM;IAUzD;;OAEG;+BAEU,kBAAkB,gBACf,MAAM,eACR,MAAM,GACjB,MAAM;IAST;;OAEG;4CACqC,kBAAkB,GAAG;QAC3D,QAAQ,EAAE,cAAc,EAAE,CAAC;QAC3B,WAAW,EAAE,cAAc,EAAE,CAAC;QAC9B,OAAO,EAAE,cAAc,EAAE,CAAC;KAC3B;IAcD;;OAEG;6BACsB,kBAAkB,GAAG,MAAM;CAerD,CAAC"}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InventoryHelper = exports.CanonicalInventorySchema = exports.InventoryMovementSchema = exports.InventoryMovementType = exports.InventoryLevelSchema = exports.InventoryLocationSchema = exports.LocationType = void 0;
|
|
4
|
+
// packages/canonical/src/schemas/inventory.ts
|
|
5
|
+
const zod_1 = require("zod");
|
|
6
|
+
const common_1 = require("../types/common");
|
|
7
|
+
// ============================================================================
|
|
8
|
+
// INVENTORY LOCATION
|
|
9
|
+
// ============================================================================
|
|
10
|
+
exports.LocationType = zod_1.z.enum([
|
|
11
|
+
'warehouse', // Distribution center
|
|
12
|
+
'store', // Retail store
|
|
13
|
+
'supplier', // Third-party supplier
|
|
14
|
+
'dropship', // Drop-ship location
|
|
15
|
+
'virtual', // Virtual/digital location
|
|
16
|
+
'consignment', // Consignment location
|
|
17
|
+
'transit', // In-transit inventory
|
|
18
|
+
]);
|
|
19
|
+
exports.InventoryLocationSchema = zod_1.z.object({
|
|
20
|
+
id: zod_1.z.string(),
|
|
21
|
+
name: zod_1.z.string(),
|
|
22
|
+
code: zod_1.z.string(), // Short code for the location (e.g., "WH-01", "STORE-NYC")
|
|
23
|
+
type: exports.LocationType,
|
|
24
|
+
address: common_1.AddressSchema.optional(),
|
|
25
|
+
// Contact info
|
|
26
|
+
contactName: zod_1.z.string().optional(),
|
|
27
|
+
contactPhone: zod_1.z.string().optional(),
|
|
28
|
+
contactEmail: zod_1.z.string().email().optional(),
|
|
29
|
+
// Status
|
|
30
|
+
isActive: zod_1.z.boolean().optional(),
|
|
31
|
+
isFulfillmentCenter: zod_1.z.boolean().optional(), // Can fulfill orders
|
|
32
|
+
// Priority for fulfillment
|
|
33
|
+
priority: zod_1.z.number().int().optional(),
|
|
34
|
+
// Operating hours / timezone
|
|
35
|
+
timezone: zod_1.z.string().optional(), // IANA timezone
|
|
36
|
+
// Metadata
|
|
37
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
38
|
+
});
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// INVENTORY LEVEL (per location)
|
|
41
|
+
// ============================================================================
|
|
42
|
+
exports.InventoryLevelSchema = zod_1.z.object({
|
|
43
|
+
sku: zod_1.z.string(),
|
|
44
|
+
location: exports.InventoryLocationSchema,
|
|
45
|
+
// Quantities
|
|
46
|
+
quantityOnHand: zod_1.z.number().int().min(0), // Physical inventory
|
|
47
|
+
quantityReserved: zod_1.z.number().int().min(0), // Reserved for orders
|
|
48
|
+
quantityAvailable: zod_1.z.number().int(), // On hand - reserved
|
|
49
|
+
quantityIncoming: zod_1.z.number().int().min(0), // Expected from POs
|
|
50
|
+
quantityDamaged: zod_1.z.number().int().min(0).optional(), // Damaged/unusable
|
|
51
|
+
quantityInTransit: zod_1.z.number().int().min(0).optional(), // Moving between locations
|
|
52
|
+
// Reorder settings
|
|
53
|
+
reorderPoint: zod_1.z.number().int().optional(), // Minimum before reorder
|
|
54
|
+
reorderQuantity: zod_1.z.number().int().optional(), // Standard order quantity
|
|
55
|
+
maxQuantity: zod_1.z.number().int().optional(), // Maximum stock level
|
|
56
|
+
// Cost tracking
|
|
57
|
+
unitCost: zod_1.z.object({
|
|
58
|
+
amount: zod_1.z.number().int(),
|
|
59
|
+
currency: zod_1.z.string().length(3),
|
|
60
|
+
}).optional(),
|
|
61
|
+
// Tracking
|
|
62
|
+
lastCounted: zod_1.z.string().datetime().optional(),
|
|
63
|
+
lastAdjusted: zod_1.z.string().datetime().optional(),
|
|
64
|
+
lastMovement: zod_1.z.string().datetime().optional(),
|
|
65
|
+
// Bin location (for warehouses)
|
|
66
|
+
binLocation: zod_1.z.string().optional(), // e.g., "A-12-3" (aisle-rack-shelf)
|
|
67
|
+
// Custom fields
|
|
68
|
+
customFields: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional(),
|
|
69
|
+
});
|
|
70
|
+
// ============================================================================
|
|
71
|
+
// INVENTORY MOVEMENT TYPES
|
|
72
|
+
// ============================================================================
|
|
73
|
+
exports.InventoryMovementType = zod_1.z.enum([
|
|
74
|
+
'sale', // Sold to customer
|
|
75
|
+
'return', // Customer return
|
|
76
|
+
'adjustment', // Manual adjustment
|
|
77
|
+
'damage', // Damaged goods
|
|
78
|
+
'shrinkage', // Theft/loss
|
|
79
|
+
'receipt', // Received from supplier
|
|
80
|
+
'transfer', // Transfer between locations
|
|
81
|
+
'production', // Used in production
|
|
82
|
+
'sample', // Sample/demo
|
|
83
|
+
'promotion', // Promotional use
|
|
84
|
+
'cycle_count', // Inventory count adjustment
|
|
85
|
+
]);
|
|
86
|
+
// ============================================================================
|
|
87
|
+
// INVENTORY MOVEMENT (history/audit)
|
|
88
|
+
// ============================================================================
|
|
89
|
+
exports.InventoryMovementSchema = zod_1.z.object({
|
|
90
|
+
id: zod_1.z.string(),
|
|
91
|
+
sku: zod_1.z.string(),
|
|
92
|
+
location: exports.InventoryLocationSchema,
|
|
93
|
+
// Movement details
|
|
94
|
+
type: exports.InventoryMovementType,
|
|
95
|
+
quantity: zod_1.z.number().int(), // Can be negative
|
|
96
|
+
// Related references
|
|
97
|
+
orderId: zod_1.z.string().optional(),
|
|
98
|
+
purchaseOrderId: zod_1.z.string().optional(),
|
|
99
|
+
transferId: zod_1.z.string().optional(),
|
|
100
|
+
adjustmentReason: zod_1.z.string().optional(),
|
|
101
|
+
// Tracking
|
|
102
|
+
performedBy: zod_1.z.string().optional(), // User ID who made the change
|
|
103
|
+
performedAt: zod_1.z.string().datetime(),
|
|
104
|
+
// Notes
|
|
105
|
+
notes: zod_1.z.string().optional(),
|
|
106
|
+
// Before/After snapshot
|
|
107
|
+
quantityBefore: zod_1.z.number().int().optional(),
|
|
108
|
+
quantityAfter: zod_1.z.number().int().optional(),
|
|
109
|
+
});
|
|
110
|
+
// ============================================================================
|
|
111
|
+
// CANONICAL INVENTORY (aggregate across locations)
|
|
112
|
+
// ============================================================================
|
|
113
|
+
exports.CanonicalInventorySchema = zod_1.z.object({
|
|
114
|
+
// ========== IDENTITY ==========
|
|
115
|
+
sku: zod_1.z.string(),
|
|
116
|
+
productId: zod_1.z.string().optional(),
|
|
117
|
+
productName: zod_1.z.string().optional(),
|
|
118
|
+
// ========== LOCATION LEVELS ==========
|
|
119
|
+
locations: zod_1.z.array(exports.InventoryLevelSchema),
|
|
120
|
+
// ========== AGGREGATED TOTALS ==========
|
|
121
|
+
totals: zod_1.z.object({
|
|
122
|
+
onHand: zod_1.z.number().int().min(0),
|
|
123
|
+
reserved: zod_1.z.number().int().min(0),
|
|
124
|
+
available: zod_1.z.number().int(),
|
|
125
|
+
incoming: zod_1.z.number().int().min(0),
|
|
126
|
+
damaged: zod_1.z.number().int().min(0).optional(),
|
|
127
|
+
inTransit: zod_1.z.number().int().min(0).optional(),
|
|
128
|
+
}),
|
|
129
|
+
// ========== TRACKING SETTINGS ==========
|
|
130
|
+
tracked: zod_1.z.boolean(), // Whether inventory is tracked
|
|
131
|
+
allowBackorder: zod_1.z.boolean().optional(),
|
|
132
|
+
allowNegative: zod_1.z.boolean().optional(),
|
|
133
|
+
// ========== THRESHOLDS ==========
|
|
134
|
+
thresholds: zod_1.z.object({
|
|
135
|
+
lowStock: zod_1.z.number().int().optional(),
|
|
136
|
+
outOfStock: zod_1.z.number().int().optional(),
|
|
137
|
+
}).optional(),
|
|
138
|
+
// ========== DATES ==========
|
|
139
|
+
dates: zod_1.z.object({
|
|
140
|
+
updatedAt: zod_1.z.string().datetime(),
|
|
141
|
+
lastCounted: zod_1.z.string().datetime().optional(),
|
|
142
|
+
lastSold: zod_1.z.string().datetime().optional(),
|
|
143
|
+
lastReceived: zod_1.z.string().datetime().optional(),
|
|
144
|
+
}),
|
|
145
|
+
// ========== MOVEMENT HISTORY ==========
|
|
146
|
+
recentMovements: zod_1.z.array(exports.InventoryMovementSchema).optional(),
|
|
147
|
+
// ========== METADATA ==========
|
|
148
|
+
metadata: zod_1.z.object({
|
|
149
|
+
source: zod_1.z.string(), // 'bigcommerce', 'myob', 'adobe', 'shopify'
|
|
150
|
+
sourceId: zod_1.z.string().optional(),
|
|
151
|
+
externalIds: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
152
|
+
// Flags
|
|
153
|
+
isDiscontinued: zod_1.z.boolean().optional(),
|
|
154
|
+
isPerishable: zod_1.z.boolean().optional(),
|
|
155
|
+
expiryDate: zod_1.z.string().datetime().optional(),
|
|
156
|
+
}),
|
|
157
|
+
});
|
|
158
|
+
// ============================================================================
|
|
159
|
+
// HELPER FUNCTIONS
|
|
160
|
+
// ============================================================================
|
|
161
|
+
exports.InventoryHelper = {
|
|
162
|
+
/**
|
|
163
|
+
* Check if SKU is in stock (globally)
|
|
164
|
+
*/
|
|
165
|
+
isInStock(inventory) {
|
|
166
|
+
if (!inventory.tracked) {
|
|
167
|
+
return true; // Non-tracked items are always "in stock"
|
|
168
|
+
}
|
|
169
|
+
return inventory.totals.available > 0 || inventory.allowBackorder === true;
|
|
170
|
+
},
|
|
171
|
+
/**
|
|
172
|
+
* Check if SKU is low stock
|
|
173
|
+
*/
|
|
174
|
+
isLowStock(inventory) {
|
|
175
|
+
if (!inventory.tracked || !inventory.thresholds?.lowStock) {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
return inventory.totals.available <= inventory.thresholds.lowStock;
|
|
179
|
+
},
|
|
180
|
+
/**
|
|
181
|
+
* Check if SKU is out of stock
|
|
182
|
+
*/
|
|
183
|
+
isOutOfStock(inventory) {
|
|
184
|
+
if (!inventory.tracked) {
|
|
185
|
+
return false;
|
|
186
|
+
}
|
|
187
|
+
const threshold = inventory.thresholds?.outOfStock || 0;
|
|
188
|
+
return inventory.totals.available <= threshold;
|
|
189
|
+
},
|
|
190
|
+
/**
|
|
191
|
+
* Get inventory at specific location
|
|
192
|
+
*/
|
|
193
|
+
getLocationLevel(inventory, locationId) {
|
|
194
|
+
return inventory.locations.find(loc => loc.location.id === locationId) || null;
|
|
195
|
+
},
|
|
196
|
+
/**
|
|
197
|
+
* Get fulfillment locations (sorted by priority)
|
|
198
|
+
*/
|
|
199
|
+
getFulfillmentLocations(inventory) {
|
|
200
|
+
return inventory.locations
|
|
201
|
+
.filter(loc => loc.location.isFulfillmentCenter &&
|
|
202
|
+
loc.location.isActive !== false &&
|
|
203
|
+
loc.quantityAvailable > 0)
|
|
204
|
+
.sort((a, b) => {
|
|
205
|
+
const priorityA = a.location.priority || 999;
|
|
206
|
+
const priorityB = b.location.priority || 999;
|
|
207
|
+
return priorityA - priorityB;
|
|
208
|
+
});
|
|
209
|
+
},
|
|
210
|
+
/**
|
|
211
|
+
* Get best fulfillment location for quantity
|
|
212
|
+
*/
|
|
213
|
+
getBestFulfillmentLocation(inventory, quantity) {
|
|
214
|
+
const locations = this.getFulfillmentLocations(inventory);
|
|
215
|
+
// First, try to find a location with enough stock
|
|
216
|
+
const sufficient = locations.find(loc => loc.quantityAvailable >= quantity);
|
|
217
|
+
if (sufficient)
|
|
218
|
+
return sufficient;
|
|
219
|
+
// Otherwise, return location with most stock
|
|
220
|
+
return locations.sort((a, b) => b.quantityAvailable - a.quantityAvailable)[0] || null;
|
|
221
|
+
},
|
|
222
|
+
/**
|
|
223
|
+
* Calculate total value of inventory
|
|
224
|
+
*/
|
|
225
|
+
getTotalValue(inventory) {
|
|
226
|
+
const locationWithCost = inventory.locations.find(loc => loc.unitCost);
|
|
227
|
+
if (!locationWithCost?.unitCost) {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
amount: inventory.totals.onHand * locationWithCost.unitCost.amount,
|
|
232
|
+
currency: locationWithCost.unitCost.currency,
|
|
233
|
+
};
|
|
234
|
+
},
|
|
235
|
+
/**
|
|
236
|
+
* Calculate days of supply
|
|
237
|
+
*/
|
|
238
|
+
getDaysOfSupply(inventory, averageDailySales) {
|
|
239
|
+
if (averageDailySales === 0) {
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
242
|
+
return Math.floor(inventory.totals.available / averageDailySales);
|
|
243
|
+
},
|
|
244
|
+
/**
|
|
245
|
+
* Check if reorder is needed
|
|
246
|
+
*/
|
|
247
|
+
needsReorder(inventory) {
|
|
248
|
+
const hasReorderPoint = inventory.locations.some(loc => loc.reorderPoint);
|
|
249
|
+
if (!hasReorderPoint) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
return inventory.locations.some(loc => loc.reorderPoint && loc.quantityAvailable <= loc.reorderPoint);
|
|
253
|
+
},
|
|
254
|
+
/**
|
|
255
|
+
* Get recommended reorder quantity
|
|
256
|
+
*/
|
|
257
|
+
getReorderQuantity(inventory) {
|
|
258
|
+
// Sum up reorder quantities from all locations that need reordering
|
|
259
|
+
return inventory.locations.reduce((sum, loc) => {
|
|
260
|
+
if (loc.reorderPoint && loc.quantityAvailable <= loc.reorderPoint) {
|
|
261
|
+
return sum + (loc.reorderQuantity || 0);
|
|
262
|
+
}
|
|
263
|
+
return sum;
|
|
264
|
+
}, 0);
|
|
265
|
+
},
|
|
266
|
+
/**
|
|
267
|
+
* Calculate inventory turnover rate
|
|
268
|
+
*/
|
|
269
|
+
getTurnoverRate(inventory, soldInPeriod, periodDays = 365) {
|
|
270
|
+
if (inventory.totals.onHand === 0) {
|
|
271
|
+
return 0;
|
|
272
|
+
}
|
|
273
|
+
const averageInventory = inventory.totals.onHand;
|
|
274
|
+
return (soldInPeriod / averageInventory) * (365 / periodDays);
|
|
275
|
+
},
|
|
276
|
+
/**
|
|
277
|
+
* Get locations that need attention
|
|
278
|
+
*/
|
|
279
|
+
getLocationsNeedingAttention(inventory) {
|
|
280
|
+
return {
|
|
281
|
+
lowStock: inventory.locations.filter(loc => loc.reorderPoint && loc.quantityAvailable <= loc.reorderPoint),
|
|
282
|
+
needReorder: inventory.locations.filter(loc => loc.reorderPoint && loc.quantityOnHand <= loc.reorderPoint),
|
|
283
|
+
damaged: inventory.locations.filter(loc => (loc.quantityDamaged || 0) > 0),
|
|
284
|
+
};
|
|
285
|
+
},
|
|
286
|
+
/**
|
|
287
|
+
* Format inventory status
|
|
288
|
+
*/
|
|
289
|
+
getStatusText(inventory) {
|
|
290
|
+
if (!inventory.tracked) {
|
|
291
|
+
return 'Not tracked';
|
|
292
|
+
}
|
|
293
|
+
if (this.isOutOfStock(inventory)) {
|
|
294
|
+
return inventory.allowBackorder ? 'Out of stock (backorder)' : 'Out of stock';
|
|
295
|
+
}
|
|
296
|
+
if (this.isLowStock(inventory)) {
|
|
297
|
+
return `Low stock (${inventory.totals.available} available)`;
|
|
298
|
+
}
|
|
299
|
+
return `In stock (${inventory.totals.available} available)`;
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
//# sourceMappingURL=inventory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inventory.js","sourceRoot":"","sources":["../../src/schemas/inventory.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAC9C,6BAAwB;AACxB,4CAA8D;AAE9D,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAElE,QAAA,YAAY,GAAG,OAAC,CAAC,IAAI,CAAC;IACjC,WAAW,EAAK,sBAAsB;IACtC,OAAO,EAAS,eAAe;IAC/B,UAAU,EAAM,uBAAuB;IACvC,UAAU,EAAM,qBAAqB;IACrC,SAAS,EAAO,2BAA2B;IAC3C,aAAa,EAAG,uBAAuB;IACvC,SAAS,EAAO,uBAAuB;CACxC,CAAC,CAAC;AAIU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,2DAA2D;IAC7E,IAAI,EAAE,oBAAY;IAClB,OAAO,EAAE,sBAAa,CAAC,QAAQ,EAAE;IAEjC,eAAe;IACf,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;IAE3C,SAAS;IACT,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,mBAAmB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