@composable-os/pack-equipment 0.0.0-stage → 0.1.0-beta.15
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/LICENSE +109 -0
- package/dist/index.d.ts +566 -0
- package/dist/index.js +366 -0
- package/dist/tools.d.ts +216 -0
- package/dist/tools.js +767 -0
- package/package.json +31 -4
- package/README.md +0 -3
package/dist/index.js
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
// Equipment (stage 59, step 3; ADR 0862): the register of what a business owns and must look
|
|
2
|
+
// after (a gym's treadmills, racks and sauna; a tradesperson's tools, test gear and vans), and the
|
|
3
|
+
// faults staff report on it. Any product can turn it on (`packs` in its product.ts); it needs no
|
|
4
|
+
// other pack.
|
|
5
|
+
//
|
|
6
|
+
// Everything that is a rule is the host's, declared here as behaviours (ADR 0404):
|
|
7
|
+
// - an item's tag (the code on its sticker) is `unique` among items in or out of service (ADR
|
|
8
|
+
// 0502), folded (ADR 0864: case and outer spaces never count, the host keeps it trimmed and
|
|
9
|
+
// upper case): the database refuses a second, however it is written (a form, the assistant,
|
|
10
|
+
// an import). A retired item gives its tag up, for the replacement wearing the old sticker;
|
|
11
|
+
// - a record in a state only tools leave stays out of the Trash but for those tools' hands
|
|
12
|
+
// (ADR 0863): an out-of-service item, or an open fault, is not made to vanish by a member; an
|
|
13
|
+
// open fault holds its item (`holds`), so an item with open faults is a manager's to Trash;
|
|
14
|
+
// - the tag is given when the item is added (by the form or the admin's import) and then
|
|
15
|
+
// changed only by a manager's `correctTag` (`lockedIn` every state, ADR 0865), and a fault's
|
|
16
|
+
// item is the report's (`readOnly`): no retag or re-point frees a sticker or moves a safety
|
|
17
|
+
// risk;
|
|
18
|
+
// - why an item is out, and a fault's severity and words once reported, are written by the
|
|
19
|
+
// pack's tools only (`readOnly`), so a safety risk is never quietly lowered; a manager
|
|
20
|
+
// corrects them with `correctOutReason` and `correctFault`;
|
|
21
|
+
// - an item is in service, out of service or retired (`states`, ADR 0425). Out of service is a
|
|
22
|
+
// move only the tools `takeOut` and `reportFault` make (ADR 0513), for anyone holding
|
|
23
|
+
// `equipment:report`, and an AI's call waits for a person (`personApproves`, ADR 0552). Back
|
|
24
|
+
// in service is a move only `putBack` makes: a person's own act (`humanOnly`), and only with
|
|
25
|
+
// `equipment:manage` (decision 4). Retiring is `retire`'s, a manager's (ADR 0625);
|
|
26
|
+
// - a fault is reported, acknowledged, then fixed, not a fault or a duplicate; every move after
|
|
27
|
+
// the report is `triage`'s, a manager's, and every close says why.
|
|
28
|
+
// The tools in tools.ts compose the host's operations and add no rule of their own.
|
|
29
|
+
//
|
|
30
|
+
// Service plans and maintenance (step 4), the member's report and what members read (step 5),
|
|
31
|
+
// automations, the dashboard and views (step 6), and the blocks (step 7) come later.
|
|
32
|
+
import { defineExtension } from "@composable-os/sdk";
|
|
33
|
+
import { correctFault, correctOutReason, correctTag, FAULT, ITEM, item, MANAGE, putBack, REPORT, register, reportFault, reportFaultOnly, retire, takeOut, triage, } from "./tools.js";
|
|
34
|
+
/** The categories a register starts with (decision 1: to be checked with the business). */
|
|
35
|
+
const CATEGORIES = [
|
|
36
|
+
{ value: "cardio", label: "Cardio" },
|
|
37
|
+
{ value: "strength", label: "Strength" },
|
|
38
|
+
{ value: "free_weights", label: "Free weights" },
|
|
39
|
+
{ value: "studio", label: "Studio" },
|
|
40
|
+
{ value: "wet_area", label: "Wet area" },
|
|
41
|
+
{ value: "tool", label: "Tool" },
|
|
42
|
+
{ value: "test_gear", label: "Test gear" },
|
|
43
|
+
{ value: "vehicle", label: "Vehicle" },
|
|
44
|
+
{ value: "other", label: "Other" },
|
|
45
|
+
];
|
|
46
|
+
/** The fault moves `triage` makes: from either open state, each with why. */
|
|
47
|
+
const OPEN_FAULT = ["reported", "acknowledged"];
|
|
48
|
+
export default defineExtension({
|
|
49
|
+
id: "equipment",
|
|
50
|
+
version: "0.1.0",
|
|
51
|
+
contractVersion: 1,
|
|
52
|
+
label: "Equipment",
|
|
53
|
+
description: "A register of what the business owns and looks after, with tags, suppliers, costs and " +
|
|
54
|
+
"warranties; faults reported by staff; items taken out of service by any staff member and " +
|
|
55
|
+
"put back by a manager.",
|
|
56
|
+
permissions: {
|
|
57
|
+
// query.sql: the register's one read, items with their supplier and open faults over the
|
|
58
|
+
// rec_* views. organisation: the supplier's name on an item.
|
|
59
|
+
read: ["organisation"],
|
|
60
|
+
operations: ["query.sql"],
|
|
61
|
+
modules: ["ops"],
|
|
62
|
+
},
|
|
63
|
+
// Reporting (and taking out of service) is every staff member's, and a coach's or a cleaner's
|
|
64
|
+
// when an admin grants it (ADR 0600). Managing is restricted (ADR 0625): admins hold it, and
|
|
65
|
+
// whoever an admin grants it to.
|
|
66
|
+
grantable: [REPORT, MANAGE],
|
|
67
|
+
restricted: [MANAGE],
|
|
68
|
+
grantableLabels: {
|
|
69
|
+
[REPORT]: "Equipment: see the register, report a fault and take an item out of service. For a " +
|
|
70
|
+
"coach, a cleaner or anyone with another role who works on the floor.",
|
|
71
|
+
[MANAGE]: "Equipment: put items back in service, retire them, acknowledge and close faults, and " +
|
|
72
|
+
"correct a fault's report, why an item is out of service or an item's tag",
|
|
73
|
+
},
|
|
74
|
+
objects: {
|
|
75
|
+
item: {
|
|
76
|
+
label: "Item",
|
|
77
|
+
plural: "Equipment",
|
|
78
|
+
icon: "wrench",
|
|
79
|
+
titleField: "name",
|
|
80
|
+
owner: "keeper",
|
|
81
|
+
description: "One thing the business owns and looks after: a machine, a rack, a tool, a van. In " +
|
|
82
|
+
"service, out of service (why, since when) or retired. Its tag is the code on its " +
|
|
83
|
+
"sticker, unique in the register.",
|
|
84
|
+
navigation: "main",
|
|
85
|
+
navigationOrder: 70,
|
|
86
|
+
fields: {
|
|
87
|
+
name: { type: "text", label: "Name", required: true },
|
|
88
|
+
category: {
|
|
89
|
+
type: "select",
|
|
90
|
+
label: "Category",
|
|
91
|
+
editableOptions: true,
|
|
92
|
+
options: CATEGORIES,
|
|
93
|
+
},
|
|
94
|
+
place: {
|
|
95
|
+
type: "text",
|
|
96
|
+
label: "Place",
|
|
97
|
+
description: "Where it is: a room, an area of the floor, a van.",
|
|
98
|
+
},
|
|
99
|
+
tag: {
|
|
100
|
+
type: "text",
|
|
101
|
+
label: "Tag",
|
|
102
|
+
description: "The code on its sticker. No two items in the register share one; an import matches " +
|
|
103
|
+
"on it. Given when the item is added; after that only a manager changes it " +
|
|
104
|
+
"(correctTag).",
|
|
105
|
+
// The sticker stays with its machine (ADR 0865, the review of PR #502): once the item
|
|
106
|
+
// exists, in any state, only the pack's correctTag (a manager's) changes it. So no
|
|
107
|
+
// retag, before or after a take-out or under an open fault, frees it for a new item.
|
|
108
|
+
lockedIn: ["in_service", "out_of_service", "retired"],
|
|
109
|
+
},
|
|
110
|
+
make: { type: "text", label: "Make" },
|
|
111
|
+
model: { type: "text", label: "Model" },
|
|
112
|
+
serial: { type: "text", label: "Serial number" },
|
|
113
|
+
boughtOn: { type: "date", label: "Bought on" },
|
|
114
|
+
cost: {
|
|
115
|
+
type: "currency",
|
|
116
|
+
label: "Cost",
|
|
117
|
+
min: 0,
|
|
118
|
+
description: "What it cost to buy, in the base currency. Seen by every staff member.",
|
|
119
|
+
},
|
|
120
|
+
supplier: {
|
|
121
|
+
type: "relation",
|
|
122
|
+
label: "Supplier",
|
|
123
|
+
to: "organisation",
|
|
124
|
+
description: "Who supplied it, and who services it under warranty.",
|
|
125
|
+
},
|
|
126
|
+
warrantyUntil: { type: "date", label: "Warranty until" },
|
|
127
|
+
warrantyNotes: { type: "longText", label: "Warranty notes" },
|
|
128
|
+
photo: { type: "image", label: "Photo" },
|
|
129
|
+
keeper: {
|
|
130
|
+
type: "user",
|
|
131
|
+
label: "Keeper",
|
|
132
|
+
description: "Who looks after it. Empty: the managers.",
|
|
133
|
+
},
|
|
134
|
+
issuedTo: {
|
|
135
|
+
type: "user",
|
|
136
|
+
label: "Who has it",
|
|
137
|
+
description: "Who has it now (a tool or a van out with someone).",
|
|
138
|
+
},
|
|
139
|
+
renewalDue: {
|
|
140
|
+
type: "date",
|
|
141
|
+
label: "Renewal due",
|
|
142
|
+
description: "A date it must be renewed by (a van's registration).",
|
|
143
|
+
},
|
|
144
|
+
listForMembers: {
|
|
145
|
+
type: "select",
|
|
146
|
+
label: "Listed for members",
|
|
147
|
+
default: "not_listed",
|
|
148
|
+
options: [
|
|
149
|
+
{ value: "listed", label: "Listed" },
|
|
150
|
+
{ value: "not_listed", label: "Not listed" },
|
|
151
|
+
],
|
|
152
|
+
description: "Whether members may see it in the out-of-order list. Not listed until someone " +
|
|
153
|
+
"chooses; retiring an item unlists it.",
|
|
154
|
+
},
|
|
155
|
+
state: {
|
|
156
|
+
type: "select",
|
|
157
|
+
label: "State",
|
|
158
|
+
default: "in_service",
|
|
159
|
+
track: "timeline",
|
|
160
|
+
options: [
|
|
161
|
+
{ value: "in_service", label: "In service", color: "green" },
|
|
162
|
+
{ value: "out_of_service", label: "Out of service", color: "red" },
|
|
163
|
+
{ value: "retired", label: "Retired", color: "gray" },
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
outSince: {
|
|
167
|
+
type: "datetime",
|
|
168
|
+
label: "Out of service since",
|
|
169
|
+
readOnly: true,
|
|
170
|
+
description: "When it was taken out of service. Set when it is taken out, cleared when put back.",
|
|
171
|
+
},
|
|
172
|
+
outReason: {
|
|
173
|
+
type: "text",
|
|
174
|
+
label: "Why out of service",
|
|
175
|
+
readOnly: true,
|
|
176
|
+
description: "Why it must not be used. Given when it is taken out; written only by the tools " +
|
|
177
|
+
"(a manager corrects it with correctOutReason), cleared when it is put back.",
|
|
178
|
+
},
|
|
179
|
+
notes: { type: "longText", label: "Notes" },
|
|
180
|
+
retiredFlag: {
|
|
181
|
+
type: "formula",
|
|
182
|
+
label: "Retired",
|
|
183
|
+
description: "True once retired: no fault is reported on it any more.",
|
|
184
|
+
expression: 'coalesce(state, "in_service") == "retired"',
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
indexes: [["state", "category"], ["category"], ["keeper"], ["warrantyUntil"]],
|
|
188
|
+
// The code on its sticker names one item in or out of service (ADR 0502): the database
|
|
189
|
+
// refuses the second, whoever writes it, an import included. Folded (ADR 0864): `tm-03 `
|
|
190
|
+
// is `TM-03`. A retired item gives its tag up to its replacement; one without a tag is
|
|
191
|
+
// not compared.
|
|
192
|
+
unique: [{ fields: ["tag"], states: ["in_service", "out_of_service"], fold: true }],
|
|
193
|
+
states: {
|
|
194
|
+
field: "state",
|
|
195
|
+
initial: "in_service",
|
|
196
|
+
moves: [
|
|
197
|
+
// Any staff member with equipment:report, through the two tools only (decision 4);
|
|
198
|
+
// an AI's call waits for a person (personApproves, ADR 0552). Never a record write.
|
|
199
|
+
{
|
|
200
|
+
from: "in_service",
|
|
201
|
+
to: "out_of_service",
|
|
202
|
+
by: ["host"],
|
|
203
|
+
tools: ["takeOut", "reportFault"],
|
|
204
|
+
requires: ["outReason"],
|
|
205
|
+
},
|
|
206
|
+
// Back in service: a person with equipment:manage, never an AI (humanOnly).
|
|
207
|
+
{ from: "out_of_service", to: "in_service", by: ["host"], tools: ["putBack"] },
|
|
208
|
+
// Retired: a manager's, with why, and unlisted for members in the same write.
|
|
209
|
+
{
|
|
210
|
+
from: ["in_service", "out_of_service"],
|
|
211
|
+
to: "retired",
|
|
212
|
+
by: ["host"],
|
|
213
|
+
tools: ["retire"],
|
|
214
|
+
requires: ["notes"],
|
|
215
|
+
final: true,
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
fault: {
|
|
221
|
+
label: "Fault",
|
|
222
|
+
plural: "Faults",
|
|
223
|
+
icon: "triangle-alert",
|
|
224
|
+
titleField: "title",
|
|
225
|
+
titleDefault: { from: ["item"], suffix: "fault" },
|
|
226
|
+
description: "A report that something is wrong with an item: what is wrong and how bad. Reported by " +
|
|
227
|
+
"staff, then acknowledged and closed as fixed, not a fault or a duplicate by a manager.",
|
|
228
|
+
navigation: "main",
|
|
229
|
+
navigationOrder: 71,
|
|
230
|
+
fields: {
|
|
231
|
+
title: { type: "text", label: "Title" },
|
|
232
|
+
// The item the report is about: set by the report tools, never re-pointed (a safety risk
|
|
233
|
+
// does not move to another machine).
|
|
234
|
+
item: {
|
|
235
|
+
type: "relation",
|
|
236
|
+
label: "Item",
|
|
237
|
+
to: "equipment.item",
|
|
238
|
+
readOnly: true,
|
|
239
|
+
},
|
|
240
|
+
// What is wrong and how bad are the report's, written by the report tools only (a
|
|
241
|
+
// manager corrects them with correctFault): a safety risk is never quietly lowered.
|
|
242
|
+
description: {
|
|
243
|
+
type: "longText",
|
|
244
|
+
label: "What is wrong",
|
|
245
|
+
readOnly: true,
|
|
246
|
+
description: "What is wrong with it. Do not describe an injury here.",
|
|
247
|
+
},
|
|
248
|
+
severity: {
|
|
249
|
+
type: "select",
|
|
250
|
+
label: "How bad",
|
|
251
|
+
default: "not_working",
|
|
252
|
+
readOnly: true,
|
|
253
|
+
options: [
|
|
254
|
+
{ value: "safety_risk", label: "Safety risk", color: "red" },
|
|
255
|
+
{ value: "not_working", label: "Not working", color: "orange" },
|
|
256
|
+
{ value: "worn", label: "Worn or cosmetic", color: "gray" },
|
|
257
|
+
],
|
|
258
|
+
},
|
|
259
|
+
photo: { type: "image", label: "Photo" },
|
|
260
|
+
reportedBy: {
|
|
261
|
+
type: "user",
|
|
262
|
+
label: "Reported by",
|
|
263
|
+
readOnly: true,
|
|
264
|
+
description: "The staff member who reported it, set by the report.",
|
|
265
|
+
},
|
|
266
|
+
reportedByName: { type: "text", label: "Reported by (name)", readOnly: true },
|
|
267
|
+
reportKey: {
|
|
268
|
+
type: "text",
|
|
269
|
+
label: "Report key",
|
|
270
|
+
readOnly: true,
|
|
271
|
+
description: "Set by the report: the same report again, or a retry, finds this fault while it is open.",
|
|
272
|
+
},
|
|
273
|
+
state: {
|
|
274
|
+
type: "select",
|
|
275
|
+
label: "State",
|
|
276
|
+
default: "reported",
|
|
277
|
+
track: "timeline",
|
|
278
|
+
options: [
|
|
279
|
+
{ value: "reported", label: "Reported", color: "orange" },
|
|
280
|
+
{ value: "acknowledged", label: "Acknowledged", color: "blue" },
|
|
281
|
+
{ value: "fixed", label: "Fixed", color: "green" },
|
|
282
|
+
{ value: "not_a_fault", label: "Not a fault", color: "gray" },
|
|
283
|
+
{ value: "duplicate", label: "Duplicate", color: "gray" },
|
|
284
|
+
],
|
|
285
|
+
},
|
|
286
|
+
closedWhy: {
|
|
287
|
+
type: "text",
|
|
288
|
+
label: "Closed because",
|
|
289
|
+
description: "Why it was closed: what fixed it, or why it is not a fault.",
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
indexes: [
|
|
293
|
+
["item", "state"],
|
|
294
|
+
["state", "severity"],
|
|
295
|
+
],
|
|
296
|
+
// One open fault per report (a retry of a call stopped part way makes no second).
|
|
297
|
+
unique: [{ fields: ["reportKey"], states: OPEN_FAULT }],
|
|
298
|
+
states: {
|
|
299
|
+
field: "state",
|
|
300
|
+
initial: "reported",
|
|
301
|
+
// Nobody reports a fault on a retired item, staff and tools included.
|
|
302
|
+
// Every report names its item (read-only, so `required` is the create rule's).
|
|
303
|
+
create: { closed: "item.retiredFlag", requires: ["item"] },
|
|
304
|
+
// While open, a fault keeps its item out of the Trash but for whoever may triage it (ADR
|
|
305
|
+
// 0863, amended): the safety risk never leaves the register with the item.
|
|
306
|
+
holds: "item",
|
|
307
|
+
// Triage is a manager's (equipment:manage), through `triage` only: a record write cannot
|
|
308
|
+
// close a fault, and an AI's triage waits for a person.
|
|
309
|
+
moves: [
|
|
310
|
+
{ from: "reported", to: "acknowledged", by: ["host"], tools: ["triage"] },
|
|
311
|
+
{
|
|
312
|
+
from: OPEN_FAULT,
|
|
313
|
+
to: "fixed",
|
|
314
|
+
by: ["host"],
|
|
315
|
+
tools: ["triage"],
|
|
316
|
+
requires: ["closedWhy"],
|
|
317
|
+
final: true,
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
from: OPEN_FAULT,
|
|
321
|
+
to: "not_a_fault",
|
|
322
|
+
by: ["host"],
|
|
323
|
+
tools: ["triage"],
|
|
324
|
+
requires: ["closedWhy"],
|
|
325
|
+
final: true,
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
from: OPEN_FAULT,
|
|
329
|
+
to: "duplicate",
|
|
330
|
+
by: ["host"],
|
|
331
|
+
tools: ["triage"],
|
|
332
|
+
requires: ["closedWhy"],
|
|
333
|
+
final: true,
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
recordTabs: {
|
|
340
|
+
itemFaults: {
|
|
341
|
+
label: "Faults",
|
|
342
|
+
on: ITEM,
|
|
343
|
+
view: {
|
|
344
|
+
type: "table",
|
|
345
|
+
object: FAULT,
|
|
346
|
+
relation: "item",
|
|
347
|
+
columns: ["title", "severity", "state", "reportedByName", "createdAt"],
|
|
348
|
+
sort: { field: "createdAt", direction: "desc" },
|
|
349
|
+
},
|
|
350
|
+
order: 10,
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
tools: {
|
|
354
|
+
register,
|
|
355
|
+
item,
|
|
356
|
+
reportFault,
|
|
357
|
+
reportFaultOnly,
|
|
358
|
+
takeOut,
|
|
359
|
+
putBack,
|
|
360
|
+
retire,
|
|
361
|
+
triage,
|
|
362
|
+
correctFault,
|
|
363
|
+
correctOutReason,
|
|
364
|
+
correctTag,
|
|
365
|
+
},
|
|
366
|
+
});
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { z } from "@composable-os/sdk";
|
|
2
|
+
export declare const ITEM = "equipment.item";
|
|
3
|
+
export declare const FAULT = "equipment.fault";
|
|
4
|
+
export declare const REPORT = "equipment:report";
|
|
5
|
+
export declare const MANAGE = "equipment:manage";
|
|
6
|
+
/** The most items one call lists. */
|
|
7
|
+
export declare const REGISTER_LIMIT = 200;
|
|
8
|
+
export declare const register: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
9
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
10
|
+
in_service: "in_service";
|
|
11
|
+
out_of_service: "out_of_service";
|
|
12
|
+
retired: "retired";
|
|
13
|
+
}>>;
|
|
14
|
+
category: z.ZodOptional<z.ZodString>;
|
|
15
|
+
place: z.ZodOptional<z.ZodString>;
|
|
16
|
+
q: z.ZodOptional<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
items: z.ZodArray<z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
name: z.ZodNullable<z.ZodString>;
|
|
21
|
+
tag: z.ZodNullable<z.ZodString>;
|
|
22
|
+
category: z.ZodNullable<z.ZodString>;
|
|
23
|
+
place: z.ZodNullable<z.ZodString>;
|
|
24
|
+
state: z.ZodNullable<z.ZodEnum<{
|
|
25
|
+
in_service: "in_service";
|
|
26
|
+
out_of_service: "out_of_service";
|
|
27
|
+
retired: "retired";
|
|
28
|
+
}>>;
|
|
29
|
+
outSince: z.ZodNullable<z.ZodString>;
|
|
30
|
+
outReason: z.ZodNullable<z.ZodString>;
|
|
31
|
+
keeper: z.ZodNullable<z.ZodString>;
|
|
32
|
+
issuedTo: z.ZodNullable<z.ZodString>;
|
|
33
|
+
supplier: z.ZodNullable<z.ZodString>;
|
|
34
|
+
warrantyUntil: z.ZodNullable<z.ZodString>;
|
|
35
|
+
openFaults: z.ZodNumber;
|
|
36
|
+
safetyRisks: z.ZodNumber;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
truncated: z.ZodBoolean;
|
|
39
|
+
}, z.core.$strip>>;
|
|
40
|
+
/** The most faults one item's answer lists. */
|
|
41
|
+
export declare const ITEM_FAULTS_LIMIT = 50;
|
|
42
|
+
export declare const item: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
43
|
+
itemId: z.ZodString;
|
|
44
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
45
|
+
id: z.ZodString;
|
|
46
|
+
name: z.ZodNullable<z.ZodString>;
|
|
47
|
+
tag: z.ZodNullable<z.ZodString>;
|
|
48
|
+
category: z.ZodNullable<z.ZodString>;
|
|
49
|
+
place: z.ZodNullable<z.ZodString>;
|
|
50
|
+
make: z.ZodNullable<z.ZodString>;
|
|
51
|
+
model: z.ZodNullable<z.ZodString>;
|
|
52
|
+
serial: z.ZodNullable<z.ZodString>;
|
|
53
|
+
state: z.ZodNullable<z.ZodEnum<{
|
|
54
|
+
in_service: "in_service";
|
|
55
|
+
out_of_service: "out_of_service";
|
|
56
|
+
retired: "retired";
|
|
57
|
+
}>>;
|
|
58
|
+
outSince: z.ZodNullable<z.ZodString>;
|
|
59
|
+
outReason: z.ZodNullable<z.ZodString>;
|
|
60
|
+
keeper: z.ZodNullable<z.ZodString>;
|
|
61
|
+
issuedTo: z.ZodNullable<z.ZodString>;
|
|
62
|
+
supplierId: z.ZodNullable<z.ZodString>;
|
|
63
|
+
supplier: z.ZodNullable<z.ZodString>;
|
|
64
|
+
boughtOn: z.ZodNullable<z.ZodString>;
|
|
65
|
+
warrantyUntil: z.ZodNullable<z.ZodString>;
|
|
66
|
+
warrantyNotes: z.ZodNullable<z.ZodString>;
|
|
67
|
+
renewalDue: z.ZodNullable<z.ZodString>;
|
|
68
|
+
listForMembers: z.ZodNullable<z.ZodString>;
|
|
69
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
70
|
+
costs: z.ZodObject<{
|
|
71
|
+
purchase: z.ZodNullable<z.ZodNumber>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
faults: z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.ZodString;
|
|
75
|
+
title: z.ZodNullable<z.ZodString>;
|
|
76
|
+
description: z.ZodNullable<z.ZodString>;
|
|
77
|
+
severity: z.ZodNullable<z.ZodEnum<{
|
|
78
|
+
safety_risk: "safety_risk";
|
|
79
|
+
not_working: "not_working";
|
|
80
|
+
worn: "worn";
|
|
81
|
+
}>>;
|
|
82
|
+
state: z.ZodNullable<z.ZodEnum<{
|
|
83
|
+
fixed: "fixed";
|
|
84
|
+
reported: "reported";
|
|
85
|
+
acknowledged: "acknowledged";
|
|
86
|
+
not_a_fault: "not_a_fault";
|
|
87
|
+
duplicate: "duplicate";
|
|
88
|
+
}>>;
|
|
89
|
+
reportedBy: z.ZodNullable<z.ZodString>;
|
|
90
|
+
reportedByName: z.ZodNullable<z.ZodString>;
|
|
91
|
+
closedWhy: z.ZodNullable<z.ZodString>;
|
|
92
|
+
reportedAt: z.ZodNullable<z.ZodString>;
|
|
93
|
+
underWarranty: z.ZodBoolean;
|
|
94
|
+
}, z.core.$strip>>;
|
|
95
|
+
moreFaults: z.ZodBoolean;
|
|
96
|
+
}, z.core.$strip>>;
|
|
97
|
+
export declare const reportFault: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
98
|
+
takeOut: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
reason: z.ZodString;
|
|
100
|
+
}, z.core.$strip>>;
|
|
101
|
+
itemId: z.ZodString;
|
|
102
|
+
description: z.ZodString;
|
|
103
|
+
severity: z.ZodEnum<{
|
|
104
|
+
safety_risk: "safety_risk";
|
|
105
|
+
not_working: "not_working";
|
|
106
|
+
worn: "worn";
|
|
107
|
+
}>;
|
|
108
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
110
|
+
faultId: z.ZodString;
|
|
111
|
+
itemId: z.ZodString;
|
|
112
|
+
alreadyReported: z.ZodBoolean;
|
|
113
|
+
takenOut: z.ZodBoolean;
|
|
114
|
+
takeOutFailed: z.ZodNullable<z.ZodString>;
|
|
115
|
+
itemState: z.ZodNullable<z.ZodEnum<{
|
|
116
|
+
in_service: "in_service";
|
|
117
|
+
out_of_service: "out_of_service";
|
|
118
|
+
retired: "retired";
|
|
119
|
+
}>>;
|
|
120
|
+
underWarranty: z.ZodBoolean;
|
|
121
|
+
message: z.ZodString;
|
|
122
|
+
}, z.core.$strip>>;
|
|
123
|
+
export declare const reportFaultOnly: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
124
|
+
itemId: z.ZodString;
|
|
125
|
+
description: z.ZodString;
|
|
126
|
+
severity: z.ZodEnum<{
|
|
127
|
+
safety_risk: "safety_risk";
|
|
128
|
+
not_working: "not_working";
|
|
129
|
+
worn: "worn";
|
|
130
|
+
}>;
|
|
131
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
133
|
+
faultId: z.ZodString;
|
|
134
|
+
itemId: z.ZodString;
|
|
135
|
+
alreadyReported: z.ZodBoolean;
|
|
136
|
+
takenOut: z.ZodBoolean;
|
|
137
|
+
takeOutFailed: z.ZodNullable<z.ZodString>;
|
|
138
|
+
itemState: z.ZodNullable<z.ZodEnum<{
|
|
139
|
+
in_service: "in_service";
|
|
140
|
+
out_of_service: "out_of_service";
|
|
141
|
+
retired: "retired";
|
|
142
|
+
}>>;
|
|
143
|
+
underWarranty: z.ZodBoolean;
|
|
144
|
+
message: z.ZodString;
|
|
145
|
+
}, z.core.$strip>>;
|
|
146
|
+
export declare const takeOut: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
147
|
+
itemId: z.ZodString;
|
|
148
|
+
reason: z.ZodString;
|
|
149
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
150
|
+
itemId: z.ZodString;
|
|
151
|
+
state: z.ZodLiteral<"out_of_service">;
|
|
152
|
+
outSince: z.ZodString;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
export declare const putBack: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
155
|
+
itemId: z.ZodString;
|
|
156
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
157
|
+
itemId: z.ZodString;
|
|
158
|
+
state: z.ZodLiteral<"in_service">;
|
|
159
|
+
}, z.core.$strip>>;
|
|
160
|
+
export declare const retire: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
161
|
+
itemId: z.ZodString;
|
|
162
|
+
reason: z.ZodString;
|
|
163
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
164
|
+
itemId: z.ZodString;
|
|
165
|
+
state: z.ZodLiteral<"retired">;
|
|
166
|
+
}, z.core.$strip>>;
|
|
167
|
+
export declare const triage: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
168
|
+
faultId: z.ZodString;
|
|
169
|
+
action: z.ZodEnum<{
|
|
170
|
+
fixed: "fixed";
|
|
171
|
+
not_a_fault: "not_a_fault";
|
|
172
|
+
duplicate: "duplicate";
|
|
173
|
+
acknowledge: "acknowledge";
|
|
174
|
+
}>;
|
|
175
|
+
why: z.ZodOptional<z.ZodString>;
|
|
176
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
177
|
+
faultId: z.ZodString;
|
|
178
|
+
state: z.ZodEnum<{
|
|
179
|
+
fixed: "fixed";
|
|
180
|
+
reported: "reported";
|
|
181
|
+
acknowledged: "acknowledged";
|
|
182
|
+
not_a_fault: "not_a_fault";
|
|
183
|
+
duplicate: "duplicate";
|
|
184
|
+
}>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
export declare const correctFault: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
187
|
+
faultId: z.ZodString;
|
|
188
|
+
severity: z.ZodOptional<z.ZodEnum<{
|
|
189
|
+
safety_risk: "safety_risk";
|
|
190
|
+
not_working: "not_working";
|
|
191
|
+
worn: "worn";
|
|
192
|
+
}>>;
|
|
193
|
+
description: z.ZodOptional<z.ZodString>;
|
|
194
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
195
|
+
faultId: z.ZodString;
|
|
196
|
+
severity: z.ZodNullable<z.ZodEnum<{
|
|
197
|
+
safety_risk: "safety_risk";
|
|
198
|
+
not_working: "not_working";
|
|
199
|
+
worn: "worn";
|
|
200
|
+
}>>;
|
|
201
|
+
description: z.ZodNullable<z.ZodString>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
203
|
+
export declare const correctOutReason: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
204
|
+
itemId: z.ZodString;
|
|
205
|
+
reason: z.ZodString;
|
|
206
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
207
|
+
itemId: z.ZodString;
|
|
208
|
+
outReason: z.ZodNullable<z.ZodString>;
|
|
209
|
+
}, z.core.$strip>>;
|
|
210
|
+
export declare const correctTag: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
211
|
+
itemId: z.ZodString;
|
|
212
|
+
tag: z.ZodString;
|
|
213
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
214
|
+
itemId: z.ZodString;
|
|
215
|
+
tag: z.ZodNullable<z.ZodString>;
|
|
216
|
+
}, z.core.$strip>>;
|