@kohost/api-client 7.22.0 → 7.23.1

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.
Files changed (99) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/lib/index.d.ts +1 -0
  3. package/dist/lib/index.js +6 -1
  4. package/dist/lib/index.js.map +1 -1
  5. package/dist/lib/serviceContracts.d.ts +27 -0
  6. package/dist/lib/serviceContracts.js +34 -0
  7. package/dist/lib/serviceContracts.js.map +1 -0
  8. package/dist/models/automation.js +1 -0
  9. package/dist/models/automation.js.map +1 -1
  10. package/dist/models/cost.js +5 -0
  11. package/dist/models/cost.js.map +1 -1
  12. package/dist/models/index.d.ts +1 -0
  13. package/dist/models/index.js +3 -1
  14. package/dist/models/index.js.map +1 -1
  15. package/dist/models/serviceContract.d.ts +17 -0
  16. package/dist/models/serviceContract.js +35 -0
  17. package/dist/models/serviceContract.js.map +1 -0
  18. package/dist/models/ticket.js +1 -0
  19. package/dist/models/ticket.js.map +1 -1
  20. package/dist/schemas/automation.d.ts +4 -0
  21. package/dist/schemas/automation.js +4 -0
  22. package/dist/schemas/automation.js.map +1 -1
  23. package/dist/schemas/bill.d.ts +11 -1
  24. package/dist/schemas/bill.js +17 -3
  25. package/dist/schemas/bill.js.map +1 -1
  26. package/dist/schemas/cost.d.ts +36 -1
  27. package/dist/schemas/cost.js +29 -2
  28. package/dist/schemas/cost.js.map +1 -1
  29. package/dist/schemas/index.d.ts +1 -0
  30. package/dist/schemas/index.js +2 -1
  31. package/dist/schemas/serviceContract.d.ts +272 -0
  32. package/dist/schemas/serviceContract.js +220 -0
  33. package/dist/schemas/serviceContract.js.map +1 -0
  34. package/dist/schemas/ticket.d.ts +20 -0
  35. package/dist/schemas/ticket.js +20 -0
  36. package/dist/schemas/ticket.js.map +1 -1
  37. package/dist/useCases/activateServiceContract.d.ts +36 -0
  38. package/dist/useCases/activateServiceContract.js +47 -0
  39. package/dist/useCases/activateServiceContract.js.map +1 -0
  40. package/dist/useCases/addDueContractCosts.d.ts +27 -0
  41. package/dist/useCases/addDueContractCosts.js +47 -0
  42. package/dist/useCases/addDueContractCosts.js.map +1 -0
  43. package/dist/useCases/addServiceContractTicketSchedule.d.ts +36 -0
  44. package/dist/useCases/addServiceContractTicketSchedule.js +47 -0
  45. package/dist/useCases/addServiceContractTicketSchedule.js.map +1 -0
  46. package/dist/useCases/cancelServiceContract.d.ts +36 -0
  47. package/dist/useCases/cancelServiceContract.js +47 -0
  48. package/dist/useCases/cancelServiceContract.js.map +1 -0
  49. package/dist/useCases/createServiceContract.d.ts +27 -0
  50. package/dist/useCases/createServiceContract.js +47 -0
  51. package/dist/useCases/createServiceContract.js.map +1 -0
  52. package/dist/useCases/deleteServiceContract.d.ts +36 -0
  53. package/dist/useCases/deleteServiceContract.js +47 -0
  54. package/dist/useCases/deleteServiceContract.js.map +1 -0
  55. package/dist/useCases/describeOrganizationServiceContract.d.ts +36 -0
  56. package/dist/useCases/describeOrganizationServiceContract.js +47 -0
  57. package/dist/useCases/describeOrganizationServiceContract.js.map +1 -0
  58. package/dist/useCases/describeServiceContract.d.ts +36 -0
  59. package/dist/useCases/describeServiceContract.js +47 -0
  60. package/dist/useCases/describeServiceContract.js.map +1 -0
  61. package/dist/useCases/duplicateServiceContract.d.ts +36 -0
  62. package/dist/useCases/duplicateServiceContract.js +47 -0
  63. package/dist/useCases/duplicateServiceContract.js.map +1 -0
  64. package/dist/useCases/index.d.ts +18 -2
  65. package/dist/useCases/index.js +37 -5
  66. package/dist/useCases/index.js.map +1 -1
  67. package/dist/useCases/listConciergeCostLedger.d.ts +27 -0
  68. package/dist/useCases/listConciergeCostLedger.js +47 -0
  69. package/dist/useCases/listConciergeCostLedger.js.map +1 -0
  70. package/dist/useCases/listConciergeServiceContracts.d.ts +27 -0
  71. package/dist/useCases/listConciergeServiceContracts.js +47 -0
  72. package/dist/useCases/listConciergeServiceContracts.js.map +1 -0
  73. package/dist/useCases/{listConciergeWorkspaceBillLines.d.ts → listOrganizationServiceContracts.d.ts} +6 -6
  74. package/dist/useCases/{listConciergeWorkspaceBillLines.js → listOrganizationServiceContracts.js} +9 -9
  75. package/dist/useCases/listOrganizationServiceContracts.js.map +1 -0
  76. package/dist/useCases/listServiceContractCosts.d.ts +36 -0
  77. package/dist/useCases/listServiceContractCosts.js +47 -0
  78. package/dist/useCases/listServiceContractCosts.js.map +1 -0
  79. package/dist/useCases/listServiceContractTicketSchedules.d.ts +36 -0
  80. package/dist/useCases/listServiceContractTicketSchedules.js +47 -0
  81. package/dist/useCases/listServiceContractTicketSchedules.js.map +1 -0
  82. package/dist/useCases/{describeConciergeBillsSummary.d.ts → listServiceContracts.d.ts} +6 -6
  83. package/dist/useCases/{describeConciergeBillsSummary.js → listServiceContracts.js} +9 -9
  84. package/dist/useCases/listServiceContracts.js.map +1 -0
  85. package/dist/useCases/removeServiceContractTicketSchedule.d.ts +39 -0
  86. package/dist/useCases/removeServiceContractTicketSchedule.js +47 -0
  87. package/dist/useCases/removeServiceContractTicketSchedule.js.map +1 -0
  88. package/dist/useCases/updateServiceContract.d.ts +36 -0
  89. package/dist/useCases/updateServiceContract.js +47 -0
  90. package/dist/useCases/updateServiceContract.js.map +1 -0
  91. package/dist/useCases/updateServiceContractTicketSchedule.d.ts +39 -0
  92. package/dist/useCases/updateServiceContractTicketSchedule.js +47 -0
  93. package/dist/useCases/updateServiceContractTicketSchedule.js.map +1 -0
  94. package/dist/validate.d.ts +23 -0
  95. package/dist/validate.js +4 -1
  96. package/dist/validate.js.map +1 -1
  97. package/package.json +6 -6
  98. package/dist/useCases/describeConciergeBillsSummary.js.map +0 -1
  99. package/dist/useCases/listConciergeWorkspaceBillLines.js.map +0 -1
@@ -0,0 +1,220 @@
1
+ //#region .generated/schemas/serviceContract.ts
2
+ const splitItem = {
3
+ type: "object",
4
+ additionalProperties: false,
5
+ required: [
6
+ "id",
7
+ "propertyId",
8
+ "amount"
9
+ ],
10
+ properties: {
11
+ id: { type: "string" },
12
+ propertyId: {
13
+ type: ["string", "null"],
14
+ description: "Null on an org-wide split."
15
+ },
16
+ label: {
17
+ type: ["string", "null"],
18
+ default: null
19
+ },
20
+ amount: {
21
+ type: "integer",
22
+ minimum: 0,
23
+ description: "This split's share of the customer stream's per-period total, in integer cents. The splits must add up to the total to activate."
24
+ },
25
+ categoryId: {
26
+ type: ["string", "null"],
27
+ default: null,
28
+ description: "The billing category the split's Contract costs arrive under."
29
+ },
30
+ vendorAmount: {
31
+ type: ["integer", "null"],
32
+ minimum: 0,
33
+ default: null,
34
+ description: "This split's share of the vendor stream's per-period total, in integer cents. Null with no vendor stream. With one, the splits' vendor amounts must add up to its total to activate."
35
+ }
36
+ }
37
+ };
38
+ const streamRequired = [
39
+ "amount",
40
+ "cadence",
41
+ "startsAt"
42
+ ];
43
+ const streamProperties = {
44
+ amount: {
45
+ type: "integer",
46
+ minimum: 0,
47
+ description: "The per-period total, in integer cents."
48
+ },
49
+ cadence: {
50
+ type: "object",
51
+ additionalProperties: false,
52
+ required: ["months"],
53
+ properties: { months: {
54
+ type: "integer",
55
+ enum: [
56
+ 1,
57
+ 3,
58
+ 6,
59
+ 12
60
+ ],
61
+ description: "Length of one period in whole months."
62
+ } }
63
+ },
64
+ startsAt: {
65
+ $ref: "definitions.json#/definitions/date",
66
+ description: "The first period's start: any day inside the term. Later periods start on the same day of the month, clamped to a shorter month's last day."
67
+ },
68
+ nextPeriodStartsAt: {
69
+ anyOf: [{ $ref: "definitions.json#/definitions/date" }, { type: "null" }],
70
+ default: null,
71
+ description: "The start of the stream's next period still to mint. Null until activation. Only the line stream's is a schedule: the stream with the shorter cadence, or the customer stream on a tie or with no vendor stream. The other stream's periods mint with the line period they land on."
72
+ }
73
+ };
74
+ const stream = (description) => ({
75
+ type: "object",
76
+ additionalProperties: false,
77
+ required: streamRequired,
78
+ description
79
+ });
80
+ const serviceContractSchema = {
81
+ $schema: "http://json-schema.org/draft-07/schema",
82
+ $id: "serviceContract.json",
83
+ title: "Service Contract",
84
+ description: "Kohost's record of a recurring vendor service sold to an organization. One term bounds two money streams, customer and vendor, each with its own total, cadence and start, and any number of Ticket schedules. The customer stream splits its total across properties; each split also carries its share of the vendor total. Stored platform-wide beside bills and costs and stamped with its organization (ADR 0043, ADR 0044).",
85
+ type: "object",
86
+ required: [
87
+ "id",
88
+ "type",
89
+ "organizationId",
90
+ "name",
91
+ "startsAt",
92
+ "customer",
93
+ "status"
94
+ ],
95
+ additionalProperties: false,
96
+ properties: {
97
+ id: { $ref: "definitions.json#/definitions/id" },
98
+ type: {
99
+ type: "string",
100
+ enum: ["serviceContract"],
101
+ default: "serviceContract"
102
+ },
103
+ organizationId: {
104
+ type: "string",
105
+ description: "The organization the contract bills. Stamped from the request context at creation, never client-supplied."
106
+ },
107
+ name: {
108
+ type: "string",
109
+ minLength: 1
110
+ },
111
+ reference: {
112
+ type: ["string", "null"],
113
+ default: null,
114
+ description: "The vendor's own contract number."
115
+ },
116
+ description: {
117
+ type: "string",
118
+ default: "",
119
+ description: "Leads every minted entry's description, ahead of the split label and the period label."
120
+ },
121
+ startsAt: { $ref: "definitions.json#/definitions/date" },
122
+ endsAt: {
123
+ anyOf: [{ $ref: "definitions.json#/definitions/date" }, { type: "null" }],
124
+ default: null,
125
+ description: "Null on an open-ended contract."
126
+ },
127
+ customer: {
128
+ ...stream("What the organization pays. Each line period mints one Contract cost per split into the uninvoiced pool, carrying this stream's split amount when a customer period starts in it."),
129
+ required: [...streamRequired, "splits"],
130
+ properties: {
131
+ ...streamProperties,
132
+ splits: {
133
+ type: "array",
134
+ default: [],
135
+ items: splitItem
136
+ }
137
+ }
138
+ },
139
+ vendor: {
140
+ anyOf: [{
141
+ ...stream("What the vendor bills Kohost. Each period's amount lands whole on the line period containing its invoice day, as each customer split's vendor amount on that split's Contract cost."),
142
+ required: [...streamRequired, "vendorId"],
143
+ properties: {
144
+ ...streamProperties,
145
+ vendorId: {
146
+ type: ["string", "null"],
147
+ default: null,
148
+ description: "Required to activate."
149
+ },
150
+ invoicing: {
151
+ type: "string",
152
+ enum: ["advance", "arrears"],
153
+ default: "arrears",
154
+ description: "When the vendor invoices a period: on its first day (`advance`) or the day after it ends (`arrears`). That day decides which line period the vendor amount lands on. Absent on a contract stored before it existed, which reads as `arrears`."
155
+ }
156
+ }
157
+ }, { type: "null" }],
158
+ default: null,
159
+ description: "Null on a contract with no vendor stream."
160
+ },
161
+ approval: {
162
+ type: ["object", "null"],
163
+ default: null,
164
+ additionalProperties: false,
165
+ description: "The organization's written approval of the recurring charge.",
166
+ properties: {
167
+ file: { anyOf: [{ $ref: "mediaFile.json" }, { type: "null" }] },
168
+ approvedBy: {
169
+ type: ["object", "null"],
170
+ additionalProperties: false,
171
+ required: ["name"],
172
+ properties: {
173
+ name: { type: "string" },
174
+ title: { type: ["string", "null"] }
175
+ }
176
+ },
177
+ approvedAt: { anyOf: [{ $ref: "definitions.json#/definitions/date" }, { type: "null" }] }
178
+ }
179
+ },
180
+ documents: {
181
+ type: "array",
182
+ items: { $ref: "mediaFile.json" },
183
+ default: []
184
+ },
185
+ ticketSchedules: {
186
+ type: "array",
187
+ default: [],
188
+ items: {
189
+ type: "object",
190
+ additionalProperties: false,
191
+ required: ["automationId"],
192
+ properties: { automationId: { type: "string" } }
193
+ }
194
+ },
195
+ status: {
196
+ type: "string",
197
+ enum: [
198
+ "draft",
199
+ "active",
200
+ "ended",
201
+ "cancelled"
202
+ ],
203
+ default: "draft"
204
+ },
205
+ cancelledReason: {
206
+ type: ["string", "null"],
207
+ default: null
208
+ },
209
+ createdBy: {
210
+ type: ["string", "null"],
211
+ default: null
212
+ },
213
+ createdAt: { $ref: "definitions.json#/definitions/date" },
214
+ updatedAt: { $ref: "definitions.json#/definitions/date" }
215
+ }
216
+ };
217
+ //#endregion
218
+ export { serviceContractSchema };
219
+
220
+ //# sourceMappingURL=serviceContract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceContract.js","names":[],"sources":["../../.generated/schemas/serviceContract.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\nimport { mediaFileSchema } from \"./mediaFile\";\n\nconst splitItem = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"propertyId\", \"amount\"],\n properties: {\n id: {\n type: \"string\",\n },\n propertyId: {\n type: [\"string\", \"null\"],\n description: \"Null on an org-wide split.\",\n },\n label: {\n type: [\"string\", \"null\"],\n default: null,\n },\n amount: {\n type: \"integer\",\n minimum: 0,\n description:\n \"This split's share of the customer stream's per-period total, in \" +\n \"integer cents. The splits must add up to the total to activate.\",\n },\n categoryId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The billing category the split's Contract costs arrive under.\",\n },\n vendorAmount: {\n type: [\"integer\", \"null\"],\n minimum: 0,\n default: null,\n description:\n \"This split's share of the vendor stream's per-period total, in \" +\n \"integer cents. Null with no vendor stream. With one, the splits' \" +\n \"vendor amounts must add up to its total to activate.\",\n },\n },\n} as const;\n\nconst streamRequired = [\"amount\", \"cadence\", \"startsAt\"] as const;\n\nconst streamProperties = {\n amount: {\n type: \"integer\",\n minimum: 0,\n description: \"The per-period total, in integer cents.\",\n },\n cadence: {\n type: \"object\",\n additionalProperties: false,\n required: [\"months\"],\n properties: {\n months: {\n type: \"integer\",\n enum: [1, 3, 6, 12],\n description: \"Length of one period in whole months.\",\n },\n },\n },\n startsAt: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"The first period's start: any day inside the term. Later periods \" +\n \"start on the same day of the month, clamped to a shorter month's \" +\n \"last day.\",\n },\n nextPeriodStartsAt: {\n anyOf: [{ $ref: \"definitions.json#/definitions/date\" }, { type: \"null\" }],\n default: null,\n description:\n \"The start of the stream's next period still to mint. Null until \" +\n \"activation. Only the line stream's is a schedule: the stream with \" +\n \"the shorter cadence, or the customer stream on a tie or with no \" +\n \"vendor stream. The other stream's periods mint with the line period \" +\n \"they land on.\",\n },\n} as const;\n\nconst stream = (description: string) =>\n ({\n type: \"object\",\n additionalProperties: false,\n required: streamRequired,\n description,\n }) as const;\n\nexport const serviceContractSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"serviceContract.json\",\n title: \"Service Contract\",\n description:\n \"Kohost's record of a recurring vendor service sold to an organization. \" +\n \"One term bounds two money streams, customer and vendor, each with its \" +\n \"own total, cadence and start, and any number of Ticket schedules. The \" +\n \"customer stream splits its total across properties; each split also \" +\n \"carries its share of the vendor total. Stored platform-wide beside \" +\n \"bills and costs and stamped with its organization (ADR 0043, ADR 0044).\",\n type: \"object\",\n required: [\n \"id\",\n \"type\",\n \"organizationId\",\n \"name\",\n \"startsAt\",\n \"customer\",\n \"status\",\n ],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n type: {\n type: \"string\",\n enum: [\"serviceContract\"],\n default: \"serviceContract\",\n },\n organizationId: {\n type: \"string\",\n description:\n \"The organization the contract bills. Stamped from the request \" +\n \"context at creation, never client-supplied.\",\n },\n name: {\n type: \"string\",\n minLength: 1,\n },\n reference: {\n type: [\"string\", \"null\"],\n default: null,\n description: \"The vendor's own contract number.\",\n },\n description: {\n type: \"string\",\n default: \"\",\n description:\n \"Leads every minted entry's description, ahead of the split label \" +\n \"and the period label.\",\n },\n startsAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n endsAt: {\n anyOf: [{ $ref: \"definitions.json#/definitions/date\" }, { type: \"null\" }],\n default: null,\n description: \"Null on an open-ended contract.\",\n },\n customer: {\n ...stream(\n \"What the organization pays. Each line period mints one Contract \" +\n \"cost per split into the uninvoiced pool, carrying this stream's \" +\n \"split amount when a customer period starts in it.\",\n ),\n required: [...streamRequired, \"splits\"],\n properties: {\n ...streamProperties,\n splits: {\n type: \"array\",\n default: [],\n items: splitItem,\n },\n },\n },\n vendor: {\n anyOf: [\n {\n ...stream(\n \"What the vendor bills Kohost. Each period's amount lands whole \" +\n \"on the line period containing its invoice day, as each \" +\n \"customer split's vendor amount on that split's Contract cost.\",\n ),\n required: [...streamRequired, \"vendorId\"],\n properties: {\n ...streamProperties,\n vendorId: {\n type: [\"string\", \"null\"],\n default: null,\n description: \"Required to activate.\",\n },\n invoicing: {\n type: \"string\",\n enum: [\"advance\", \"arrears\"],\n default: \"arrears\",\n description:\n \"When the vendor invoices a period: on its first day \" +\n \"(`advance`) or the day after it ends (`arrears`). That day \" +\n \"decides which line period the vendor amount lands on. \" +\n \"Absent on a contract stored before it existed, which reads \" +\n \"as `arrears`.\",\n },\n },\n },\n { type: \"null\" },\n ],\n default: null,\n description: \"Null on a contract with no vendor stream.\",\n },\n approval: {\n type: [\"object\", \"null\"],\n default: null,\n additionalProperties: false,\n description:\n \"The organization's written approval of the recurring charge.\",\n properties: {\n file: {\n anyOf: [{ $ref: \"mediaFile.json\" }, { type: \"null\" }],\n },\n approvedBy: {\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: [\"name\"],\n properties: {\n name: { type: \"string\" },\n title: { type: [\"string\", \"null\"] },\n },\n },\n approvedAt: {\n anyOf: [\n { $ref: \"definitions.json#/definitions/date\" },\n { type: \"null\" },\n ],\n },\n },\n },\n documents: {\n type: \"array\",\n items: { $ref: \"mediaFile.json\" },\n default: [],\n },\n ticketSchedules: {\n type: \"array\",\n default: [],\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\"automationId\"],\n properties: {\n automationId: { type: \"string\" },\n },\n },\n },\n status: {\n type: \"string\",\n enum: [\"draft\", \"active\", \"ended\", \"cancelled\"],\n default: \"draft\",\n },\n cancelledReason: {\n type: [\"string\", \"null\"],\n default: null,\n },\n createdBy: {\n type: [\"string\", \"null\"],\n default: null,\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n },\n} as const;\n\nexport type ServiceContractSchema = FromSchema<\n typeof serviceContractSchema,\n {\n references: [typeof defs, typeof mediaFileSchema];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n\nexport type ServiceContractCustomerStream = ServiceContractSchema[\"customer\"];\nexport type ServiceContractVendorStream = NonNullable<\n ServiceContractSchema[\"vendor\"]\n>;\nexport type ServiceContractSplit =\n ServiceContractCustomerStream[\"splits\"][number];\n"],"mappings":";AAIA,MAAM,YAAY;CAChB,MAAM;CACN,sBAAsB;CACtB,UAAU;EAAC;EAAM;EAAc;CAAQ;CACvC,YAAY;EACV,IAAI,EACF,MAAM,SACR;EACA,YAAY;GACV,MAAM,CAAC,UAAU,MAAM;GACvB,aAAa;EACf;EACA,OAAO;GACL,MAAM,CAAC,UAAU,MAAM;GACvB,SAAS;EACX;EACA,QAAQ;GACN,MAAM;GACN,SAAS;GACT,aACE;EAEJ;EACA,YAAY;GACV,MAAM,CAAC,UAAU,MAAM;GACvB,SAAS;GACT,aACE;EACJ;EACA,cAAc;GACZ,MAAM,CAAC,WAAW,MAAM;GACxB,SAAS;GACT,SAAS;GACT,aACE;EAGJ;CACF;AACF;AAEA,MAAM,iBAAiB;CAAC;CAAU;CAAW;AAAU;AAEvD,MAAM,mBAAmB;CACvB,QAAQ;EACN,MAAM;EACN,SAAS;EACT,aAAa;CACf;CACA,SAAS;EACP,MAAM;EACN,sBAAsB;EACtB,UAAU,CAAC,QAAQ;EACnB,YAAY,EACV,QAAQ;GACN,MAAM;GACN,MAAM;IAAC;IAAG;IAAG;IAAG;GAAE;GAClB,aAAa;EACf,EACF;CACF;CACA,UAAU;EACR,MAAM;EACN,aACE;CAGJ;CACA,oBAAoB;EAClB,OAAO,CAAC,EAAE,MAAM,qCAAqC,GAAG,EAAE,MAAM,OAAO,CAAC;EACxE,SAAS;EACT,aACE;CAKJ;AACF;AAEA,MAAM,UAAU,iBACb;CACC,MAAM;CACN,sBAAsB;CACtB,UAAU;CACV;AACF;AAEF,MAAa,wBAAwB;CACnC,SAAS;CACT,KAAK;CACL,OAAO;CACP,aACE;CAMF,MAAM;CACN,UAAU;EACR;EACA;EACA;EACA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MAAM,SAAS;MACvB,OAAO,EAAE,MAAM,CAAC,UAAU,MAAM,EAAE;KACpC;IACF;IACA,YAAY,EACV,OAAO,CACL,EAAE,MAAM,qCAAqC,GAC7C,EAAE,MAAM,OAAO,CACjB,EACF;GACF;EACF;EACA,WAAW;GACT,MAAM;GACN,OAAO,EAAE,MAAM,iBAAiB;GAChC,SAAS,CAAC;EACZ;EACA,iBAAiB;GACf,MAAM;GACN,SAAS,CAAC;GACV,OAAO;IACL,MAAM;IACN,sBAAsB;IACtB,UAAU,CAAC,cAAc;IACzB,YAAY,EACV,cAAc,EAAE,MAAM,SAAS,EACjC;GACF;EACF;EACA,QAAQ;GACN,MAAM;GACN,MAAM;IAAC;IAAS;IAAU;IAAS;GAAW;GAC9C,SAAS;EACX;EACA,iBAAiB;GACf,MAAM,CAAC,UAAU,MAAM;GACvB,SAAS;EACX;EACA,WAAW;GACT,MAAM,CAAC,UAAU,MAAM;GACvB,SAAS;EACX;EACA,WAAW,EACT,MAAM,qCACR;EACA,WAAW,EACT,MAAM,qCACR;CACF;AACF"}
@@ -34,6 +34,26 @@ export declare const ticketSchema: {
34
34
  readonly type: "string";
35
35
  readonly description: "The ID of the automation that created this ticket.";
36
36
  };
37
+ readonly serviceContract: {
38
+ readonly type: "object";
39
+ readonly description: "The Service contract Ticket schedule that minted this ticket. Written once by the schedule's own run and shown to Kohost staff only.";
40
+ readonly required: readonly ["id", "automationId"];
41
+ readonly additionalProperties: false;
42
+ readonly properties: {
43
+ readonly id: {
44
+ readonly type: "string";
45
+ readonly description: "The ID of the service contract.";
46
+ };
47
+ readonly automationId: {
48
+ readonly type: "string";
49
+ readonly description: "The ID of the ticket schedule that minted the ticket.";
50
+ };
51
+ readonly name: {
52
+ readonly type: "string";
53
+ readonly description: "The contract's current name, resolved when the ticket is read. Never stored.";
54
+ };
55
+ };
56
+ };
37
57
  readonly conversation: {
38
58
  readonly type: "array";
39
59
  readonly default: readonly [];
@@ -207,6 +207,26 @@ const ticketSchema = {
207
207
  type: "string",
208
208
  description: "The ID of the automation that created this ticket."
209
209
  },
210
+ serviceContract: {
211
+ type: "object",
212
+ description: "The Service contract Ticket schedule that minted this ticket. Written once by the schedule's own run and shown to Kohost staff only.",
213
+ required: ["id", "automationId"],
214
+ additionalProperties: false,
215
+ properties: {
216
+ id: {
217
+ type: "string",
218
+ description: "The ID of the service contract."
219
+ },
220
+ automationId: {
221
+ type: "string",
222
+ description: "The ID of the ticket schedule that minted the ticket."
223
+ },
224
+ name: {
225
+ type: "string",
226
+ description: "The contract's current name, resolved when the ticket is read. Never stored."
227
+ }
228
+ }
229
+ },
210
230
  conversation: {
211
231
  type: "array",
212
232
  default: [],
@@ -1 +1 @@
1
- {"version":3,"file":"ticket.js","names":[],"sources":["../../.generated/schemas/ticket.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\nimport {\n costBillingReview,\n costEntryProperties,\n costEntryRequired,\n nullableMoney,\n} from \"./costEntry\";\nimport type { mediaFileSchema } from \"./mediaFile\";\n\n// Rich-text node vocabulary for parsedBody.content (ADR 0012). Deliberately\n// fixed-depth rather than recursive: json-schema-to-ts cannot derive types\n// from self-referencing schemas, so nested lists are excluded. These consts\n// must not be exported — the model generator treats the first export ending\n// in \"Schema\" as the entity schema.\nconst richTextTextNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"text\"],\n properties: {\n type: { type: \"string\", enum: [\"text\"] },\n text: { type: \"string\" },\n marks: {\n type: \"array\",\n uniqueItems: true,\n items: { type: \"string\", enum: [\"bold\", \"italic\", \"underline\"] },\n },\n },\n} as const;\n\nconst richTextMentionNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"id\", \"discriminator\", \"label\"],\n properties: {\n type: { type: \"string\", enum: [\"mention\"] },\n id: { type: \"string\" },\n discriminator: { type: \"string\", enum: [\"user\", \"vendor\", \"system\"] },\n label: {\n type: \"string\",\n description:\n \"Display name of the mentioned entity, without the leading @.\",\n },\n },\n} as const;\n\nconst richTextHardBreakNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\"],\n properties: {\n type: { type: \"string\", enum: [\"hardBreak\"] },\n },\n} as const;\n\nconst richTextInlineNodes = {\n type: \"array\",\n minItems: 1,\n items: {\n anyOf: [richTextTextNode, richTextMentionNode, richTextHardBreakNode],\n },\n} as const;\n\nconst richTextParagraphNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"content\"],\n properties: {\n type: { type: \"string\", enum: [\"paragraph\"] },\n content: richTextInlineNodes,\n },\n} as const;\n\nconst richTextListItemNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"content\"],\n properties: {\n type: { type: \"string\", enum: [\"listItem\"] },\n content: richTextInlineNodes,\n },\n} as const;\n\nconst richTextBulletListNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"content\"],\n properties: {\n type: { type: \"string\", enum: [\"bulletList\"] },\n content: { type: \"array\", minItems: 1, items: richTextListItemNode },\n },\n} as const;\n\nconst richTextOrderedListNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"content\"],\n properties: {\n type: { type: \"string\", enum: [\"orderedList\"] },\n content: { type: \"array\", minItems: 1, items: richTextListItemNode },\n },\n} as const;\n\n// A cost entry reaches a client in one of two shapes, and both are valid wire\n// payloads a `Ticket` model must accept. A roster viewer or superadmin receives\n// the stored entry (`fullCostEntry`): the customer `price`, the vendor\n// `estimate`, `markup`, and an optional `actual`. Every other viewer receives\n// the redacted projection (`redactedCostEntry`) the API builds field-by-field —\n// the stored price as a bare amount, never the vendor cost or markup behind it\n// (see `redactCostEntry`/`applyTicketVisibility` in the API). The two are\n// disjoint (each forbids the other's discriminating fields via\n// `additionalProperties`, and `price` is an object on one and an integer on the\n// other), so `costs.items` is their `oneOf`.\nconst fullCostEntrySchema = {\n type: \"object\",\n additionalProperties: false,\n required: costEntryRequired,\n properties: {\n ...costEntryProperties,\n // Both amounts are null together on a Pending cost: an entry the roster\n // recorded before the vendor quoted it. Nothing prices until the first\n // amount lands, which seeds the estimate and derives the price from it.\n price: nullableMoney(\n \"The authoritative customer price, what the org is charged, what the \" +\n \"approval gate totals, and what a bill line bills. Seeded at pricing \" +\n \"from the estimate and the markup, and from then on independent of \" +\n \"all three: editing `estimate`, `actual`, or `markup` never moves it. \" +\n \"Only an explicit price write does. Null while the entry is a Pending \" +\n \"cost, which prices nothing.\",\n ),\n estimate: nullableMoney(\n \"The vendor cost estimate phase of the entry. Null while the entry is \" +\n \"a Pending cost: this field is what says an amount is known, so a \" +\n \"null here is the whole definition of pending. Clearing a recorded \" +\n \"amount back to null is refused; void the entry and record it again.\",\n ),\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"When the entry was recorded, whether or not it carried an amount. \" +\n \"A Pending cost has no estimate to be dated by, so this is how long \" +\n \"the roster has been waiting on the quote.\",\n },\n createdBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user who recorded the entry. Null when the write was \" +\n \"not user-attributable. Stands in for `price.recordedBy` as the \" +\n \"entry's author while it is a Pending cost.\",\n },\n expectedOn: {\n type: [\"string\", \"null\"],\n pattern: \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\",\n default: null,\n description:\n \"The Quote-expected date: the calendar day the vendor promised the \" +\n \"quote, as YYYY-MM-DD read in the property's timezone. Required \" +\n \"while the entry is a Pending cost and cleared once it is priced; \" +\n \"null on entries recorded before the date existed. Overwritten in \" +\n \"place when the vendor slips. Survives redaction.\",\n },\n // A ticket cost can also be voided, which the standalone kind has no\n // ticket to be withdrawn from.\n billingReview: costBillingReview([\n \"writtenOff\",\n \"voided\",\n \"reinstated\",\n \"divergenceAcknowledged\",\n ]),\n workItemId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The Work item on this ticket that produced the cost. Many entries \" +\n \"may name one visit, so a single trip's labor and materials can be \" +\n \"itemized. Cleared when the Work item is removed — the money record \" +\n \"outlives the scheduling record. Internal, redacted org-side.\",\n },\n voided: {\n type: \"boolean\",\n default: false,\n description:\n \"Server-maintained denormalization of billingReview (writtenOff \" +\n \"pattern): true after a voided entry until a reinstated entry \" +\n \"follows. A voided cost is withdrawn: it counts toward \" +\n \"neither the approval gate nor financial completion and leaves the \" +\n \"uninvoiced pool, but stays on the ticket so every viewer sees it \" +\n \"was voided. Never set by clients.\",\n },\n },\n} as const;\n\nconst redactedCostEntrySchema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"description\", \"currency\", \"price\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the cost entry.\",\n },\n description: {\n type: \"string\",\n description: \"What the cost covers.\",\n },\n currency: {\n type: \"string\",\n default: \"USD\",\n description: \"ISO 4217 currency code of the entry's amounts.\",\n },\n price: {\n type: [\"integer\", \"null\"],\n minimum: 0,\n description:\n \"The entry's stored customer price in integer cents — the whole of \" +\n \"what an org-side viewer receives, flattened out of the stored \" +\n \"price phase so none of its recording metadata comes with it. Null \" +\n \"while the entry is a Pending cost: the org sees a quote is owed, \" +\n \"and nothing else until it lands.\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"When the entry was recorded. Carried through redaction so a Pending \" +\n \"cost, which has no priced phase to be dated by, still has a time.\",\n },\n createdBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user who recorded the entry, carried through \" +\n \"redaction so the org side's cost controls know a Pending cost is \" +\n \"the roster's, not theirs.\",\n },\n expectedOn: {\n type: [\"string\", \"null\"],\n pattern: \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\",\n default: null,\n description:\n \"The Quote-expected date on a Pending cost, YYYY-MM-DD at the \" +\n \"property. Carried through redaction: the day is the one fact an \" +\n \"org-side viewer gets about a quote that is owed.\",\n },\n voided: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether the entry was voided (withdrawn). Carried through \" +\n \"redaction so an org-side viewer sees the cost no longer counts.\",\n },\n settled: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether a bill has claimed the entry or it was written off, so it \" +\n \"can no longer be voided. Carried through redaction as a bare flag: \" +\n \"neither the bill nor the write-off itself is exposed org-side.\",\n },\n },\n} as const;\n\n// A Work item is a scheduled performance of work on the ticket — who is coming,\n// when, and what for. Timing is wall-clock at the property, not an instant: vendors\n// commit to \"Thursday\" as often as to \"Thursday at 10\", and an instant would\n// force a fake time on the day-only case and drift a day across the property's\n// timezone on every render. `date` and `time` therefore mean exactly what the\n// building reads off them, and the conversation event can be minted without\n// resolving a timezone at all.\nconst workItemSchema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"performer\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the work item.\",\n },\n performer: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n description:\n \"Who is performing the work — a Vendor, or a staff User the work is \" +\n \"scheduled to. A discriminated reference in the same shape as \" +\n \"`assignedTo`, but orthogonal to it: `assignedTo` is who owns the \" +\n \"ticket, this is who shows up for one visit.\",\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the performer.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"vendor\", \"user\"],\n description: \"The discriminator of the performer.\",\n },\n name: {\n type: \"string\",\n description:\n \"The performer's name, denormalized at schedule time for rendering.\",\n },\n },\n },\n date: {\n type: [\"string\", \"null\"],\n pattern: \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\",\n default: null,\n description:\n \"The calendar date of the visit as YYYY-MM-DD, read in the property's \" +\n \"timezone. Null while the item is Pending work, which carries \" +\n \"`blockedUntil` instead; exactly one of the two is set.\",\n },\n blockedUntil: {\n type: [\"string\", \"null\"],\n pattern: \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\",\n default: null,\n description:\n \"The Blocked-until date of Pending work: the day the roster expects \" +\n \"the blocker to clear and scheduling to become possible, as \" +\n \"YYYY-MM-DD in the property's timezone. Not a promise the work \" +\n \"happens that day. Set only while `date` is null; cleared the moment \" +\n \"the item is scheduled. Overwritten in place when it slips.\",\n },\n time: {\n type: [\"string\", \"null\"],\n pattern: \"^([01]\\\\d|2[0-3]):[0-5]\\\\d$\",\n default: null,\n description:\n \"The 24-hour local start time as HH:mm, or null for a day-only \" +\n \"commitment. Day-only is first-class, not a missing value.\",\n },\n description: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"What the visit is for, in the scheduler's words — the scope handed \" +\n \"to whoever shows up. Optional: a booking with nothing to add carries \" +\n \"null, and the performer and the slot are the whole record.\",\n },\n scheduledBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user whose write created this work item. Null when the write was not user-attributable.\",\n },\n scheduledAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the work item was created.\",\n },\n noCharge: {\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: [\"setBy\", \"setAt\"],\n default: null,\n description:\n \"The explicit decision that this visit will never be billed, or \" +\n \"null while no decision has been made. A disposition rather than a \" +\n \"zero-dollar cost: nothing was charged, so there is no amount to \" +\n \"record, and financial completion asks whether every visit is \" +\n \"either billed or deliberately not. Reversible while the ticket is \" +\n \"active; frozen once it closes.\",\n properties: {\n setBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user whose write set the disposition. Null when \" +\n \"the write was not user-attributable.\",\n },\n setAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the disposition was set.\",\n },\n },\n },\n verification: {\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: [\"outcome\", \"verifiedBy\", \"verifiedAt\"],\n default: null,\n description:\n \"What a facilities roster member saw at this visit, or null while \" +\n \"nobody has recorded it. The date passing is not an outcome: an \" +\n \"unverified past-dated visit is unverified, and this slot is the \" +\n \"only thing that says whether the visit happened. Reversible by the \" +\n \"roster while the ticket is active; frozen once it closes.\",\n properties: {\n outcome: {\n type: \"string\",\n enum: [\"completed\", \"notCompleted\"],\n description:\n \"Whether the work the visit was booked for got done. A \" +\n \"not-completed visit is frozen: the return trip is a new work \" +\n \"item, not a re-dated one.\",\n },\n comment: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"What the verifier wants on the record, required when the visit \" +\n \"was not completed and optional when it was.\",\n },\n verifiedBy: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"name\"],\n description:\n \"The roster member who recorded the outcome, named here so a \" +\n \"later rename cannot rewrite what the thread already said.\",\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the verifying user.\",\n },\n name: {\n type: \"string\",\n description:\n \"The verifying user's name at the time of the write.\",\n },\n },\n },\n verifiedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the outcome was recorded.\",\n },\n },\n },\n },\n} as const;\n\nexport const ticketSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"ticket.json\",\n title: \"Ticket\",\n description: \"A ticket is a request from a user.\",\n type: \"object\",\n required: [\n \"id\",\n \"conversation\",\n \"requester\",\n \"openedBy\",\n \"assignedTo\",\n \"status\",\n \"priority\",\n \"tags\",\n \"createdAt\",\n \"updatedAt\",\n ],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n propertyId: {\n type: \"string\",\n description:\n \"ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.\",\n },\n type: {\n type: \"string\",\n enum: [\"ticket\"],\n default: \"ticket\",\n },\n number: {\n type: \"string\",\n description: \"The number of the ticket.\",\n },\n issueId: {\n type: \"string\",\n description: \"The ID of the issue that this ticket is associated with.\",\n },\n parentAutomationId: {\n type: \"string\",\n description: \"The ID of the automation that created this ticket.\",\n },\n conversation: {\n type: \"array\",\n default: [],\n description: \"The conversation history of the ticket.\",\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"timestamp\", \"body\", \"author\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the message.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\n \"message\",\n \"opened\",\n \"assigned\",\n \"rated\",\n \"scheduled\",\n \"collaboratorAdded\",\n \"collaboratorRemoved\",\n \"statusChanged\",\n \"priorityChanged\",\n \"scheduleDateChanged\",\n \"locationChanged\",\n \"issueChanged\",\n \"nudged\",\n \"approvalRequested\",\n \"approvalApproved\",\n \"approvalDenied\",\n \"workScheduled\",\n \"workRescheduled\",\n \"workCanceled\",\n \"workCompleted\",\n \"workNotCompleted\",\n \"workVerificationCleared\",\n \"costRecorded\",\n \"costPriceChanged\",\n \"costVoided\",\n \"awaitingResponse\",\n \"awaitingResponseCleared\",\n ],\n default: \"message\",\n description: \"The discriminator of the message.\",\n },\n isInternal: {\n type: \"boolean\",\n description:\n \"Whether the message is internal to the assignedTo and collaborators. Internal messages are not visible to the requester.\",\n default: false,\n },\n author: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the author of the message.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\", \"system\"],\n description: \"The discriminator of the author of the message.\",\n },\n name: {\n type: \"string\",\n description: \"The name of the author of the message.\",\n },\n },\n },\n timestamp: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"The ISO 8601 timestamp of the message.\",\n },\n body: {\n type: \"string\",\n description: \"The body of the message.\",\n },\n parsedBody: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"An object containing the parsed body of the message for mentions.\",\n properties: {\n content: {\n type: \"array\",\n minItems: 1,\n description:\n \"Rich-text block nodes (ADR 0012). Present = rich message: `body` is the server-derived plain-text projection of this tree, and the legacy text/mentions fields are not written.\",\n items: {\n anyOf: [\n richTextParagraphNode,\n richTextBulletListNode,\n richTextOrderedListNode,\n ],\n },\n },\n text: {\n type: \"string\",\n description: \"The mention text (legacy tokenized format).\",\n },\n mentions: {\n type: \"array\",\n default: [],\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\n \"discriminator\",\n \"id\",\n \"index\",\n \"length\",\n \"originalText\",\n ],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the mention.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\", \"system\"],\n description:\n \"The discriminator of entity that was mentioned.\",\n },\n index: {\n type: \"integer\",\n description: \"The index of the mention in the message.\",\n },\n length: {\n type: \"integer\",\n description: \"The length of the mention in the message.\",\n },\n originalText: {\n type: \"string\",\n description: \"The original text of the mention.\",\n },\n },\n },\n },\n },\n },\n statusChanged: {\n type: \"object\",\n additionalProperties: false,\n required: [\"from\", \"to\"],\n description:\n \"Structured status transition for `statusChanged` entries. Lets consumers detect reopens (from solved/closed to open) without parsing the body text.\",\n properties: {\n from: {\n type: \"string\",\n enum: [\"open\", \"pending\", \"solved\", \"closed\"],\n description: \"The status the ticket transitioned from.\",\n },\n to: {\n type: \"string\",\n enum: [\"open\", \"pending\", \"solved\", \"closed\"],\n description: \"The status the ticket transitioned to.\",\n },\n },\n },\n awaitingResponse: {\n type: \"object\",\n additionalProperties: false,\n required: [\"awaiting\"],\n description:\n \"Legacy. Earlier releases announced the Awaiting response marker in the conversation; the marker now lives only in the ticket's `awaitingResponse` slot and no new entries of this kind are written.\",\n properties: {\n awaiting: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n properties: {\n id: { type: \"string\" },\n discriminator: { type: \"string\", enum: [\"user\"] },\n name: { type: \"string\" },\n },\n },\n messageId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The conversation message this marker was sent with, when the composer set both in one write.\",\n },\n },\n },\n awaitingResponseCleared: {\n type: \"object\",\n additionalProperties: false,\n required: [\"reason\"],\n description:\n \"Legacy. Earlier releases announced the end of a wait in the conversation; no new entries of this kind are written.\",\n properties: {\n reason: {\n type: \"string\",\n enum: [\"explicit\", \"left\"],\n },\n },\n },\n readBy: {\n type: \"array\",\n default: [],\n items: {\n type: \"string\",\n },\n description: \"The IDs of the users who have read the message.\",\n },\n media: {\n anyOf: [{ $ref: \"mediaFile.json\" }, { type: \"null\" }],\n description: \"The media file associated with the message.\",\n },\n attachments: {\n type: \"array\",\n items: { $ref: \"mediaFile.json\" },\n description:\n \"Files attached to the message. Supersedes the singular media.\",\n },\n },\n },\n },\n subject: {\n type: \"string\",\n description: \"The subject of the ticket.\",\n },\n openedBy: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n properties: {\n id: {\n type: \"string\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"system\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n requester: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the requester.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\", \"system\", \"device\"],\n description: \"The discriminator of the requester.\",\n },\n name: {\n type: \"string\",\n description: \"The name of the requester.\",\n },\n photo: {\n anyOf: [\n { $ref: \"mediaFile.json\" },\n { type: \"null\" },\n { type: \"string\" },\n ],\n description: \"The photo of the requester.\",\n },\n },\n },\n assignedTo: {\n type: [\"object\", \"null\"],\n default: null,\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the assigned to.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\"],\n description: \"The discriminator of the assigned to.\",\n },\n name: {\n type: \"string\",\n description: \"The name of the assigned to.\",\n },\n photo: {\n anyOf: [\n { $ref: \"mediaFile.json\" },\n { type: \"null\" },\n { type: \"string\" },\n ],\n description: \"The photo of the assigned to.\",\n },\n },\n },\n notify: {\n type: \"array\",\n description:\n \"A list of entities to notify when this ticket is created or resolved.\",\n default: [],\n items: {\n type: \"object\",\n required: [\"id\", \"discriminator\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the entity to notify.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\"],\n },\n },\n },\n },\n collaborators: {\n type: \"array\",\n default: [],\n description: \"A list of entities who will collaborate on this ticket.\",\n items: {\n type: \"object\",\n required: [\"id\", \"name\", \"discriminator\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\"],\n },\n },\n },\n },\n location: {\n type: \"object\",\n required: [\"discriminator\", \"name\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"space\", \"property\", \"customText\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n status: {\n type: \"string\",\n enum: [\"open\", \"pending\", \"solved\", \"closed\"],\n default: \"open\",\n },\n priority: {\n type: \"string\",\n enum: [\"low\", \"normal\", \"high\", \"critical\"],\n default: \"normal\",\n },\n priorityRank: {\n type: \"integer\",\n minimum: 1,\n maximum: 4,\n description:\n \"Server-derived numeric rank of priority (low=1, normal=2, high=3, critical=4). Denormalized to support priority sorting; never set by clients.\",\n },\n reopenCount: {\n type: \"integer\",\n minimum: 0,\n default: 0,\n description:\n 'Server-derived count of transitions back to \"open\" that followed a solve/close. reopenCount > 0 answers \"was this ticket ever reopened?\" in O(1); maintained at the repository layer across every status-write path. Never set by clients.',\n },\n work: {\n type: \"array\",\n default: [],\n description:\n \"Work items scheduled on the ticket: who is coming, when, and what for. Many per ticket, including repeat visits by the same performer. Carries no lifecycle status — the conversation log is the history, and only a roster verification says whether a past-dated visit happened. Never redacted; vendor identity is already public in assignment.\",\n items: workItemSchema,\n },\n costs: {\n type: \"array\",\n default: [],\n description:\n \"Cost line items recorded on the ticket. Each entry stores the customer price and the vendor cost side by side and keeps them independent: the price is seeded from the estimate and markup at recording, and nothing about the vendor side moves it afterwards. Every entry arrives as either the full vendor shape or the redacted price-only shape depending on whether the viewer may see the cost split.\",\n items: {\n oneOf: [fullCostEntrySchema, redactedCostEntrySchema],\n },\n },\n approvals: {\n type: \"array\",\n default: [],\n description:\n \"Approval request history for the ticket. At most one pending record at a time; records are immutable once decided (enforced by use cases).\",\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"amount\", \"approverUserIds\", \"status\", \"requestedAt\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the approval record.\",\n },\n amount: {\n type: \"integer\",\n minimum: 0,\n description:\n \"The ticket's customer price total in integer cents, frozen at request time.\",\n },\n approverUserIds: {\n type: \"array\",\n minItems: 1,\n items: {\n type: \"string\",\n },\n description:\n \"The effective approver set for this request, frozen at request time.\",\n },\n status: {\n type: \"string\",\n enum: [\"pending\", \"approved\", \"denied\"],\n default: \"pending\",\n },\n requestedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the approval was requested.\",\n },\n requestedBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user whose write created this request, frozen at request time. Null when the write was not user-attributable.\",\n },\n decidedBy: {\n type: [\"string\", \"null\"],\n default: null,\n description: \"The ID of the approver who decided the request.\",\n },\n decidedAt: {\n anyOf: [\n { $ref: \"definitions.json#/definitions/date\" },\n { type: \"null\" },\n ],\n default: null,\n description: \"When the request was decided.\",\n },\n comment: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The decider's comment. Required on deny, optional on approve (enforced by use cases).\",\n },\n },\n },\n },\n dneAmount: {\n type: [\"integer\", \"null\"],\n minimum: 0,\n description:\n \"The effective do-not-exceed amount in integer cents the approval gate compares against, resolved per read from the organization and property Concierge settings. Never stored on the document and never set by clients; absent on payloads where it could not be resolved. Viewer-independent: the DNE is the customer's own contract term, so org-side viewers see it.\",\n },\n stages: {\n type: \"array\",\n description:\n \"The Stages the ticket carries, in the fixed chip order. Derived at read time from the ticket's own facts, never stored and never set by clients, and absent for every viewer outside Kohost's facilities staff. A ticket may carry several at once; `closed` and `pending` tickets carry none.\",\n items: {\n type: \"string\",\n enum: [\n \"awaitingClientApproval\",\n \"awaitingClientResponse\",\n \"awaitingVendorQuote\",\n \"awaitingScheduling\",\n \"vendorScheduled\",\n \"confirmCosts\",\n \"resolveReady\",\n ],\n },\n },\n approvalState: {\n type: \"string\",\n enum: [\"clear\", \"awaitingApproval\", \"denied\"],\n default: \"clear\",\n description:\n \"Server-maintained denormalization of the approval gate, updated on every cost or approval write (reopenCount pattern) so queue filters get O(1) access. Never set by clients.\",\n },\n awaitingResponse: {\n type: [\"object\", \"null\"],\n default: null,\n additionalProperties: false,\n required: [\"author\", \"awaiting\", \"since\"],\n description:\n \"A Kohost Facilities agent's private note that they are waiting on a reply, from one named participant outside Kohost's side or from anyone outside it. Served only to the Facilities roster; every other viewer receives null. A named wait ends when anyone other than its author posts a public message or when the awaited person leaves the ticket; an anyone wait ends when someone outside Kohost's side posts a public message. Either ends when the roster clears it. Written only through SetAwaitingResponse and ClearAwaitingResponse.\",\n properties: {\n author: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n description: \"Who set the marker.\",\n properties: {\n id: { type: \"string\" },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\", \"system\"],\n },\n name: { type: \"string\" },\n },\n },\n awaiting: {\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n description:\n \"The person the ticket is waiting on. Null when the wait is on anyone outside Kohost's side rather than one named person.\",\n properties: {\n id: { type: \"string\" },\n discriminator: { type: \"string\", enum: [\"user\"] },\n name: { type: \"string\" },\n },\n },\n since: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the marker was set.\",\n },\n messageId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Legacy. Earlier releases linked the marker to the message it was sent with; no longer written.\",\n },\n },\n },\n tags: {\n type: \"array\",\n default: [],\n items: {\n type: \"string\",\n },\n },\n rating: {\n type: \"number\",\n minimum: 0,\n maximum: 5,\n },\n ratingComment: {\n type: \"string\",\n },\n scheduleDate: {\n $ref: \"definitions.json#/definitions/date\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n solvedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n lastMessageAt: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"Server-derived timestamp of the latest conversation message; initialized to createdAt when no message exists. Denormalized to support recency sorting; never set by clients.\",\n },\n closedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n deletedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n },\n} as const;\n\ntype TicketSchemaBase = FromSchema<\n typeof ticketSchema,\n {\n references: [typeof defs, typeof mediaFileSchema];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n\n/** A stored cost entry: the full shape, with `price`, `estimate` and `markup`. */\nexport type TicketCostEntry = Extract<\n NonNullable<TicketSchemaBase[\"costs\"]>[number],\n { estimate: unknown }\n>;\n\n/** One scheduled performance of work on a ticket. */\nexport type TicketWorkItem = NonNullable<TicketSchemaBase[\"work\"]>[number];\n\n/** One derived Stage a ticket may carry. The API's `resolveStages` owns the rules. */\nexport type TicketStage = NonNullable<TicketSchemaBase[\"stages\"]>[number];\n\n/** One append-only billing review entry on a stored cost entry. */\nexport type TicketCostBillingReviewEntry = NonNullable<\n TicketCostEntry[\"billingReview\"]\n>[number];\n\n// The runtime `costs.items` schema is a `oneOf` so a `Ticket` model validates\n// both wire shapes a read can return (see the schema comment), which makes the\n// derived element type a `full | redacted` union. A stored ticket, though, only\n// ever holds the full shape — the redacted projection exists solely at the API\n// read seam (`redactTicketCostSplit`, which casts through `unknown`). Model and\n// write-path consumers reason about the stored document, so `costs` is narrowed\n// back to the full entry here; the redacted shape stays a validation-only\n// concern rather than leaking into every `ticket.costs` dereference.\nexport type TicketSchema = Omit<TicketSchemaBase, \"costs\"> & {\n costs?: TicketCostEntry[];\n};\n"],"mappings":";;AAuDA,MAAM,sBAAsB;CAC1B,MAAM;CACN,UAAU;CACV,OAAO,EACL,OAAO;EAAC;GA3CV,MAA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AAU;KAAC;KAAM;KAAiB;KAAa;KAAQ;IAAQ;IAC/D,YAAY;KACV,IAAI;MACF,MAAM;MACN,aAAa;KACf;KACA,eAAe;MACb,MAAM;MACN,MAAM;OACJ;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;MACF;MACA,SAAS;MACT,aAAa;KACf;KACA,YAAY;MACV,MAAM;MACN,aACE;MACF,SAAS;KACX;KACA,QAAQ;MACN,MAAM;MACN,sBAAsB;MACtB,UAAU;OAAC;OAAM;OAAiB;MAAM;MACxC,YAAY;OACV,IAAI;QACF,MAAM;QACN,aAAa;OACf;OACA,eAAe;QACb,MAAM;QACN,MAAM;SAAC;SAAQ;SAAU;QAAQ;QACjC,aAAa;OACf;OACA,MAAM;QACJ,MAAM;QACN,aAAa;OACf;MACF;KACF;KACA,WAAW;MACT,MAAM;MACN,aAAa;KACf;KACA,MAAM;MACJ,MAAM;MACN,aAAa;KACf;KACA,YAAY;MACV,MAAM;MACN,sBAAsB;MACtB,aACE;MACF,YAAY;OACV,SAAS;QACP,MAAM;QACN,UAAU;QACV,aACE;QACF,OAAO,EACL,OAAO;SACL;SACA;SACA;QACF,EACF;OACF;OACA,MAAM;QACJ,MAAM;QACN,aAAa;OACf;OACA,UAAU;QACR,MAAM;QACN,SAAS,CAAC;QACV,OAAO;SACL,MAAM;SACN,sBAAsB;SACtB,UAAU;UACR;UACA;UACA;UACA;UACA;SACF;SACA,YAAY;UACV,IAAI;WACF,MAAM;WACN,aAAa;UACf;UACA,eAAe;WACb,MAAM;WACN,MAAM;YAAC;YAAQ;YAAU;WAAQ;WACjC,aACE;UACJ;UACA,OAAO;WACL,MAAM;WACN,aAAa;UACf;UACA,QAAQ;WACN,MAAM;WACN,aAAa;UACf;UACA,cAAc;WACZ,MAAM;WACN,aAAa;UACf;SACF;QACF;OACF;MACF;KACF;KACA,eAA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ACA;KACA;IACF;GACF;EACF;EACA,eAAe;GACb,MAAM;GACN,MAAM;IAAC;IAAS;IAAoB;GAAQ;GAC5C,SAAS;GACT,aACE;EACJ;EACA,kBAAkB;GAChB,MAAM,CAAC,UAAU,MAAM;GACvB,SAAS;GACT,sBAAsB;GACtB,UAAU;IAAC;IAAU;IAAY;GAAO;GACxC,aACE;GACF,YAAY;IACV,QAAQ;KACN,MAAM;KACN,sBAAsB;KACtB,UAAU;MAAC;MAAM;MAAiB;KAAM;KACxC,aAAa;KACb,YAAY;MACV,IAAI,EAAE,MAAM,SAAS;MACrB,eAAe;OACb,MAAM;OACN,MAAM;QAAC;QAAQ;QAAU;OAAQ;MACnC;MACA,MAAM,EAAE,MAAM,SAAS;KACzB;IACF;IACA,UAAU;KACR,MAAM,CAAC,UAAU,MAAM;KACvB,sBAAsB;KACtB,UAAU;MAAC;MAAM;MAAiB;KAAM;KACxC,aACE;KACF,YAAY;MACV,IAAI,EAAE,MAAM,SAAS;MACrB,eAAe;OAAE,MAAM;OAAU,MAAM,CAAC,MAAM;MAAE;MAChD,MAAM,EAAE,MAAM,SAAS;KACzB;IACF;IACA,OAAO;KACL,MAAM;KACN,aAAa;IACf;IACA,WAAW;KACT,MAAM,CAAC,UAAU,MAAM;KACvB,SAAS;KACT,aACE;IACJ;GACF;EACF;EACA,MAAM;GACJ,MAAM;GACN,SAAS,CAAC;GACV,OAAO,EACL,MAAM,SACR;EACF;EACA,QAAQ;GACN,MAAM;GACN,SAAS;GACT,SAAS;EACX;EACA,eAAe,EACb,MAAM,SACR;EACA,cAAc,EACZ,MAAM,qCACR;EACA,WAAW,EACT,MAAM,qCACR;EACA,WAAW,EACT,MAAM,qCACR;EACA,UAAU,EACR,MAAM,qCACR;EACA,eAAe;GACb,MAAM;GACN,aACE;EACJ;EACA,UAAU,EACR,MAAM,qCACR;EACA,WAAW,EACT,MAAM,qCACR;CACF;AACF"}
1
+ {"version":3,"file":"ticket.js","names":[],"sources":["../../.generated/schemas/ticket.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\nimport {\n costBillingReview,\n costEntryProperties,\n costEntryRequired,\n nullableMoney,\n} from \"./costEntry\";\nimport type { mediaFileSchema } from \"./mediaFile\";\n\n// Rich-text node vocabulary for parsedBody.content (ADR 0012). Deliberately\n// fixed-depth rather than recursive: json-schema-to-ts cannot derive types\n// from self-referencing schemas, so nested lists are excluded. These consts\n// must not be exported — the model generator treats the first export ending\n// in \"Schema\" as the entity schema.\nconst richTextTextNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"text\"],\n properties: {\n type: { type: \"string\", enum: [\"text\"] },\n text: { type: \"string\" },\n marks: {\n type: \"array\",\n uniqueItems: true,\n items: { type: \"string\", enum: [\"bold\", \"italic\", \"underline\"] },\n },\n },\n} as const;\n\nconst richTextMentionNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"id\", \"discriminator\", \"label\"],\n properties: {\n type: { type: \"string\", enum: [\"mention\"] },\n id: { type: \"string\" },\n discriminator: { type: \"string\", enum: [\"user\", \"vendor\", \"system\"] },\n label: {\n type: \"string\",\n description:\n \"Display name of the mentioned entity, without the leading @.\",\n },\n },\n} as const;\n\nconst richTextHardBreakNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\"],\n properties: {\n type: { type: \"string\", enum: [\"hardBreak\"] },\n },\n} as const;\n\nconst richTextInlineNodes = {\n type: \"array\",\n minItems: 1,\n items: {\n anyOf: [richTextTextNode, richTextMentionNode, richTextHardBreakNode],\n },\n} as const;\n\nconst richTextParagraphNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"content\"],\n properties: {\n type: { type: \"string\", enum: [\"paragraph\"] },\n content: richTextInlineNodes,\n },\n} as const;\n\nconst richTextListItemNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"content\"],\n properties: {\n type: { type: \"string\", enum: [\"listItem\"] },\n content: richTextInlineNodes,\n },\n} as const;\n\nconst richTextBulletListNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"content\"],\n properties: {\n type: { type: \"string\", enum: [\"bulletList\"] },\n content: { type: \"array\", minItems: 1, items: richTextListItemNode },\n },\n} as const;\n\nconst richTextOrderedListNode = {\n type: \"object\",\n additionalProperties: false,\n required: [\"type\", \"content\"],\n properties: {\n type: { type: \"string\", enum: [\"orderedList\"] },\n content: { type: \"array\", minItems: 1, items: richTextListItemNode },\n },\n} as const;\n\n// A cost entry reaches a client in one of two shapes, and both are valid wire\n// payloads a `Ticket` model must accept. A roster viewer or superadmin receives\n// the stored entry (`fullCostEntry`): the customer `price`, the vendor\n// `estimate`, `markup`, and an optional `actual`. Every other viewer receives\n// the redacted projection (`redactedCostEntry`) the API builds field-by-field —\n// the stored price as a bare amount, never the vendor cost or markup behind it\n// (see `redactCostEntry`/`applyTicketVisibility` in the API). The two are\n// disjoint (each forbids the other's discriminating fields via\n// `additionalProperties`, and `price` is an object on one and an integer on the\n// other), so `costs.items` is their `oneOf`.\nconst fullCostEntrySchema = {\n type: \"object\",\n additionalProperties: false,\n required: costEntryRequired,\n properties: {\n ...costEntryProperties,\n // Both amounts are null together on a Pending cost: an entry the roster\n // recorded before the vendor quoted it. Nothing prices until the first\n // amount lands, which seeds the estimate and derives the price from it.\n price: nullableMoney(\n \"The authoritative customer price, what the org is charged, what the \" +\n \"approval gate totals, and what a bill line bills. Seeded at pricing \" +\n \"from the estimate and the markup, and from then on independent of \" +\n \"all three: editing `estimate`, `actual`, or `markup` never moves it. \" +\n \"Only an explicit price write does. Null while the entry is a Pending \" +\n \"cost, which prices nothing.\",\n ),\n estimate: nullableMoney(\n \"The vendor cost estimate phase of the entry. Null while the entry is \" +\n \"a Pending cost: this field is what says an amount is known, so a \" +\n \"null here is the whole definition of pending. Clearing a recorded \" +\n \"amount back to null is refused; void the entry and record it again.\",\n ),\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"When the entry was recorded, whether or not it carried an amount. \" +\n \"A Pending cost has no estimate to be dated by, so this is how long \" +\n \"the roster has been waiting on the quote.\",\n },\n createdBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user who recorded the entry. Null when the write was \" +\n \"not user-attributable. Stands in for `price.recordedBy` as the \" +\n \"entry's author while it is a Pending cost.\",\n },\n expectedOn: {\n type: [\"string\", \"null\"],\n pattern: \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\",\n default: null,\n description:\n \"The Quote-expected date: the calendar day the vendor promised the \" +\n \"quote, as YYYY-MM-DD read in the property's timezone. Required \" +\n \"while the entry is a Pending cost and cleared once it is priced; \" +\n \"null on entries recorded before the date existed. Overwritten in \" +\n \"place when the vendor slips. Survives redaction.\",\n },\n // A ticket cost can also be voided, which the standalone kind has no\n // ticket to be withdrawn from.\n billingReview: costBillingReview([\n \"writtenOff\",\n \"voided\",\n \"reinstated\",\n \"divergenceAcknowledged\",\n ]),\n workItemId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The Work item on this ticket that produced the cost. Many entries \" +\n \"may name one visit, so a single trip's labor and materials can be \" +\n \"itemized. Cleared when the Work item is removed — the money record \" +\n \"outlives the scheduling record. Internal, redacted org-side.\",\n },\n voided: {\n type: \"boolean\",\n default: false,\n description:\n \"Server-maintained denormalization of billingReview (writtenOff \" +\n \"pattern): true after a voided entry until a reinstated entry \" +\n \"follows. A voided cost is withdrawn: it counts toward \" +\n \"neither the approval gate nor financial completion and leaves the \" +\n \"uninvoiced pool, but stays on the ticket so every viewer sees it \" +\n \"was voided. Never set by clients.\",\n },\n },\n} as const;\n\nconst redactedCostEntrySchema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"description\", \"currency\", \"price\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the cost entry.\",\n },\n description: {\n type: \"string\",\n description: \"What the cost covers.\",\n },\n currency: {\n type: \"string\",\n default: \"USD\",\n description: \"ISO 4217 currency code of the entry's amounts.\",\n },\n price: {\n type: [\"integer\", \"null\"],\n minimum: 0,\n description:\n \"The entry's stored customer price in integer cents — the whole of \" +\n \"what an org-side viewer receives, flattened out of the stored \" +\n \"price phase so none of its recording metadata comes with it. Null \" +\n \"while the entry is a Pending cost: the org sees a quote is owed, \" +\n \"and nothing else until it lands.\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"When the entry was recorded. Carried through redaction so a Pending \" +\n \"cost, which has no priced phase to be dated by, still has a time.\",\n },\n createdBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user who recorded the entry, carried through \" +\n \"redaction so the org side's cost controls know a Pending cost is \" +\n \"the roster's, not theirs.\",\n },\n expectedOn: {\n type: [\"string\", \"null\"],\n pattern: \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\",\n default: null,\n description:\n \"The Quote-expected date on a Pending cost, YYYY-MM-DD at the \" +\n \"property. Carried through redaction: the day is the one fact an \" +\n \"org-side viewer gets about a quote that is owed.\",\n },\n voided: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether the entry was voided (withdrawn). Carried through \" +\n \"redaction so an org-side viewer sees the cost no longer counts.\",\n },\n settled: {\n type: \"boolean\",\n default: false,\n description:\n \"Whether a bill has claimed the entry or it was written off, so it \" +\n \"can no longer be voided. Carried through redaction as a bare flag: \" +\n \"neither the bill nor the write-off itself is exposed org-side.\",\n },\n },\n} as const;\n\n// A Work item is a scheduled performance of work on the ticket — who is coming,\n// when, and what for. Timing is wall-clock at the property, not an instant: vendors\n// commit to \"Thursday\" as often as to \"Thursday at 10\", and an instant would\n// force a fake time on the day-only case and drift a day across the property's\n// timezone on every render. `date` and `time` therefore mean exactly what the\n// building reads off them, and the conversation event can be minted without\n// resolving a timezone at all.\nconst workItemSchema = {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"performer\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the work item.\",\n },\n performer: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n description:\n \"Who is performing the work — a Vendor, or a staff User the work is \" +\n \"scheduled to. A discriminated reference in the same shape as \" +\n \"`assignedTo`, but orthogonal to it: `assignedTo` is who owns the \" +\n \"ticket, this is who shows up for one visit.\",\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the performer.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"vendor\", \"user\"],\n description: \"The discriminator of the performer.\",\n },\n name: {\n type: \"string\",\n description:\n \"The performer's name, denormalized at schedule time for rendering.\",\n },\n },\n },\n date: {\n type: [\"string\", \"null\"],\n pattern: \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\",\n default: null,\n description:\n \"The calendar date of the visit as YYYY-MM-DD, read in the property's \" +\n \"timezone. Null while the item is Pending work, which carries \" +\n \"`blockedUntil` instead; exactly one of the two is set.\",\n },\n blockedUntil: {\n type: [\"string\", \"null\"],\n pattern: \"^\\\\d{4}-\\\\d{2}-\\\\d{2}$\",\n default: null,\n description:\n \"The Blocked-until date of Pending work: the day the roster expects \" +\n \"the blocker to clear and scheduling to become possible, as \" +\n \"YYYY-MM-DD in the property's timezone. Not a promise the work \" +\n \"happens that day. Set only while `date` is null; cleared the moment \" +\n \"the item is scheduled. Overwritten in place when it slips.\",\n },\n time: {\n type: [\"string\", \"null\"],\n pattern: \"^([01]\\\\d|2[0-3]):[0-5]\\\\d$\",\n default: null,\n description:\n \"The 24-hour local start time as HH:mm, or null for a day-only \" +\n \"commitment. Day-only is first-class, not a missing value.\",\n },\n description: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"What the visit is for, in the scheduler's words — the scope handed \" +\n \"to whoever shows up. Optional: a booking with nothing to add carries \" +\n \"null, and the performer and the slot are the whole record.\",\n },\n scheduledBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user whose write created this work item. Null when the write was not user-attributable.\",\n },\n scheduledAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the work item was created.\",\n },\n noCharge: {\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: [\"setBy\", \"setAt\"],\n default: null,\n description:\n \"The explicit decision that this visit will never be billed, or \" +\n \"null while no decision has been made. A disposition rather than a \" +\n \"zero-dollar cost: nothing was charged, so there is no amount to \" +\n \"record, and financial completion asks whether every visit is \" +\n \"either billed or deliberately not. Reversible while the ticket is \" +\n \"active; frozen once it closes.\",\n properties: {\n setBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user whose write set the disposition. Null when \" +\n \"the write was not user-attributable.\",\n },\n setAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the disposition was set.\",\n },\n },\n },\n verification: {\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: [\"outcome\", \"verifiedBy\", \"verifiedAt\"],\n default: null,\n description:\n \"What a facilities roster member saw at this visit, or null while \" +\n \"nobody has recorded it. The date passing is not an outcome: an \" +\n \"unverified past-dated visit is unverified, and this slot is the \" +\n \"only thing that says whether the visit happened. Reversible by the \" +\n \"roster while the ticket is active; frozen once it closes.\",\n properties: {\n outcome: {\n type: \"string\",\n enum: [\"completed\", \"notCompleted\"],\n description:\n \"Whether the work the visit was booked for got done. A \" +\n \"not-completed visit is frozen: the return trip is a new work \" +\n \"item, not a re-dated one.\",\n },\n comment: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"What the verifier wants on the record, required when the visit \" +\n \"was not completed and optional when it was.\",\n },\n verifiedBy: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"name\"],\n description:\n \"The roster member who recorded the outcome, named here so a \" +\n \"later rename cannot rewrite what the thread already said.\",\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the verifying user.\",\n },\n name: {\n type: \"string\",\n description:\n \"The verifying user's name at the time of the write.\",\n },\n },\n },\n verifiedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the outcome was recorded.\",\n },\n },\n },\n },\n} as const;\n\nexport const ticketSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"ticket.json\",\n title: \"Ticket\",\n description: \"A ticket is a request from a user.\",\n type: \"object\",\n required: [\n \"id\",\n \"conversation\",\n \"requester\",\n \"openedBy\",\n \"assignedTo\",\n \"status\",\n \"priority\",\n \"tags\",\n \"createdAt\",\n \"updatedAt\",\n ],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n },\n propertyId: {\n type: \"string\",\n description:\n \"ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.\",\n },\n type: {\n type: \"string\",\n enum: [\"ticket\"],\n default: \"ticket\",\n },\n number: {\n type: \"string\",\n description: \"The number of the ticket.\",\n },\n issueId: {\n type: \"string\",\n description: \"The ID of the issue that this ticket is associated with.\",\n },\n parentAutomationId: {\n type: \"string\",\n description: \"The ID of the automation that created this ticket.\",\n },\n serviceContract: {\n type: \"object\",\n description:\n \"The Service contract Ticket schedule that minted this ticket. Written once by the schedule's own run and shown to Kohost staff only.\",\n required: [\"id\", \"automationId\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the service contract.\",\n },\n automationId: {\n type: \"string\",\n description: \"The ID of the ticket schedule that minted the ticket.\",\n },\n name: {\n type: \"string\",\n description:\n \"The contract's current name, resolved when the ticket is read. Never stored.\",\n },\n },\n },\n conversation: {\n type: \"array\",\n default: [],\n description: \"The conversation history of the ticket.\",\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"timestamp\", \"body\", \"author\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the message.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\n \"message\",\n \"opened\",\n \"assigned\",\n \"rated\",\n \"scheduled\",\n \"collaboratorAdded\",\n \"collaboratorRemoved\",\n \"statusChanged\",\n \"priorityChanged\",\n \"scheduleDateChanged\",\n \"locationChanged\",\n \"issueChanged\",\n \"nudged\",\n \"approvalRequested\",\n \"approvalApproved\",\n \"approvalDenied\",\n \"workScheduled\",\n \"workRescheduled\",\n \"workCanceled\",\n \"workCompleted\",\n \"workNotCompleted\",\n \"workVerificationCleared\",\n \"costRecorded\",\n \"costPriceChanged\",\n \"costVoided\",\n \"awaitingResponse\",\n \"awaitingResponseCleared\",\n ],\n default: \"message\",\n description: \"The discriminator of the message.\",\n },\n isInternal: {\n type: \"boolean\",\n description:\n \"Whether the message is internal to the assignedTo and collaborators. Internal messages are not visible to the requester.\",\n default: false,\n },\n author: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the author of the message.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\", \"system\"],\n description: \"The discriminator of the author of the message.\",\n },\n name: {\n type: \"string\",\n description: \"The name of the author of the message.\",\n },\n },\n },\n timestamp: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"The ISO 8601 timestamp of the message.\",\n },\n body: {\n type: \"string\",\n description: \"The body of the message.\",\n },\n parsedBody: {\n type: \"object\",\n additionalProperties: false,\n description:\n \"An object containing the parsed body of the message for mentions.\",\n properties: {\n content: {\n type: \"array\",\n minItems: 1,\n description:\n \"Rich-text block nodes (ADR 0012). Present = rich message: `body` is the server-derived plain-text projection of this tree, and the legacy text/mentions fields are not written.\",\n items: {\n anyOf: [\n richTextParagraphNode,\n richTextBulletListNode,\n richTextOrderedListNode,\n ],\n },\n },\n text: {\n type: \"string\",\n description: \"The mention text (legacy tokenized format).\",\n },\n mentions: {\n type: \"array\",\n default: [],\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\n \"discriminator\",\n \"id\",\n \"index\",\n \"length\",\n \"originalText\",\n ],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the mention.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\", \"system\"],\n description:\n \"The discriminator of entity that was mentioned.\",\n },\n index: {\n type: \"integer\",\n description: \"The index of the mention in the message.\",\n },\n length: {\n type: \"integer\",\n description: \"The length of the mention in the message.\",\n },\n originalText: {\n type: \"string\",\n description: \"The original text of the mention.\",\n },\n },\n },\n },\n },\n },\n statusChanged: {\n type: \"object\",\n additionalProperties: false,\n required: [\"from\", \"to\"],\n description:\n \"Structured status transition for `statusChanged` entries. Lets consumers detect reopens (from solved/closed to open) without parsing the body text.\",\n properties: {\n from: {\n type: \"string\",\n enum: [\"open\", \"pending\", \"solved\", \"closed\"],\n description: \"The status the ticket transitioned from.\",\n },\n to: {\n type: \"string\",\n enum: [\"open\", \"pending\", \"solved\", \"closed\"],\n description: \"The status the ticket transitioned to.\",\n },\n },\n },\n awaitingResponse: {\n type: \"object\",\n additionalProperties: false,\n required: [\"awaiting\"],\n description:\n \"Legacy. Earlier releases announced the Awaiting response marker in the conversation; the marker now lives only in the ticket's `awaitingResponse` slot and no new entries of this kind are written.\",\n properties: {\n awaiting: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n properties: {\n id: { type: \"string\" },\n discriminator: { type: \"string\", enum: [\"user\"] },\n name: { type: \"string\" },\n },\n },\n messageId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The conversation message this marker was sent with, when the composer set both in one write.\",\n },\n },\n },\n awaitingResponseCleared: {\n type: \"object\",\n additionalProperties: false,\n required: [\"reason\"],\n description:\n \"Legacy. Earlier releases announced the end of a wait in the conversation; no new entries of this kind are written.\",\n properties: {\n reason: {\n type: \"string\",\n enum: [\"explicit\", \"left\"],\n },\n },\n },\n readBy: {\n type: \"array\",\n default: [],\n items: {\n type: \"string\",\n },\n description: \"The IDs of the users who have read the message.\",\n },\n media: {\n anyOf: [{ $ref: \"mediaFile.json\" }, { type: \"null\" }],\n description: \"The media file associated with the message.\",\n },\n attachments: {\n type: \"array\",\n items: { $ref: \"mediaFile.json\" },\n description:\n \"Files attached to the message. Supersedes the singular media.\",\n },\n },\n },\n },\n subject: {\n type: \"string\",\n description: \"The subject of the ticket.\",\n },\n openedBy: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n properties: {\n id: {\n type: \"string\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"system\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n requester: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the requester.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\", \"system\", \"device\"],\n description: \"The discriminator of the requester.\",\n },\n name: {\n type: \"string\",\n description: \"The name of the requester.\",\n },\n photo: {\n anyOf: [\n { $ref: \"mediaFile.json\" },\n { type: \"null\" },\n { type: \"string\" },\n ],\n description: \"The photo of the requester.\",\n },\n },\n },\n assignedTo: {\n type: [\"object\", \"null\"],\n default: null,\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the assigned to.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\"],\n description: \"The discriminator of the assigned to.\",\n },\n name: {\n type: \"string\",\n description: \"The name of the assigned to.\",\n },\n photo: {\n anyOf: [\n { $ref: \"mediaFile.json\" },\n { type: \"null\" },\n { type: \"string\" },\n ],\n description: \"The photo of the assigned to.\",\n },\n },\n },\n notify: {\n type: \"array\",\n description:\n \"A list of entities to notify when this ticket is created or resolved.\",\n default: [],\n items: {\n type: \"object\",\n required: [\"id\", \"discriminator\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the entity to notify.\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\"],\n },\n },\n },\n },\n collaborators: {\n type: \"array\",\n default: [],\n description: \"A list of entities who will collaborate on this ticket.\",\n items: {\n type: \"object\",\n required: [\"id\", \"name\", \"discriminator\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n name: {\n type: \"string\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\"],\n },\n },\n },\n },\n location: {\n type: \"object\",\n required: [\"discriminator\", \"name\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n discriminator: {\n type: \"string\",\n enum: [\"space\", \"property\", \"customText\"],\n },\n name: {\n type: \"string\",\n },\n },\n },\n status: {\n type: \"string\",\n enum: [\"open\", \"pending\", \"solved\", \"closed\"],\n default: \"open\",\n },\n priority: {\n type: \"string\",\n enum: [\"low\", \"normal\", \"high\", \"critical\"],\n default: \"normal\",\n },\n priorityRank: {\n type: \"integer\",\n minimum: 1,\n maximum: 4,\n description:\n \"Server-derived numeric rank of priority (low=1, normal=2, high=3, critical=4). Denormalized to support priority sorting; never set by clients.\",\n },\n reopenCount: {\n type: \"integer\",\n minimum: 0,\n default: 0,\n description:\n 'Server-derived count of transitions back to \"open\" that followed a solve/close. reopenCount > 0 answers \"was this ticket ever reopened?\" in O(1); maintained at the repository layer across every status-write path. Never set by clients.',\n },\n work: {\n type: \"array\",\n default: [],\n description:\n \"Work items scheduled on the ticket: who is coming, when, and what for. Many per ticket, including repeat visits by the same performer. Carries no lifecycle status — the conversation log is the history, and only a roster verification says whether a past-dated visit happened. Never redacted; vendor identity is already public in assignment.\",\n items: workItemSchema,\n },\n costs: {\n type: \"array\",\n default: [],\n description:\n \"Cost line items recorded on the ticket. Each entry stores the customer price and the vendor cost side by side and keeps them independent: the price is seeded from the estimate and markup at recording, and nothing about the vendor side moves it afterwards. Every entry arrives as either the full vendor shape or the redacted price-only shape depending on whether the viewer may see the cost split.\",\n items: {\n oneOf: [fullCostEntrySchema, redactedCostEntrySchema],\n },\n },\n approvals: {\n type: \"array\",\n default: [],\n description:\n \"Approval request history for the ticket. At most one pending record at a time; records are immutable once decided (enforced by use cases).\",\n items: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"amount\", \"approverUserIds\", \"status\", \"requestedAt\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The ID of the approval record.\",\n },\n amount: {\n type: \"integer\",\n minimum: 0,\n description:\n \"The ticket's customer price total in integer cents, frozen at request time.\",\n },\n approverUserIds: {\n type: \"array\",\n minItems: 1,\n items: {\n type: \"string\",\n },\n description:\n \"The effective approver set for this request, frozen at request time.\",\n },\n status: {\n type: \"string\",\n enum: [\"pending\", \"approved\", \"denied\"],\n default: \"pending\",\n },\n requestedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the approval was requested.\",\n },\n requestedBy: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The ID of the user whose write created this request, frozen at request time. Null when the write was not user-attributable.\",\n },\n decidedBy: {\n type: [\"string\", \"null\"],\n default: null,\n description: \"The ID of the approver who decided the request.\",\n },\n decidedAt: {\n anyOf: [\n { $ref: \"definitions.json#/definitions/date\" },\n { type: \"null\" },\n ],\n default: null,\n description: \"When the request was decided.\",\n },\n comment: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"The decider's comment. Required on deny, optional on approve (enforced by use cases).\",\n },\n },\n },\n },\n dneAmount: {\n type: [\"integer\", \"null\"],\n minimum: 0,\n description:\n \"The effective do-not-exceed amount in integer cents the approval gate compares against, resolved per read from the organization and property Concierge settings. Never stored on the document and never set by clients; absent on payloads where it could not be resolved. Viewer-independent: the DNE is the customer's own contract term, so org-side viewers see it.\",\n },\n stages: {\n type: \"array\",\n description:\n \"The Stages the ticket carries, in the fixed chip order. Derived at read time from the ticket's own facts, never stored and never set by clients, and absent for every viewer outside Kohost's facilities staff. A ticket may carry several at once; `closed` and `pending` tickets carry none.\",\n items: {\n type: \"string\",\n enum: [\n \"awaitingClientApproval\",\n \"awaitingClientResponse\",\n \"awaitingVendorQuote\",\n \"awaitingScheduling\",\n \"vendorScheduled\",\n \"confirmCosts\",\n \"resolveReady\",\n ],\n },\n },\n approvalState: {\n type: \"string\",\n enum: [\"clear\", \"awaitingApproval\", \"denied\"],\n default: \"clear\",\n description:\n \"Server-maintained denormalization of the approval gate, updated on every cost or approval write (reopenCount pattern) so queue filters get O(1) access. Never set by clients.\",\n },\n awaitingResponse: {\n type: [\"object\", \"null\"],\n default: null,\n additionalProperties: false,\n required: [\"author\", \"awaiting\", \"since\"],\n description:\n \"A Kohost Facilities agent's private note that they are waiting on a reply, from one named participant outside Kohost's side or from anyone outside it. Served only to the Facilities roster; every other viewer receives null. A named wait ends when anyone other than its author posts a public message or when the awaited person leaves the ticket; an anyone wait ends when someone outside Kohost's side posts a public message. Either ends when the roster clears it. Written only through SetAwaitingResponse and ClearAwaitingResponse.\",\n properties: {\n author: {\n type: \"object\",\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n description: \"Who set the marker.\",\n properties: {\n id: { type: \"string\" },\n discriminator: {\n type: \"string\",\n enum: [\"user\", \"vendor\", \"system\"],\n },\n name: { type: \"string\" },\n },\n },\n awaiting: {\n type: [\"object\", \"null\"],\n additionalProperties: false,\n required: [\"id\", \"discriminator\", \"name\"],\n description:\n \"The person the ticket is waiting on. Null when the wait is on anyone outside Kohost's side rather than one named person.\",\n properties: {\n id: { type: \"string\" },\n discriminator: { type: \"string\", enum: [\"user\"] },\n name: { type: \"string\" },\n },\n },\n since: {\n $ref: \"definitions.json#/definitions/date\",\n description: \"When the marker was set.\",\n },\n messageId: {\n type: [\"string\", \"null\"],\n default: null,\n description:\n \"Legacy. Earlier releases linked the marker to the message it was sent with; no longer written.\",\n },\n },\n },\n tags: {\n type: \"array\",\n default: [],\n items: {\n type: \"string\",\n },\n },\n rating: {\n type: \"number\",\n minimum: 0,\n maximum: 5,\n },\n ratingComment: {\n type: \"string\",\n },\n scheduleDate: {\n $ref: \"definitions.json#/definitions/date\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n solvedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n lastMessageAt: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"Server-derived timestamp of the latest conversation message; initialized to createdAt when no message exists. Denormalized to support recency sorting; never set by clients.\",\n },\n closedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n deletedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n },\n} as const;\n\ntype TicketSchemaBase = FromSchema<\n typeof ticketSchema,\n {\n references: [typeof defs, typeof mediaFileSchema];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n\n/** A stored cost entry: the full shape, with `price`, `estimate` and `markup`. */\nexport type TicketCostEntry = Extract<\n NonNullable<TicketSchemaBase[\"costs\"]>[number],\n { estimate: unknown }\n>;\n\n/** One scheduled performance of work on a ticket. */\nexport type TicketWorkItem = NonNullable<TicketSchemaBase[\"work\"]>[number];\n\n/** One derived Stage a ticket may carry. The API's `resolveStages` owns the rules. */\nexport type TicketStage = NonNullable<TicketSchemaBase[\"stages\"]>[number];\n\n/** One append-only billing review entry on a stored cost entry. */\nexport type TicketCostBillingReviewEntry = NonNullable<\n TicketCostEntry[\"billingReview\"]\n>[number];\n\n// The runtime `costs.items` schema is a `oneOf` so a `Ticket` model validates\n// both wire shapes a read can return (see the schema comment), which makes the\n// derived element type a `full | redacted` union. A stored ticket, though, only\n// ever holds the full shape — the redacted projection exists solely at the API\n// read seam (`redactTicketCostSplit`, which casts through `unknown`). Model and\n// write-path consumers reason about the stored document, so `costs` is narrowed\n// back to the full entry here; the redacted shape stays a validation-only\n// concern rather than leaking into every `ticket.costs` dereference.\nexport type TicketSchema = Omit<TicketSchemaBase, \"costs\"> & {\n costs?: TicketCostEntry[];\n};\n"],"mappings":";;AAuDA,MAAM,sBAAsB;CAC1B,MAAM;CACN,UAAU;CACV,OAAO,EACL,OAAO;EAAC;GA3CV,MAAM;GACN,sBAAsB;GACtB,UAAU,CAAC,QAAQ,MAAM;GACzB,YAAY;IACV,MAAM;KAAE,MAAM;KAAU,MAAM,CAAC,MAAM;IAAE;IACvC,MAAM,EAAE,MAAM,SAAS;IACvB,OAAO;KACL,MAAM;KACN,aAAa;KACb,OAAO;MA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AAM;IACN,sBAAsB;IACtB,UAAU;KAAC;KAAM;KAAiB;KAAa;KAAQ;IAAQ;IAC/D,YAAY;KACV,IAAI;MACF,MAAM;MACN,aAAa;KACf;KACA,eAAe;MACb,MAAM;MACN,MAAM;OACJ;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;OACA;MACF;MACA,SAAS;MACT,aAAa;KACf;KACA,YAAY;MACV,MAAM;MACN,aACE;MACF,SAAS;KACX;KACA,QAAQ;MACN,MAAM;MACN,sBAAsB;MACtB,UAAU;OAAC;OAAM;OAAiB;MAAM;MACxC,YAAY;OACV,IAAI;QACF,MAAM;QACN,aAAa;OACf;OACA,eAAe;QACb,MAAM;QACN,MAAM;SAAC;SAAQ;SAAU;QAAQ;QACjC,aAAa;OACf;OACA,MAAM;QACJ,MAAM;QACN,aAAa;OACf;MACF;KACF;KACA,WAAW;MACT,MAAM;MACN,aAAa;KACf;KACA,MAAM;MACJ,MAAM;MACN,aAAa;KACf;KACA,YAAY;MACV,MAAM;MACN,sBAAsB;MACtB,aACE;MACF,YAAY;OACV,SAAS;QACP,MAAM;QACN,UAAU;QACV,aACE;QACF,OAAO,EACL,OAAO;SACL;SACA;SACA;QACF,EACF;OACF;OACA,MAAM;QACJ,MAAM;QACN,aAAa;OACf;OACA,UAAU;QACR,MAAM;QACN,SAAS,CAAC;QACV,OAAO;SACL,MAAM;SACN,sBAAsB;SACtB,UAAU;UACR;UACA;UACA;UACA;UACA;SACF;SACA,YAAY;UACV,IAAI;WACF,MAAM;WACN,aAAa;UACf;UACA,eAAe;WACb,MAAM;WACN,MAAM;YAAC;YAAQ;YAAU;WAAQ;WACjC,aACE;UACJ;UACA,OAAO;WACL,MAAM;WACN,aAAa;UACf;UACA,QAAQ;WACN,MAAM;WACN,aAAa;UACf;UACA,cAAc;WACZ,MAAM;WACN,aAAa;UACf;SACF;QAC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+ export interface ActivateServiceContractCommandConfig {
2
+ data?: {
3
+ id: string;
4
+ [key: string]: unknown;
5
+ } | null;
6
+ headers?: Record<string, string> | null;
7
+ query?: Record<string, unknown> | null;
8
+ }
9
+ export interface ActivateServiceContractCommandRequestConfig {
10
+ method: "post";
11
+ url: string;
12
+ data: {
13
+ id: string;
14
+ [key: string]: unknown;
15
+ } | null;
16
+ params: Record<string, unknown> | null;
17
+ headers: Record<string, string> | null;
18
+ [key: string]: unknown;
19
+ }
20
+ /**
21
+ * Activates a draft Service contract once the written approval, categorized customer splits that add up to the customer total, and, with a vendor stream, a Vendor and split vendor amounts that add up to the vendor total are present. Each stream mints from its start; one that started before today mints from the period containing today unless `backdate: { customer?, vendor? }` asks for its first period.
22
+ */
23
+ export declare class ActivateServiceContractCommand {
24
+ url: string;
25
+ data: {
26
+ id: string;
27
+ [key: string]: unknown;
28
+ } | null;
29
+ query: Record<string, unknown> | null;
30
+ headers: Record<string, string> | null;
31
+ config: ActivateServiceContractCommandRequestConfig;
32
+ static params: readonly ["id"];
33
+ static url: string;
34
+ static method: "post";
35
+ constructor(commandConfig: ActivateServiceContractCommandConfig, options?: Record<string, unknown>);
36
+ }