@naisys/erp-shared 3.0.0-beta.26 → 3.0.0-beta.27

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.
@@ -22,6 +22,8 @@ export const OperationRunSchema = z.object({
22
22
  id: z.number(),
23
23
  orderRunId: z.number(),
24
24
  operationId: z.number(),
25
+ revNo: z.number(),
26
+ orderDescription: z.string(),
25
27
  seqNo: z.number(),
26
28
  title: z.string(),
27
29
  description: z.string(),
@@ -29,6 +29,7 @@ export const OrderRunSchema = z.object({
29
29
  orderId: z.number(),
30
30
  orderKey: z.string(),
31
31
  revNo: z.number(),
32
+ description: z.string(),
32
33
  itemKey: z.string().nullable(),
33
34
  instanceId: z.number().nullable(),
34
35
  instanceKey: z.string().nullable(),
@@ -142,3 +143,30 @@ export const DispatchListResponseSchema = z.object({
142
143
  _linkTemplates: z.array(HateoasLinkTemplateSchema).optional(),
143
144
  _actionTemplates: z.array(HateoasActionTemplateSchema).optional(),
144
145
  });
146
+ // Query params for ready-to-close view: open order runs with no open ops
147
+ export const ReadyToCloseListQuerySchema = z.object({
148
+ ...paginationQuery(),
149
+ priority: OrderRunPriorityEnum.optional(),
150
+ search: z.string().optional(),
151
+ });
152
+ // Ready-to-close item = order run whose ops are all completed/skipped
153
+ export const ReadyToCloseItemSchema = z.object({
154
+ id: z.number(),
155
+ orderKey: z.string(),
156
+ revNo: z.number(),
157
+ runNo: z.number(),
158
+ description: z.string(),
159
+ status: OrderRunStatusEnum,
160
+ priority: OrderRunPriorityEnum,
161
+ dueAt: z.string().nullable(),
162
+ opCount: z.number(),
163
+ createdAt: z.iso.datetime(),
164
+ });
165
+ export const ReadyToCloseListResponseSchema = z.object({
166
+ items: z.array(ReadyToCloseItemSchema),
167
+ total: z.number(),
168
+ page: z.number(),
169
+ pageSize: z.number(),
170
+ _links: z.array(HateoasLinkSchema),
171
+ _linkTemplates: z.array(HateoasLinkTemplateSchema).optional(),
172
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naisys/erp-shared",
3
- "version": "3.0.0-beta.26",
3
+ "version": "3.0.0-beta.27",
4
4
  "description": "[internal] NAISYS ERP shared types and validation schemas",
5
5
  "type": "module",
6
6
  "files": [
@@ -20,7 +20,7 @@
20
20
  "typescript": "^5.9.3"
21
21
  },
22
22
  "dependencies": {
23
- "@naisys/common": "3.0.0-beta.26",
23
+ "@naisys/common": "3.0.0-beta.27",
24
24
  "zod": "^4.3.6"
25
25
  },
26
26
  "exports": {