@dakkitor/api-contracts 1.1.10 → 1.1.11
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/actives/actives.contract.d.ts +104 -104
- package/dist/actives/actives.contract.d.ts.map +1 -1
- package/dist/actives/actives.contract.js +3 -6
- package/dist/agent-client-links/agent-client-links.contract.d.ts +1905 -0
- package/dist/agent-client-links/agent-client-links.contract.d.ts.map +1 -0
- package/dist/agent-client-links/agent-client-links.contract.js +127 -0
- package/dist/auth/auth.contract.d.ts +319 -0
- package/dist/auth/auth.contract.d.ts.map +1 -0
- package/dist/auth/auth.contract.js +63 -0
- package/dist/bookings/bookings.contract.d.ts +273 -182
- package/dist/bookings/bookings.contract.d.ts.map +1 -1
- package/dist/bookings/bookings.contract.js +25 -33
- package/dist/call-history/call-history.contract.d.ts +1164 -0
- package/dist/call-history/call-history.contract.d.ts.map +1 -0
- package/dist/call-history/call-history.contract.js +254 -0
- package/dist/client-contacts/client-contacts.contract.d.ts +215 -268
- package/dist/client-contacts/client-contacts.contract.d.ts.map +1 -1
- package/dist/client-contacts/client-contacts.contract.js +21 -10
- package/dist/clients/clients.contract.d.ts +153 -125
- package/dist/clients/clients.contract.d.ts.map +1 -1
- package/dist/clients/clients.contract.js +44 -29
- package/dist/collaboration-checkings/collaboration-checkings.contract.d.ts +3013 -0
- package/dist/collaboration-checkings/collaboration-checkings.contract.d.ts.map +1 -0
- package/dist/collaboration-checkings/collaboration-checkings.contract.js +247 -0
- package/dist/collaborations/collaborations.contract.d.ts +2229 -0
- package/dist/collaborations/collaborations.contract.d.ts.map +1 -0
- package/dist/collaborations/collaborations.contract.js +284 -0
- package/dist/common/common-schemas.d.ts +100 -0
- package/dist/common/common-schemas.d.ts.map +1 -1
- package/dist/common/common-schemas.js +268 -1
- package/dist/common/openapi-metadata.d.ts +6 -0
- package/dist/common/openapi-metadata.d.ts.map +1 -1
- package/dist/companies/companies.contract.d.ts +1108 -0
- package/dist/companies/companies.contract.d.ts.map +1 -0
- package/dist/companies/companies.contract.js +164 -0
- package/dist/cron-executions/cron-executions.contract.d.ts +1643 -0
- package/dist/cron-executions/cron-executions.contract.d.ts.map +1 -0
- package/dist/cron-executions/cron-executions.contract.js +271 -0
- package/dist/curated-workers/curated-workers.contract.d.ts +3183 -0
- package/dist/curated-workers/curated-workers.contract.d.ts.map +1 -0
- package/dist/curated-workers/curated-workers.contract.js +444 -0
- package/dist/dashboards/agent-daily-metrics.contract.d.ts +639 -0
- package/dist/dashboards/agent-daily-metrics.contract.d.ts.map +1 -0
- package/dist/dashboards/agent-daily-metrics.contract.js +118 -0
- package/dist/files/files.contract.d.ts +1258 -0
- package/dist/files/files.contract.d.ts.map +1 -0
- package/dist/files/files.contract.js +205 -0
- package/dist/health/health.contract.d.ts +161 -0
- package/dist/health/health.contract.d.ts.map +1 -0
- package/dist/health/health.contract.js +52 -0
- package/dist/index.d.ts +27370 -3319
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -0
- package/dist/jobs/jobs.contract.d.ts +2303 -0
- package/dist/jobs/jobs.contract.d.ts.map +1 -0
- package/dist/jobs/jobs.contract.js +295 -0
- package/dist/lead-assignments/lead-assignments.contract.d.ts +1826 -0
- package/dist/lead-assignments/lead-assignments.contract.d.ts.map +1 -0
- package/dist/lead-assignments/lead-assignments.contract.js +187 -0
- package/dist/lead-distribution/agent-lead-distribution.contract.d.ts +1147 -0
- package/dist/lead-distribution/agent-lead-distribution.contract.d.ts.map +1 -0
- package/dist/lead-distribution/agent-lead-distribution.contract.js +154 -0
- package/dist/lead-distribution/lead-distribution-config.contract.d.ts +1085 -0
- package/dist/lead-distribution/lead-distribution-config.contract.d.ts.map +1 -0
- package/dist/lead-distribution/lead-distribution-config.contract.js +196 -0
- package/dist/leads/leads.contract.d.ts +1690 -0
- package/dist/leads/leads.contract.d.ts.map +1 -0
- package/dist/leads/leads.contract.js +328 -0
- package/dist/locations/locations.contract.d.ts +974 -0
- package/dist/locations/locations.contract.d.ts.map +1 -0
- package/dist/locations/locations.contract.js +154 -0
- package/dist/postcodes/postcodes.contract.d.ts +370 -0
- package/dist/postcodes/postcodes.contract.d.ts.map +1 -0
- package/dist/postcodes/postcodes.contract.js +90 -0
- package/dist/qualifications/qualifications.contract.d.ts +1489 -0
- package/dist/qualifications/qualifications.contract.d.ts.map +1 -0
- package/dist/qualifications/qualifications.contract.js +215 -0
- package/dist/trades/trades.contract.d.ts +799 -0
- package/dist/trades/trades.contract.d.ts.map +1 -0
- package/dist/trades/trades.contract.js +112 -0
- package/dist/users/users.contract.d.ts +102 -96
- package/dist/users/users.contract.d.ts.map +1 -1
- package/dist/users/users.contract.js +9 -21
- package/dist/workers/workers.contract.d.ts +3376 -0
- package/dist/workers/workers.contract.d.ts.map +1 -0
- package/dist/workers/workers.contract.js +363 -0
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jobs.contract.d.ts","sourceRoot":"","sources":["../../contracts/jobs/jobs.contract.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB;;GAEG;AACH,eAAO,MAAM,eAAe,iEAEM,CAAC;AAEnC;;GAEG;AACH,eAAO,MAAM,uBAAuB,qFAQM,CAAC;AAE3C,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;EAYM,CAAC;AAE7B,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAWM,CAAC;AAEnC,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAC5C,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAA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value: true });
|
|
3
|
+
exports.jobsContractRouter = exports.PaginatedJobResponseSchema = exports.FilterJobSchema = exports.UpdateJobSchema = exports.CreateJobSchema = exports.JobSchema = exports.CreateJobQualificationSchema = exports.JobQualificationSchema = exports.CreatePaySchema = exports.PaySchema = exports.JobSortableFieldsSchema = exports.JobStatusSchema = void 0;
|
|
4
|
+
const zod_openapi_1 = require("@anatine/zod-openapi");
|
|
5
|
+
const core_1 = require("@ts-rest/core");
|
|
6
|
+
const zod_1 = require("zod");
|
|
7
|
+
const common_schemas_1 = require("../common/common-schemas");
|
|
8
|
+
const error_schemas_1 = require("../common/error-schemas");
|
|
9
|
+
const pagination_query_schema_1 = require("../common/pagination-query.schema");
|
|
10
|
+
const pagination_schema_1 = require("../common/pagination.schema");
|
|
11
|
+
(0, zod_openapi_1.extendZodWithOpenApi)(zod_1.z);
|
|
12
|
+
/**
|
|
13
|
+
* Job Status Enum
|
|
14
|
+
*/
|
|
15
|
+
exports.JobStatusSchema = zod_1.z
|
|
16
|
+
.enum(['CANCELED', 'FILLED', 'AVAILABLE', 'NOT_AVAILABLE'])
|
|
17
|
+
.openapi({ title: 'JobStatus' });
|
|
18
|
+
/**
|
|
19
|
+
* Job Sortable Fields Enum
|
|
20
|
+
*/
|
|
21
|
+
exports.JobSortableFieldsSchema = zod_1.z
|
|
22
|
+
.enum([
|
|
23
|
+
'description',
|
|
24
|
+
'numberOfPositions',
|
|
25
|
+
'status',
|
|
26
|
+
'createdAt',
|
|
27
|
+
'updatedAt',
|
|
28
|
+
])
|
|
29
|
+
.openapi({ title: 'JobSortableFields' });
|
|
30
|
+
/**
|
|
31
|
+
* Pay Schema - Nested object for job payment details
|
|
32
|
+
*/
|
|
33
|
+
exports.PaySchema = zod_1.z
|
|
34
|
+
.object({
|
|
35
|
+
rateUnit: common_schemas_1.RateUnitSchema.describe('The unit for the pay rate'),
|
|
36
|
+
rate: zod_1.z.number().min(1).describe('The pay rate'),
|
|
37
|
+
rateMax: zod_1.z
|
|
38
|
+
.number()
|
|
39
|
+
.min(1)
|
|
40
|
+
.optional()
|
|
41
|
+
.nullable()
|
|
42
|
+
.describe('The maximum pay rate (for a range)'),
|
|
43
|
+
receivedRate: zod_1.z.number().min(1).describe('The received pay rate'),
|
|
44
|
+
})
|
|
45
|
+
.openapi({ title: 'Pay' });
|
|
46
|
+
exports.CreatePaySchema = zod_1.z
|
|
47
|
+
.object({
|
|
48
|
+
rateUnit: common_schemas_1.RateUnitSchema.optional().describe('The unit for the pay rate'),
|
|
49
|
+
rate: zod_1.z.number().min(1).describe('The pay rate'),
|
|
50
|
+
rateMax: zod_1.z
|
|
51
|
+
.number()
|
|
52
|
+
.min(1)
|
|
53
|
+
.optional()
|
|
54
|
+
.describe('The maximum pay rate (for a range)'),
|
|
55
|
+
receivedRate: zod_1.z.number().min(1).describe('The received pay rate'),
|
|
56
|
+
})
|
|
57
|
+
.openapi({ title: 'CreatePay' });
|
|
58
|
+
/**
|
|
59
|
+
* Job Qualification Schemas
|
|
60
|
+
*/
|
|
61
|
+
exports.JobQualificationSchema = zod_1.z
|
|
62
|
+
.object({
|
|
63
|
+
id: zod_1.z.string().uuid().describe('The ID of the job qualification'),
|
|
64
|
+
qualificationId: zod_1.z.string().uuid().describe('The ID of the qualification'),
|
|
65
|
+
qualificationTypeId: zod_1.z
|
|
66
|
+
.string()
|
|
67
|
+
.uuid()
|
|
68
|
+
.optional()
|
|
69
|
+
.nullable()
|
|
70
|
+
.describe('The ID of the qualification type'),
|
|
71
|
+
})
|
|
72
|
+
.openapi({ title: 'JobQualification' });
|
|
73
|
+
exports.CreateJobQualificationSchema = zod_1.z
|
|
74
|
+
.object({
|
|
75
|
+
qualificationId: zod_1.z.string().uuid().describe('The ID of the qualification'),
|
|
76
|
+
qualificationTypeId: zod_1.z
|
|
77
|
+
.string()
|
|
78
|
+
.uuid()
|
|
79
|
+
.optional()
|
|
80
|
+
.describe('The ID of the qualification type'),
|
|
81
|
+
})
|
|
82
|
+
.openapi({ title: 'CreateJobQualification' });
|
|
83
|
+
/**
|
|
84
|
+
* Main Job Schema
|
|
85
|
+
*/
|
|
86
|
+
exports.JobSchema = zod_1.z
|
|
87
|
+
.object({
|
|
88
|
+
id: zod_1.z.string().uuid().describe('Job ID'),
|
|
89
|
+
description: zod_1.z.string().describe('Job Description'),
|
|
90
|
+
numberOfPositions: zod_1.z
|
|
91
|
+
.number()
|
|
92
|
+
.int()
|
|
93
|
+
.min(1)
|
|
94
|
+
.describe('Number of Positions Available'),
|
|
95
|
+
workHours: zod_1.z
|
|
96
|
+
.number()
|
|
97
|
+
.min(0.01)
|
|
98
|
+
.max(24)
|
|
99
|
+
.optional()
|
|
100
|
+
.nullable()
|
|
101
|
+
.describe('Number of Work Hours'),
|
|
102
|
+
status: exports.JobStatusSchema.describe('Job Status'),
|
|
103
|
+
pay: exports.PaySchema.describe('Payment Details'),
|
|
104
|
+
location: common_schemas_1.LocationDetailsSchema.optional()
|
|
105
|
+
.nullable()
|
|
106
|
+
.describe('Job Location'),
|
|
107
|
+
tradeId: zod_1.z.string().uuid().describe('Trade ID'),
|
|
108
|
+
jobQualifications: zod_1.z
|
|
109
|
+
.array(exports.JobQualificationSchema)
|
|
110
|
+
.describe('Job Qualifications'),
|
|
111
|
+
currentCollaboration: zod_1.z
|
|
112
|
+
.object({
|
|
113
|
+
id: zod_1.z.string().uuid().describe('Collaboration ID'),
|
|
114
|
+
})
|
|
115
|
+
.nullable()
|
|
116
|
+
.optional()
|
|
117
|
+
.describe('Current Collaboration'),
|
|
118
|
+
createdAt: zod_1.z
|
|
119
|
+
.union([zod_1.z.string().datetime(), zod_1.z.date()])
|
|
120
|
+
.transform((val) => (val instanceof Date ? val.toISOString() : val))
|
|
121
|
+
.describe('Creation Date'),
|
|
122
|
+
updatedAt: zod_1.z
|
|
123
|
+
.union([zod_1.z.string().datetime(), zod_1.z.date()])
|
|
124
|
+
.transform((val) => (val instanceof Date ? val.toISOString() : val))
|
|
125
|
+
.describe('Last Update Date'),
|
|
126
|
+
})
|
|
127
|
+
.openapi({ title: 'Job' });
|
|
128
|
+
/**
|
|
129
|
+
* Create Job Schema
|
|
130
|
+
*/
|
|
131
|
+
exports.CreateJobSchema = zod_1.z
|
|
132
|
+
.object({
|
|
133
|
+
description: zod_1.z.string().min(10).describe('Job Description'),
|
|
134
|
+
location: common_schemas_1.CreateLocationSchema.optional().describe('Job Location'),
|
|
135
|
+
numberOfPositions: zod_1.z
|
|
136
|
+
.number()
|
|
137
|
+
.int()
|
|
138
|
+
.min(1)
|
|
139
|
+
.max(100)
|
|
140
|
+
.describe('Number of Positions'),
|
|
141
|
+
workHours: zod_1.z
|
|
142
|
+
.number()
|
|
143
|
+
.min(0.01)
|
|
144
|
+
.max(24)
|
|
145
|
+
.optional()
|
|
146
|
+
.describe('Number of Work Hours'),
|
|
147
|
+
pay: exports.CreatePaySchema.describe('Payment Details'),
|
|
148
|
+
tradeId: zod_1.z.string().uuid().describe('Trade ID'),
|
|
149
|
+
currentCollaboration: common_schemas_1.ResourceIdSchema.describe('Current Collaboration'),
|
|
150
|
+
jobQualifications: zod_1.z
|
|
151
|
+
.array(exports.CreateJobQualificationSchema)
|
|
152
|
+
.optional()
|
|
153
|
+
.describe('Job Qualifications'),
|
|
154
|
+
status: exports.JobStatusSchema.optional().describe('Job Status'),
|
|
155
|
+
})
|
|
156
|
+
.openapi({ title: 'CreateJob' });
|
|
157
|
+
/**
|
|
158
|
+
* Update Job Schema
|
|
159
|
+
*/
|
|
160
|
+
exports.UpdateJobSchema = zod_1.z
|
|
161
|
+
.object({
|
|
162
|
+
description: zod_1.z.string().min(10).optional().describe('Job Description'),
|
|
163
|
+
location: common_schemas_1.CreateLocationSchema.optional().describe('Job Location'),
|
|
164
|
+
numberOfPositions: zod_1.z
|
|
165
|
+
.number()
|
|
166
|
+
.int()
|
|
167
|
+
.min(1)
|
|
168
|
+
.max(100)
|
|
169
|
+
.optional()
|
|
170
|
+
.describe('Number of Positions'),
|
|
171
|
+
workHours: zod_1.z
|
|
172
|
+
.number()
|
|
173
|
+
.min(0.01)
|
|
174
|
+
.max(24)
|
|
175
|
+
.optional()
|
|
176
|
+
.describe('Number of Work Hours'),
|
|
177
|
+
pay: exports.CreatePaySchema.optional().describe('Payment Details'),
|
|
178
|
+
tradeId: zod_1.z.string().uuid().optional().describe('Trade ID'),
|
|
179
|
+
currentCollaboration: common_schemas_1.ResourceIdSchema.optional().describe('Current Collaboration'),
|
|
180
|
+
jobQualifications: zod_1.z
|
|
181
|
+
.array(exports.CreateJobQualificationSchema)
|
|
182
|
+
.optional()
|
|
183
|
+
.describe('Job Qualifications'),
|
|
184
|
+
status: exports.JobStatusSchema.optional().describe('Job Status'),
|
|
185
|
+
})
|
|
186
|
+
.openapi({ title: 'UpdateJob' });
|
|
187
|
+
/**
|
|
188
|
+
* Filter Job Schema
|
|
189
|
+
*/
|
|
190
|
+
exports.FilterJobSchema = pagination_query_schema_1.PaginationQuerySchema.extend({
|
|
191
|
+
tradeId: zod_1.z
|
|
192
|
+
.string()
|
|
193
|
+
.uuid()
|
|
194
|
+
.optional()
|
|
195
|
+
.nullable()
|
|
196
|
+
.describe('Filter by trade ID'),
|
|
197
|
+
status: exports.JobStatusSchema.optional()
|
|
198
|
+
.nullable()
|
|
199
|
+
.describe('Filter by job status'),
|
|
200
|
+
postcode: zod_1.z.string().optional().nullable().describe('Filter by postcode'),
|
|
201
|
+
distance: zod_1.z
|
|
202
|
+
.number()
|
|
203
|
+
.min(0)
|
|
204
|
+
.optional()
|
|
205
|
+
.nullable()
|
|
206
|
+
.describe('Search radius in miles from the given postcode'),
|
|
207
|
+
pay: common_schemas_1.PayRangeSchema.optional()
|
|
208
|
+
.nullable()
|
|
209
|
+
.describe('Filter by pay rate range'),
|
|
210
|
+
createdAt: common_schemas_1.DateRangeSchema.optional()
|
|
211
|
+
.nullable()
|
|
212
|
+
.describe('Filter by created date range'),
|
|
213
|
+
sortBy: exports.JobSortableFieldsSchema.optional()
|
|
214
|
+
.nullable()
|
|
215
|
+
.describe('The field to sort the results by'),
|
|
216
|
+
sortOrder: common_schemas_1.SortOrderSchema.optional()
|
|
217
|
+
.nullable()
|
|
218
|
+
.describe('The order to sort the results by'),
|
|
219
|
+
});
|
|
220
|
+
exports.PaginatedJobResponseSchema = (0, pagination_schema_1.createPaginatedResponseSchema)(exports.JobSchema)
|
|
221
|
+
.describe('Jobs retrieved successfully')
|
|
222
|
+
.openapi({ title: 'JobsPaginatedResponse' });
|
|
223
|
+
const c = (0, core_1.initContract)();
|
|
224
|
+
exports.jobsContractRouter = c.router({
|
|
225
|
+
create: {
|
|
226
|
+
method: 'POST',
|
|
227
|
+
path: '/v2/jobs',
|
|
228
|
+
responses: {
|
|
229
|
+
201: exports.JobSchema,
|
|
230
|
+
409: error_schemas_1.ErrorResponseSchema,
|
|
231
|
+
},
|
|
232
|
+
body: exports.CreateJobSchema,
|
|
233
|
+
summary: 'Create a new job',
|
|
234
|
+
metadata: { tags: ['Jobs'], openApi: { operationId: 'createJob' } },
|
|
235
|
+
},
|
|
236
|
+
findAll: {
|
|
237
|
+
method: 'GET',
|
|
238
|
+
path: '/v2/jobs',
|
|
239
|
+
responses: {
|
|
240
|
+
200: exports.PaginatedJobResponseSchema,
|
|
241
|
+
},
|
|
242
|
+
query: exports.FilterJobSchema,
|
|
243
|
+
summary: 'Get all jobs',
|
|
244
|
+
metadata: { tags: ['Jobs'], openApi: { operationId: 'findAllJobs' } },
|
|
245
|
+
},
|
|
246
|
+
findOne: {
|
|
247
|
+
method: 'GET',
|
|
248
|
+
path: '/v2/jobs/:id',
|
|
249
|
+
responses: {
|
|
250
|
+
200: exports.JobSchema,
|
|
251
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
252
|
+
},
|
|
253
|
+
pathParams: zod_1.z.object({
|
|
254
|
+
id: zod_1.z.string().uuid().describe('Job ID'),
|
|
255
|
+
}),
|
|
256
|
+
summary: 'Get a job by ID',
|
|
257
|
+
metadata: { tags: ['Jobs'], openApi: { operationId: 'findJobById' } },
|
|
258
|
+
},
|
|
259
|
+
update: {
|
|
260
|
+
method: 'PATCH',
|
|
261
|
+
path: '/v2/jobs/:id',
|
|
262
|
+
responses: {
|
|
263
|
+
200: exports.JobSchema,
|
|
264
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
265
|
+
409: error_schemas_1.ErrorResponseSchema,
|
|
266
|
+
},
|
|
267
|
+
pathParams: zod_1.z.object({
|
|
268
|
+
id: zod_1.z.string().uuid().describe('Job ID'),
|
|
269
|
+
}),
|
|
270
|
+
body: exports.UpdateJobSchema,
|
|
271
|
+
summary: 'Update a job',
|
|
272
|
+
metadata: { tags: ['Jobs'], openApi: { operationId: 'updateJob' } },
|
|
273
|
+
},
|
|
274
|
+
remove: {
|
|
275
|
+
method: 'DELETE',
|
|
276
|
+
path: '/v2/jobs/:id',
|
|
277
|
+
responses: {
|
|
278
|
+
204: zod_1.z.undefined(),
|
|
279
|
+
404: error_schemas_1.ErrorResponseSchema,
|
|
280
|
+
},
|
|
281
|
+
pathParams: zod_1.z.object({
|
|
282
|
+
id: zod_1.z.string().uuid().describe('Job ID'),
|
|
283
|
+
}),
|
|
284
|
+
body: c.noBody(),
|
|
285
|
+
summary: 'Delete a job',
|
|
286
|
+
metadata: { tags: ['Jobs'], openApi: { operationId: 'deleteJob' } },
|
|
287
|
+
},
|
|
288
|
+
}, {
|
|
289
|
+
commonResponses: {
|
|
290
|
+
400: error_schemas_1.ErrorResponseSchema,
|
|
291
|
+
401: error_schemas_1.ErrorResponseSchema,
|
|
292
|
+
403: error_schemas_1.ErrorResponseSchema,
|
|
293
|
+
500: error_schemas_1.ErrorResponseSchema,
|
|
294
|
+
},
|
|
295
|
+
});
|