@dakkitor/api-contracts 1.1.131 → 1.1.133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abilities/abilities.contract.d.ts +19 -13
- package/dist/abilities/abilities.contract.js +33 -18
- package/dist/abilities/first-agent.abilities.json +68 -56
- package/dist/abilities/second-agent.abilities.json +3 -3
- package/dist/abilities/team-leads.json +3 -6
- package/dist/actives/actives.contract.d.ts +6313 -6313
- package/dist/actives/actives.contract.js +92 -92
- package/dist/agent-client-links/agent-client-links.contract.d.ts +511 -511
- package/dist/auth/auth.contract.d.ts +16 -16
- package/dist/bookings/bookings.contract.d.ts +23378 -23378
- package/dist/call-history/call-history.contract.d.ts +366 -366
- package/dist/call-history/call-history.contract.js +67 -67
- package/dist/client-contacts/client-contacts.contract.d.ts +159 -159
- package/dist/clients/clients.contract.d.ts +72 -72
- package/dist/collaboration-checkings/collaboration-checkings.contract.d.ts +1330 -1330
- package/dist/collaborations/collaborations.contract.d.ts +1198 -1198
- package/dist/common/call-rating.schema.d.ts +12 -12
- package/dist/common/call-rating.schema.js +48 -40
- package/dist/common/common-schemas.d.ts +4 -4
- package/dist/common/common-schemas.d.ts.map +1 -1
- package/dist/common/common-schemas.js +1 -2
- package/dist/common/error-schemas.d.ts +11 -5
- package/dist/common/error-schemas.js +11 -8
- package/dist/common/openapi-metadata.d.ts +54 -44
- package/dist/common/openapi-metadata.js +135 -129
- package/dist/common/pagination-query.schema.d.ts +11 -5
- package/dist/common/pagination-query.schema.js +11 -8
- package/dist/companies/companies.contract.d.ts +40 -40
- package/dist/cron-executions/cron-executions.contract.d.ts +14 -14
- package/dist/curated-workers/curated-workers.contract.d.ts +211 -211
- package/dist/dashboards/agent-daily-metrics.contract.d.ts +798 -616
- package/dist/dashboards/agent-daily-metrics.contract.js +100 -89
- package/dist/dashboards/dashboard-widgets.contract.d.ts +75 -75
- package/dist/dashboards/dashboard-widgets.contract.js +89 -89
- package/dist/dashboards/dashboard.contract.d.ts +305 -215
- package/dist/files/files.contract.d.ts +1544 -1177
- package/dist/files/files.contract.js +177 -162
- package/dist/health/health.contract.d.ts +191 -144
- package/dist/health/health.contract.js +53 -40
- package/dist/index.d.ts +67 -67
- package/dist/jobs/jobs.contract.d.ts +2553 -2553
- package/dist/jobs/jobs.contract.js +150 -150
- package/dist/lead-assignments/lead-assignments.contract.d.ts +587 -587
- package/dist/lead-distribution/agent-lead-distribution.contract.d.ts +239 -239
- package/dist/lead-distribution/lead-distribution-config.contract.d.ts +25 -25
- package/dist/leads/leads.contract.d.ts +108 -108
- package/dist/leads/leads.contract.js +119 -119
- package/dist/locations/locations.contract.d.ts +7 -7
- package/dist/monitoring/monitoring.contract.d.ts +13 -13
- package/dist/monitoring/monitoring.contract.js +37 -37
- package/dist/own-research/own-research.contract.d.ts +535 -134
- package/dist/own-research/own-research.contract.d.ts.map +1 -1
- package/dist/own-research/own-research.contract.js +88 -56
- package/dist/postcodes/postcodes.contract.d.ts +24 -24
- package/dist/qualifications/qualifications.contract.d.ts +1898 -1387
- package/dist/qualifications/qualifications.contract.js +193 -171
- package/dist/trades/trades.contract.d.ts +991 -763
- package/dist/trades/trades.contract.js +111 -89
- package/dist/users/users.contract.d.ts +202 -202
- package/dist/users/users.contract.js +121 -121
- package/dist/workers/workers.contract.d.ts +710 -710
- package/dist/workers/workers.contract.js +150 -150
- package/package.json +1 -1
|
@@ -12,64 +12,64 @@ const pagination_schema_1 = require("../common/pagination.schema");
|
|
|
12
12
|
(0, zod_openapi_1.extendZodWithOpenApi)(zod_1.z);
|
|
13
13
|
// Enums
|
|
14
14
|
exports.ActiveStatusSchema = zod_1.z.enum([
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
'PENDING',
|
|
16
|
+
'ACTIVE',
|
|
17
|
+
'VACATION',
|
|
18
|
+
'LEFT_THE_SITE',
|
|
19
|
+
'MEDICAL_LEAVE',
|
|
20
|
+
'DAY_OFF',
|
|
21
|
+
'INJURY',
|
|
22
22
|
]);
|
|
23
23
|
exports.ActiveStatusFilterTypeSchema = zod_1.z.enum([
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
'SECOND_AGENT',
|
|
25
|
+
'FIRST_AGENT',
|
|
26
|
+
'BOTH',
|
|
27
|
+
'EITHER',
|
|
28
28
|
]);
|
|
29
29
|
exports.ActiveSortableFieldsSchema = zod_1.z.enum([
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
'date',
|
|
31
|
+
'payRate',
|
|
32
|
+
'status',
|
|
33
|
+
'updatedAt',
|
|
34
34
|
]);
|
|
35
35
|
// Active Pay schema - includes receivedRate
|
|
36
36
|
const ActivePaySchema = zod_1.z
|
|
37
37
|
.object({
|
|
38
|
-
rate: zod_1.z.coerce.number().min(0).describe(
|
|
39
|
-
unit: common_schemas_1.RateUnitSchema.describe(
|
|
38
|
+
rate: zod_1.z.coerce.number().min(0).describe('Pay Rate'),
|
|
39
|
+
unit: common_schemas_1.RateUnitSchema.describe('Pay Unit'),
|
|
40
40
|
receivedRate: zod_1.z.coerce
|
|
41
41
|
.number()
|
|
42
42
|
.nullable()
|
|
43
|
-
.describe(
|
|
43
|
+
.describe('The received pay rate'),
|
|
44
44
|
})
|
|
45
|
-
.openapi({ title:
|
|
45
|
+
.openapi({ title: 'ActivePay' });
|
|
46
46
|
// Worker Pay schema for create/update (without receivedRate for SA)
|
|
47
47
|
const WorkerPaySchema = zod_1.z.object({
|
|
48
|
-
rate: zod_1.z.number().min(0).describe(
|
|
49
|
-
unit: common_schemas_1.RateUnitSchema.describe(
|
|
48
|
+
rate: zod_1.z.number().min(0).describe('Pay Rate'),
|
|
49
|
+
unit: common_schemas_1.RateUnitSchema.describe('Pay Unit'),
|
|
50
50
|
});
|
|
51
51
|
// Active Pay update schema for FA - includes receivedRate
|
|
52
52
|
const ActivePayUpdateSchema = zod_1.z
|
|
53
53
|
.object({
|
|
54
|
-
rate: zod_1.z.number().min(0).optional().describe(
|
|
55
|
-
unit: common_schemas_1.RateUnitSchema.optional().describe(
|
|
54
|
+
rate: zod_1.z.number().min(0).optional().describe('Pay Rate'),
|
|
55
|
+
unit: common_schemas_1.RateUnitSchema.optional().describe('Pay Unit'),
|
|
56
56
|
receivedRate: zod_1.z
|
|
57
57
|
.number()
|
|
58
58
|
.min(0)
|
|
59
59
|
.optional()
|
|
60
60
|
.nullable()
|
|
61
|
-
.describe(
|
|
61
|
+
.describe('Updated received rate'),
|
|
62
62
|
})
|
|
63
|
-
.openapi({ title:
|
|
63
|
+
.openapi({ title: 'ActivePayUpdate' });
|
|
64
64
|
// Active Status Filter
|
|
65
65
|
const ActiveStatusFilterSchema = zod_1.z
|
|
66
66
|
.object({
|
|
67
|
-
status: exports.ActiveStatusSchema.optional().describe(
|
|
67
|
+
status: exports.ActiveStatusSchema.optional().describe('Filter by status value'),
|
|
68
68
|
filterType: exports.ActiveStatusFilterTypeSchema.optional()
|
|
69
|
-
.default(
|
|
70
|
-
.describe(
|
|
69
|
+
.default('EITHER')
|
|
70
|
+
.describe('Status filter type: SECOND_AGENT (check only SA status), FIRST_AGENT (check only FA status), BOTH (both statuses must be the same), EITHER (either SA or FA status can match)'),
|
|
71
71
|
})
|
|
72
|
-
.openapi({ title:
|
|
72
|
+
.openapi({ title: 'ActiveStatusFilter' });
|
|
73
73
|
// ============================================================================
|
|
74
74
|
// Main Active schema
|
|
75
75
|
// ============================================================================
|
|
@@ -78,32 +78,32 @@ exports.ActiveSchema = zod_1.z
|
|
|
78
78
|
id: zod_1.z
|
|
79
79
|
.string()
|
|
80
80
|
.uuid()
|
|
81
|
-
.describe(
|
|
82
|
-
date: zod_1.z.string().date().describe(
|
|
83
|
-
pay: ActivePaySchema.describe(
|
|
84
|
-
comment: zod_1.z.string().nullable().describe(
|
|
85
|
-
statusSa: exports.ActiveStatusSchema.describe(
|
|
81
|
+
.describe('The unique identifier of the active record.'),
|
|
82
|
+
date: zod_1.z.string().date().describe('The date when the worker was active.'),
|
|
83
|
+
pay: ActivePaySchema.describe('Pay Information'),
|
|
84
|
+
comment: zod_1.z.string().nullable().describe('Optional comment for the day.'),
|
|
85
|
+
statusSa: exports.ActiveStatusSchema.describe('Filter by status value.'),
|
|
86
86
|
statusSaUpdatedAt: zod_1.z
|
|
87
87
|
.union([zod_1.z.string().datetime(), zod_1.z.date(), zod_1.z.null()])
|
|
88
88
|
.transform((val) => (val instanceof Date ? val.toISOString() : val))
|
|
89
89
|
.nullable()
|
|
90
|
-
.describe(
|
|
91
|
-
statusFa: exports.ActiveStatusSchema.describe(
|
|
90
|
+
.describe('The timestamp when statusSa was last updated.'),
|
|
91
|
+
statusFa: exports.ActiveStatusSchema.describe('Filter by status value.'),
|
|
92
92
|
statusFaUpdatedAt: zod_1.z
|
|
93
93
|
.union([zod_1.z.string().datetime(), zod_1.z.date(), zod_1.z.null()])
|
|
94
94
|
.transform((val) => (val instanceof Date ? val.toISOString() : val))
|
|
95
95
|
.nullable()
|
|
96
|
-
.describe(
|
|
96
|
+
.describe('The timestamp when statusFa was last updated.'),
|
|
97
97
|
hoursWorked: zod_1.z.coerce
|
|
98
98
|
.number()
|
|
99
99
|
.nullable()
|
|
100
|
-
.describe(
|
|
100
|
+
.describe('The number of hours worked.'),
|
|
101
101
|
hoursWorkedUpdatedAt: zod_1.z
|
|
102
102
|
.union([zod_1.z.string().datetime(), zod_1.z.date(), zod_1.z.null()])
|
|
103
103
|
.transform((val) => (val instanceof Date ? val.toISOString() : val))
|
|
104
104
|
.nullable()
|
|
105
|
-
.describe(
|
|
106
|
-
booking: zod_1.z.lazy(() => bookings_contract_1.BookingSchema).describe(
|
|
105
|
+
.describe('The timestamp when hours worked was last updated.'),
|
|
106
|
+
booking: zod_1.z.lazy(() => bookings_contract_1.BookingSchema).describe('Associated Booking'),
|
|
107
107
|
createdAt: zod_1.z
|
|
108
108
|
.union([zod_1.z.string().datetime(), zod_1.z.date()])
|
|
109
109
|
.transform((val) => (val instanceof Date ? val.toISOString() : val)),
|
|
@@ -111,141 +111,141 @@ exports.ActiveSchema = zod_1.z
|
|
|
111
111
|
.union([zod_1.z.string().datetime(), zod_1.z.date()])
|
|
112
112
|
.transform((val) => (val instanceof Date ? val.toISOString() : val)),
|
|
113
113
|
})
|
|
114
|
-
.openapi({ title:
|
|
114
|
+
.openapi({ title: 'Active' });
|
|
115
115
|
// Create Active schema
|
|
116
116
|
exports.CreateActiveSchema = zod_1.z
|
|
117
117
|
.object({
|
|
118
|
-
date: zod_1.z.string().date().describe(
|
|
119
|
-
pay: WorkerPaySchema.describe(
|
|
120
|
-
comment: zod_1.z.string().optional().describe(
|
|
121
|
-
statusSa: exports.ActiveStatusSchema.optional().describe(
|
|
122
|
-
statusFa: exports.ActiveStatusSchema.optional().describe(
|
|
118
|
+
date: zod_1.z.string().date().describe('Select date'),
|
|
119
|
+
pay: WorkerPaySchema.describe('Pay rate and unit'),
|
|
120
|
+
comment: zod_1.z.string().optional().describe('Enter comment'),
|
|
121
|
+
statusSa: exports.ActiveStatusSchema.optional().describe('Select SA status'),
|
|
122
|
+
statusFa: exports.ActiveStatusSchema.optional().describe('Select FA status'),
|
|
123
123
|
})
|
|
124
|
-
.openapi({ title:
|
|
124
|
+
.openapi({ title: 'CreateActive' });
|
|
125
125
|
exports.UpdateActiveSchema = zod_1.z
|
|
126
126
|
.object({
|
|
127
|
-
pay: ActivePayUpdateSchema.optional().describe(
|
|
128
|
-
hoursWorked: zod_1.z.number().min(0).optional().describe(
|
|
129
|
-
comment: zod_1.z.string().nullable().optional().describe(
|
|
130
|
-
statusSa: exports.ActiveStatusSchema.optional().describe(
|
|
131
|
-
statusFa: exports.ActiveStatusSchema.optional().describe(
|
|
127
|
+
pay: ActivePayUpdateSchema.optional().describe('Updated pay rate and unit'),
|
|
128
|
+
hoursWorked: zod_1.z.number().min(0).optional().describe('Updated hours worked'),
|
|
129
|
+
comment: zod_1.z.string().nullable().optional().describe('Updated comment'),
|
|
130
|
+
statusSa: exports.ActiveStatusSchema.optional().describe('Updated SA status'),
|
|
131
|
+
statusFa: exports.ActiveStatusSchema.optional().describe('Updated FA status'),
|
|
132
132
|
})
|
|
133
|
-
.openapi({ title:
|
|
133
|
+
.openapi({ title: 'UpdateActive' });
|
|
134
134
|
// Filter Active schema
|
|
135
135
|
exports.FilterActiveSchema = pagination_query_schema_1.PaginationQuerySchema.extend({
|
|
136
136
|
workerName: zod_1.z
|
|
137
137
|
.string()
|
|
138
138
|
.optional()
|
|
139
139
|
.nullable()
|
|
140
|
-
.describe(
|
|
140
|
+
.describe('Search worker by name'),
|
|
141
141
|
agentId: zod_1.z
|
|
142
142
|
.string()
|
|
143
143
|
.uuid()
|
|
144
144
|
.optional()
|
|
145
145
|
.nullable()
|
|
146
|
-
.describe(
|
|
146
|
+
.describe('Search Second Agent'),
|
|
147
147
|
job: bookings_contract_1.FilterJobInBookingSchema.optional()
|
|
148
148
|
.nullable()
|
|
149
|
-
.describe(
|
|
150
|
-
date: common_schemas_1.DateRangeSchema.optional().nullable().describe(
|
|
149
|
+
.describe('Filter by job details'),
|
|
150
|
+
date: common_schemas_1.DateRangeSchema.optional().nullable().describe('Filter by date range'),
|
|
151
151
|
pay: common_schemas_1.PayRangeSchema.optional()
|
|
152
152
|
.nullable()
|
|
153
|
-
.describe(
|
|
153
|
+
.describe('Filter by pay rate range'),
|
|
154
154
|
status: ActiveStatusFilterSchema.optional()
|
|
155
155
|
.nullable()
|
|
156
|
-
.describe(
|
|
156
|
+
.describe('Filter by status'),
|
|
157
157
|
sortBy: exports.ActiveSortableFieldsSchema.optional()
|
|
158
158
|
.nullable()
|
|
159
|
-
.describe(
|
|
159
|
+
.describe('The field to sort the results by'),
|
|
160
160
|
sortOrder: common_schemas_1.SortOrderSchema.optional()
|
|
161
161
|
.nullable()
|
|
162
|
-
.describe(
|
|
162
|
+
.describe('The order to sort the results by'),
|
|
163
163
|
});
|
|
164
164
|
exports.PaginatedActiveResponseSchema = (0, pagination_schema_1.createPaginatedResponseSchema)(exports.ActiveSchema)
|
|
165
|
-
.describe(
|
|
166
|
-
.openapi({ title:
|
|
165
|
+
.describe('Active records retrieved successfully')
|
|
166
|
+
.openapi({ title: 'ActivesPaginatedResponse' });
|
|
167
167
|
// Contract
|
|
168
168
|
const c = (0, core_1.initContract)();
|
|
169
169
|
exports.activesContractRouter = c.router({
|
|
170
170
|
create: {
|
|
171
|
-
method:
|
|
172
|
-
path:
|
|
171
|
+
method: 'POST',
|
|
172
|
+
path: '/v2/bookings/:bookingId/actives',
|
|
173
173
|
responses: {
|
|
174
174
|
201: exports.ActiveSchema,
|
|
175
175
|
404: error_schemas_1.ErrorResponseSchema,
|
|
176
176
|
409: error_schemas_1.ErrorResponseSchema,
|
|
177
177
|
},
|
|
178
178
|
pathParams: zod_1.z.object({
|
|
179
|
-
bookingId: zod_1.z.string().uuid().describe(
|
|
179
|
+
bookingId: zod_1.z.string().uuid().describe('Booking ID'),
|
|
180
180
|
}),
|
|
181
181
|
body: exports.CreateActiveSchema,
|
|
182
|
-
summary:
|
|
182
|
+
summary: 'Create a new active record for a specific booking',
|
|
183
183
|
metadata: {
|
|
184
|
-
tags: [
|
|
185
|
-
openApi: { operationId:
|
|
184
|
+
tags: ['Actives'],
|
|
185
|
+
openApi: { operationId: 'createActiveForBooking' },
|
|
186
186
|
},
|
|
187
187
|
},
|
|
188
188
|
findAll: {
|
|
189
|
-
method:
|
|
190
|
-
path:
|
|
189
|
+
method: 'GET',
|
|
190
|
+
path: '/v2/actives',
|
|
191
191
|
responses: {
|
|
192
192
|
200: exports.PaginatedActiveResponseSchema,
|
|
193
193
|
},
|
|
194
194
|
query: exports.FilterActiveSchema,
|
|
195
|
-
summary:
|
|
195
|
+
summary: 'Get all active records',
|
|
196
196
|
metadata: {
|
|
197
|
-
tags: [
|
|
198
|
-
openApi: { operationId:
|
|
197
|
+
tags: ['Actives'],
|
|
198
|
+
openApi: { operationId: 'findAllActives' },
|
|
199
199
|
},
|
|
200
200
|
},
|
|
201
201
|
findOne: {
|
|
202
|
-
method:
|
|
203
|
-
path:
|
|
202
|
+
method: 'GET',
|
|
203
|
+
path: '/v2/actives/:id',
|
|
204
204
|
responses: {
|
|
205
205
|
200: exports.ActiveSchema,
|
|
206
206
|
404: error_schemas_1.ErrorResponseSchema,
|
|
207
207
|
},
|
|
208
208
|
pathParams: zod_1.z.object({
|
|
209
|
-
id: zod_1.z.string().uuid().describe(
|
|
209
|
+
id: zod_1.z.string().uuid().describe('Active Record ID'),
|
|
210
210
|
}),
|
|
211
|
-
summary:
|
|
211
|
+
summary: 'Get an active record by ID',
|
|
212
212
|
metadata: {
|
|
213
|
-
tags: [
|
|
214
|
-
openApi: { operationId:
|
|
213
|
+
tags: ['Actives'],
|
|
214
|
+
openApi: { operationId: 'findActiveById' },
|
|
215
215
|
},
|
|
216
216
|
},
|
|
217
217
|
update: {
|
|
218
|
-
method:
|
|
219
|
-
path:
|
|
218
|
+
method: 'PATCH',
|
|
219
|
+
path: '/v2/actives/:id',
|
|
220
220
|
responses: {
|
|
221
221
|
200: exports.ActiveSchema,
|
|
222
222
|
404: error_schemas_1.ErrorResponseSchema,
|
|
223
223
|
},
|
|
224
224
|
pathParams: zod_1.z.object({
|
|
225
|
-
id: zod_1.z.string().uuid().describe(
|
|
225
|
+
id: zod_1.z.string().uuid().describe('Active Record ID'),
|
|
226
226
|
}),
|
|
227
227
|
body: exports.UpdateActiveSchema,
|
|
228
|
-
summary:
|
|
228
|
+
summary: 'Update an active record',
|
|
229
229
|
metadata: {
|
|
230
|
-
tags: [
|
|
231
|
-
openApi: { operationId:
|
|
230
|
+
tags: ['Actives'],
|
|
231
|
+
openApi: { operationId: 'updateActive' },
|
|
232
232
|
},
|
|
233
233
|
},
|
|
234
234
|
remove: {
|
|
235
|
-
method:
|
|
236
|
-
path:
|
|
235
|
+
method: 'DELETE',
|
|
236
|
+
path: '/v2/actives/:id',
|
|
237
237
|
responses: {
|
|
238
238
|
204: zod_1.z.undefined(),
|
|
239
239
|
404: error_schemas_1.ErrorResponseSchema,
|
|
240
240
|
},
|
|
241
241
|
pathParams: zod_1.z.object({
|
|
242
|
-
id: zod_1.z.string().uuid().describe(
|
|
242
|
+
id: zod_1.z.string().uuid().describe('Active Record ID'),
|
|
243
243
|
}),
|
|
244
244
|
body: c.noBody(),
|
|
245
|
-
summary:
|
|
245
|
+
summary: 'Delete an active record',
|
|
246
246
|
metadata: {
|
|
247
|
-
tags: [
|
|
248
|
-
openApi: { operationId:
|
|
247
|
+
tags: ['Actives'],
|
|
248
|
+
openApi: { operationId: 'deleteActive' },
|
|
249
249
|
},
|
|
250
250
|
},
|
|
251
251
|
}, {
|