@dakkitor/api-contracts 1.9.5 → 1.9.9

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 (22) hide show
  1. package/dist/candidate-calling/candidate-calling.contract.d.ts +5496 -5496
  2. package/dist/candidate-lookup/candidate-lookup.contract.d.ts +482 -8
  3. package/dist/candidate-lookup/candidate-lookup.contract.d.ts.map +1 -1
  4. package/dist/candidate-lookup/candidate-lookup.contract.js +34 -8
  5. package/dist/candidate-lookup/candidate-lookup.contract.spec.d.ts +2 -0
  6. package/dist/candidate-lookup/candidate-lookup.contract.spec.d.ts.map +1 -0
  7. package/dist/candidate-lookup/candidate-lookup.contract.spec.js +75 -0
  8. package/dist/curated-worker-leads/candidate-edit-session.contract.d.ts +434 -434
  9. package/dist/curated-worker-leads/jobs-tab.contract.d.ts +6657 -6381
  10. package/dist/curated-worker-leads/jobs-tab.contract.d.ts.map +1 -1
  11. package/dist/curated-worker-leads/jobs-tab.contract.js +52 -1
  12. package/dist/curated-worker-leads/next-candidate.spec.d.ts +2 -0
  13. package/dist/curated-worker-leads/next-candidate.spec.d.ts.map +1 -0
  14. package/dist/curated-worker-leads/next-candidate.spec.js +30 -0
  15. package/dist/curated-worker-leads/owned-jobs-tab.contract.d.ts +206 -206
  16. package/dist/worker-identity-cases/worker-identity-cases.contract.d.ts +1060 -837
  17. package/dist/worker-identity-cases/worker-identity-cases.contract.d.ts.map +1 -1
  18. package/dist/worker-identity-cases/worker-identity-cases.contract.js +34 -1
  19. package/dist/worker-identity-cases/worker-identity-cases.contract.spec.d.ts +2 -0
  20. package/dist/worker-identity-cases/worker-identity-cases.contract.spec.d.ts.map +1 -0
  21. package/dist/worker-identity-cases/worker-identity-cases.contract.spec.js +21 -0
  22. package/package.json +1 -1
@@ -13,6 +13,14 @@ export declare const CandidateLookupRowSchema: z.ZodObject<{
13
13
  matchedPostcode: z.ZodString;
14
14
  postcodeLevel: z.ZodEnum<["unit", "sector", "district", "area"]>;
15
15
  travelBorrowedKm: z.ZodNullable<z.ZodNumber>;
16
+ /**
17
+ * The postcode of the job the travel time was borrowed from, or null when no
18
+ * time could be borrowed. Travel times are never computed for the requested
19
+ * postcode itself — they come from a live job at that postcode sharing the
20
+ * requested trade. Surfacing the source keeps a borrowed number legible as
21
+ * borrowed.
22
+ */
23
+ travelFromPostcode: z.ZodNullable<z.ZodString>;
16
24
  }, "strip", z.ZodTypeAny, {
17
25
  workerName: string;
18
26
  phoneNumbers: string | null;
@@ -27,6 +35,7 @@ export declare const CandidateLookupRowSchema: z.ZodObject<{
27
35
  matchedPostcode: string;
28
36
  postcodeLevel: "unit" | "sector" | "district" | "area";
29
37
  travelBorrowedKm: number | null;
38
+ travelFromPostcode: string | null;
30
39
  }, {
31
40
  workerName: string;
32
41
  phoneNumbers: string | null;
@@ -41,10 +50,11 @@ export declare const CandidateLookupRowSchema: z.ZodObject<{
41
50
  matchedPostcode: string;
42
51
  postcodeLevel: "unit" | "sector" | "district" | "area";
43
52
  travelBorrowedKm: number | null;
53
+ travelFromPostcode: string | null;
44
54
  }>;
45
55
  export type CandidateLookupRow = z.infer<typeof CandidateLookupRowSchema>;
46
56
  export declare const CandidateLookupResponseSchema: z.ZodObject<{
47
- results: z.ZodArray<z.ZodObject<{
57
+ items: z.ZodArray<z.ZodObject<{
48
58
  workerName: z.ZodString;
49
59
  phoneNumbers: z.ZodNullable<z.ZodString>;
50
60
  distanceKm: z.ZodNumber;
@@ -58,6 +68,14 @@ export declare const CandidateLookupResponseSchema: z.ZodObject<{
58
68
  matchedPostcode: z.ZodString;
59
69
  postcodeLevel: z.ZodEnum<["unit", "sector", "district", "area"]>;
60
70
  travelBorrowedKm: z.ZodNullable<z.ZodNumber>;
71
+ /**
72
+ * The postcode of the job the travel time was borrowed from, or null when no
73
+ * time could be borrowed. Travel times are never computed for the requested
74
+ * postcode itself — they come from a live job at that postcode sharing the
75
+ * requested trade. Surfacing the source keeps a borrowed number legible as
76
+ * borrowed.
77
+ */
78
+ travelFromPostcode: z.ZodNullable<z.ZodString>;
61
79
  }, "strip", z.ZodTypeAny, {
62
80
  workerName: string;
63
81
  phoneNumbers: string | null;
@@ -72,6 +90,7 @@ export declare const CandidateLookupResponseSchema: z.ZodObject<{
72
90
  matchedPostcode: string;
73
91
  postcodeLevel: "unit" | "sector" | "district" | "area";
74
92
  travelBorrowedKm: number | null;
93
+ travelFromPostcode: string | null;
75
94
  }, {
76
95
  workerName: string;
77
96
  phoneNumbers: string | null;
@@ -86,9 +105,15 @@ export declare const CandidateLookupResponseSchema: z.ZodObject<{
86
105
  matchedPostcode: string;
87
106
  postcodeLevel: "unit" | "sector" | "district" | "area";
88
107
  travelBorrowedKm: number | null;
108
+ travelFromPostcode: string | null;
89
109
  }>, "many">;
110
+ totalCount: z.ZodNumber;
111
+ limit: z.ZodNumber;
112
+ skip: z.ZodNumber;
113
+ currentPage: z.ZodNumber;
114
+ totalPages: z.ZodNumber;
90
115
  }, "strip", z.ZodTypeAny, {
91
- results: {
116
+ items: {
92
117
  workerName: string;
93
118
  phoneNumbers: string | null;
94
119
  distanceKm: number;
@@ -102,9 +127,15 @@ export declare const CandidateLookupResponseSchema: z.ZodObject<{
102
127
  matchedPostcode: string;
103
128
  postcodeLevel: "unit" | "sector" | "district" | "area";
104
129
  travelBorrowedKm: number | null;
130
+ travelFromPostcode: string | null;
105
131
  }[];
132
+ totalCount: number;
133
+ limit: number;
134
+ skip: number;
135
+ currentPage: number;
136
+ totalPages: number;
106
137
  }, {
107
- results: {
138
+ items: {
108
139
  workerName: string;
109
140
  phoneNumbers: string | null;
110
141
  distanceKm: number;
@@ -118,7 +149,201 @@ export declare const CandidateLookupResponseSchema: z.ZodObject<{
118
149
  matchedPostcode: string;
119
150
  postcodeLevel: "unit" | "sector" | "district" | "area";
120
151
  travelBorrowedKm: number | null;
152
+ travelFromPostcode: string | null;
121
153
  }[];
154
+ totalCount: number;
155
+ limit: number;
156
+ skip: number;
157
+ currentPage: number;
158
+ totalPages: number;
159
+ }>;
160
+ export declare const CandidateLookupWithWorkerPostcodeRowSchema: z.ZodObject<{
161
+ workerName: z.ZodString;
162
+ phoneNumbers: z.ZodNullable<z.ZodString>;
163
+ distanceKm: z.ZodNumber;
164
+ travelMinutes: z.ZodNullable<z.ZodNumber>;
165
+ travelTime: z.ZodNullable<z.ZodString>;
166
+ travelMode: z.ZodEnum<["DRIVE", "TRANSIT"]>;
167
+ carTravel: z.ZodNullable<z.ZodString>;
168
+ transitTravel: z.ZodNullable<z.ZodString>;
169
+ preferredTransport: z.ZodNullable<z.ZodString>;
170
+ transportMethods: z.ZodNullable<z.ZodString>;
171
+ matchedPostcode: z.ZodString;
172
+ postcodeLevel: z.ZodEnum<["unit", "sector", "district", "area"]>;
173
+ travelBorrowedKm: z.ZodNullable<z.ZodNumber>;
174
+ /**
175
+ * The postcode of the job the travel time was borrowed from, or null when no
176
+ * time could be borrowed. Travel times are never computed for the requested
177
+ * postcode itself — they come from a live job at that postcode sharing the
178
+ * requested trade. Surfacing the source keeps a borrowed number legible as
179
+ * borrowed.
180
+ */
181
+ travelFromPostcode: z.ZodNullable<z.ZodString>;
182
+ } & {
183
+ postcode: z.ZodNullable<z.ZodString>;
184
+ }, "strip", z.ZodTypeAny, {
185
+ workerName: string;
186
+ phoneNumbers: string | null;
187
+ distanceKm: number;
188
+ travelMinutes: number | null;
189
+ travelTime: string | null;
190
+ travelMode: "DRIVE" | "TRANSIT";
191
+ carTravel: string | null;
192
+ transitTravel: string | null;
193
+ preferredTransport: string | null;
194
+ transportMethods: string | null;
195
+ matchedPostcode: string;
196
+ postcodeLevel: "unit" | "sector" | "district" | "area";
197
+ travelBorrowedKm: number | null;
198
+ travelFromPostcode: string | null;
199
+ postcode: string | null;
200
+ }, {
201
+ workerName: string;
202
+ phoneNumbers: string | null;
203
+ distanceKm: number;
204
+ travelMinutes: number | null;
205
+ travelTime: string | null;
206
+ travelMode: "DRIVE" | "TRANSIT";
207
+ carTravel: string | null;
208
+ transitTravel: string | null;
209
+ preferredTransport: string | null;
210
+ transportMethods: string | null;
211
+ matchedPostcode: string;
212
+ postcodeLevel: "unit" | "sector" | "district" | "area";
213
+ travelBorrowedKm: number | null;
214
+ travelFromPostcode: string | null;
215
+ postcode: string | null;
216
+ }>;
217
+ export type CandidateLookupWithWorkerPostcodeRow = z.infer<typeof CandidateLookupWithWorkerPostcodeRowSchema>;
218
+ export declare const CandidateLookupWithWorkerPostcodeResponseSchema: z.ZodObject<{
219
+ items: z.ZodArray<z.ZodObject<{
220
+ workerName: z.ZodString;
221
+ phoneNumbers: z.ZodNullable<z.ZodString>;
222
+ distanceKm: z.ZodNumber;
223
+ travelMinutes: z.ZodNullable<z.ZodNumber>;
224
+ travelTime: z.ZodNullable<z.ZodString>;
225
+ travelMode: z.ZodEnum<["DRIVE", "TRANSIT"]>;
226
+ carTravel: z.ZodNullable<z.ZodString>;
227
+ transitTravel: z.ZodNullable<z.ZodString>;
228
+ preferredTransport: z.ZodNullable<z.ZodString>;
229
+ transportMethods: z.ZodNullable<z.ZodString>;
230
+ matchedPostcode: z.ZodString;
231
+ postcodeLevel: z.ZodEnum<["unit", "sector", "district", "area"]>;
232
+ travelBorrowedKm: z.ZodNullable<z.ZodNumber>;
233
+ /**
234
+ * The postcode of the job the travel time was borrowed from, or null when no
235
+ * time could be borrowed. Travel times are never computed for the requested
236
+ * postcode itself — they come from a live job at that postcode sharing the
237
+ * requested trade. Surfacing the source keeps a borrowed number legible as
238
+ * borrowed.
239
+ */
240
+ travelFromPostcode: z.ZodNullable<z.ZodString>;
241
+ } & {
242
+ postcode: z.ZodNullable<z.ZodString>;
243
+ }, "strip", z.ZodTypeAny, {
244
+ workerName: string;
245
+ phoneNumbers: string | null;
246
+ distanceKm: number;
247
+ travelMinutes: number | null;
248
+ travelTime: string | null;
249
+ travelMode: "DRIVE" | "TRANSIT";
250
+ carTravel: string | null;
251
+ transitTravel: string | null;
252
+ preferredTransport: string | null;
253
+ transportMethods: string | null;
254
+ matchedPostcode: string;
255
+ postcodeLevel: "unit" | "sector" | "district" | "area";
256
+ travelBorrowedKm: number | null;
257
+ travelFromPostcode: string | null;
258
+ postcode: string | null;
259
+ }, {
260
+ workerName: string;
261
+ phoneNumbers: string | null;
262
+ distanceKm: number;
263
+ travelMinutes: number | null;
264
+ travelTime: string | null;
265
+ travelMode: "DRIVE" | "TRANSIT";
266
+ carTravel: string | null;
267
+ transitTravel: string | null;
268
+ preferredTransport: string | null;
269
+ transportMethods: string | null;
270
+ matchedPostcode: string;
271
+ postcodeLevel: "unit" | "sector" | "district" | "area";
272
+ travelBorrowedKm: number | null;
273
+ travelFromPostcode: string | null;
274
+ postcode: string | null;
275
+ }>, "many">;
276
+ totalCount: z.ZodNumber;
277
+ limit: z.ZodNumber;
278
+ skip: z.ZodNumber;
279
+ currentPage: z.ZodNumber;
280
+ totalPages: z.ZodNumber;
281
+ }, "strip", z.ZodTypeAny, {
282
+ items: {
283
+ workerName: string;
284
+ phoneNumbers: string | null;
285
+ distanceKm: number;
286
+ travelMinutes: number | null;
287
+ travelTime: string | null;
288
+ travelMode: "DRIVE" | "TRANSIT";
289
+ carTravel: string | null;
290
+ transitTravel: string | null;
291
+ preferredTransport: string | null;
292
+ transportMethods: string | null;
293
+ matchedPostcode: string;
294
+ postcodeLevel: "unit" | "sector" | "district" | "area";
295
+ travelBorrowedKm: number | null;
296
+ travelFromPostcode: string | null;
297
+ postcode: string | null;
298
+ }[];
299
+ totalCount: number;
300
+ limit: number;
301
+ skip: number;
302
+ currentPage: number;
303
+ totalPages: number;
304
+ }, {
305
+ items: {
306
+ workerName: string;
307
+ phoneNumbers: string | null;
308
+ distanceKm: number;
309
+ travelMinutes: number | null;
310
+ travelTime: string | null;
311
+ travelMode: "DRIVE" | "TRANSIT";
312
+ carTravel: string | null;
313
+ transitTravel: string | null;
314
+ preferredTransport: string | null;
315
+ transportMethods: string | null;
316
+ matchedPostcode: string;
317
+ postcodeLevel: "unit" | "sector" | "district" | "area";
318
+ travelBorrowedKm: number | null;
319
+ travelFromPostcode: string | null;
320
+ postcode: string | null;
321
+ }[];
322
+ totalCount: number;
323
+ limit: number;
324
+ skip: number;
325
+ currentPage: number;
326
+ totalPages: number;
327
+ }>;
328
+ export declare const CandidateLookupQuerySchema: z.ZodObject<{
329
+ limit: z.ZodDefault<z.ZodNumber>;
330
+ page: z.ZodDefault<z.ZodNumber>;
331
+ } & {
332
+ postcode: z.ZodString;
333
+ tradeId: z.ZodString;
334
+ radiusM: z.ZodDefault<z.ZodNumber>;
335
+ }, "strip", z.ZodTypeAny, {
336
+ limit: number;
337
+ postcode: string;
338
+ page: number;
339
+ tradeId: string;
340
+ radiusM: number;
341
+ }, {
342
+ postcode: string;
343
+ tradeId: string;
344
+ limit?: number | undefined;
345
+ page?: number | undefined;
346
+ radiusM?: number | undefined;
122
347
  }>;
123
348
  export declare const candidateLookupContract: {
124
349
  lookup: {
@@ -126,16 +351,23 @@ export declare const candidateLookupContract: {
126
351
  tags: string[];
127
352
  };
128
353
  query: z.ZodObject<{
354
+ limit: z.ZodDefault<z.ZodNumber>;
355
+ page: z.ZodDefault<z.ZodNumber>;
356
+ } & {
129
357
  postcode: z.ZodString;
130
358
  tradeId: z.ZodString;
131
- radiusM: z.ZodOptional<z.ZodNumber>;
359
+ radiusM: z.ZodDefault<z.ZodNumber>;
132
360
  }, "strip", z.ZodTypeAny, {
361
+ limit: number;
133
362
  postcode: string;
363
+ page: number;
134
364
  tradeId: string;
135
- radiusM?: number | undefined;
365
+ radiusM: number;
136
366
  }, {
137
367
  postcode: string;
138
368
  tradeId: string;
369
+ limit?: number | undefined;
370
+ page?: number | undefined;
139
371
  radiusM?: number | undefined;
140
372
  }>;
141
373
  summary: "Curated workers near a postcode for a given trade";
@@ -143,7 +375,216 @@ export declare const candidateLookupContract: {
143
375
  path: "/v2/candidate-lookup";
144
376
  responses: {
145
377
  200: z.ZodObject<{
146
- results: z.ZodArray<z.ZodObject<{
378
+ items: z.ZodArray<z.ZodObject<{
379
+ workerName: z.ZodString;
380
+ phoneNumbers: z.ZodNullable<z.ZodString>;
381
+ distanceKm: z.ZodNumber;
382
+ travelMinutes: z.ZodNullable<z.ZodNumber>;
383
+ travelTime: z.ZodNullable<z.ZodString>;
384
+ travelMode: z.ZodEnum<["DRIVE", "TRANSIT"]>;
385
+ carTravel: z.ZodNullable<z.ZodString>;
386
+ transitTravel: z.ZodNullable<z.ZodString>;
387
+ preferredTransport: z.ZodNullable<z.ZodString>;
388
+ transportMethods: z.ZodNullable<z.ZodString>;
389
+ matchedPostcode: z.ZodString;
390
+ postcodeLevel: z.ZodEnum<["unit", "sector", "district", "area"]>;
391
+ travelBorrowedKm: z.ZodNullable<z.ZodNumber>;
392
+ /**
393
+ * The postcode of the job the travel time was borrowed from, or null when no
394
+ * time could be borrowed. Travel times are never computed for the requested
395
+ * postcode itself — they come from a live job at that postcode sharing the
396
+ * requested trade. Surfacing the source keeps a borrowed number legible as
397
+ * borrowed.
398
+ */
399
+ travelFromPostcode: z.ZodNullable<z.ZodString>;
400
+ }, "strip", z.ZodTypeAny, {
401
+ workerName: string;
402
+ phoneNumbers: string | null;
403
+ distanceKm: number;
404
+ travelMinutes: number | null;
405
+ travelTime: string | null;
406
+ travelMode: "DRIVE" | "TRANSIT";
407
+ carTravel: string | null;
408
+ transitTravel: string | null;
409
+ preferredTransport: string | null;
410
+ transportMethods: string | null;
411
+ matchedPostcode: string;
412
+ postcodeLevel: "unit" | "sector" | "district" | "area";
413
+ travelBorrowedKm: number | null;
414
+ travelFromPostcode: string | null;
415
+ }, {
416
+ workerName: string;
417
+ phoneNumbers: string | null;
418
+ distanceKm: number;
419
+ travelMinutes: number | null;
420
+ travelTime: string | null;
421
+ travelMode: "DRIVE" | "TRANSIT";
422
+ carTravel: string | null;
423
+ transitTravel: string | null;
424
+ preferredTransport: string | null;
425
+ transportMethods: string | null;
426
+ matchedPostcode: string;
427
+ postcodeLevel: "unit" | "sector" | "district" | "area";
428
+ travelBorrowedKm: number | null;
429
+ travelFromPostcode: string | null;
430
+ }>, "many">;
431
+ totalCount: z.ZodNumber;
432
+ limit: z.ZodNumber;
433
+ skip: z.ZodNumber;
434
+ currentPage: z.ZodNumber;
435
+ totalPages: z.ZodNumber;
436
+ }, "strip", z.ZodTypeAny, {
437
+ items: {
438
+ workerName: string;
439
+ phoneNumbers: string | null;
440
+ distanceKm: number;
441
+ travelMinutes: number | null;
442
+ travelTime: string | null;
443
+ travelMode: "DRIVE" | "TRANSIT";
444
+ carTravel: string | null;
445
+ transitTravel: string | null;
446
+ preferredTransport: string | null;
447
+ transportMethods: string | null;
448
+ matchedPostcode: string;
449
+ postcodeLevel: "unit" | "sector" | "district" | "area";
450
+ travelBorrowedKm: number | null;
451
+ travelFromPostcode: string | null;
452
+ }[];
453
+ totalCount: number;
454
+ limit: number;
455
+ skip: number;
456
+ currentPage: number;
457
+ totalPages: number;
458
+ }, {
459
+ items: {
460
+ workerName: string;
461
+ phoneNumbers: string | null;
462
+ distanceKm: number;
463
+ travelMinutes: number | null;
464
+ travelTime: string | null;
465
+ travelMode: "DRIVE" | "TRANSIT";
466
+ carTravel: string | null;
467
+ transitTravel: string | null;
468
+ preferredTransport: string | null;
469
+ transportMethods: string | null;
470
+ matchedPostcode: string;
471
+ postcodeLevel: "unit" | "sector" | "district" | "area";
472
+ travelBorrowedKm: number | null;
473
+ travelFromPostcode: string | null;
474
+ }[];
475
+ totalCount: number;
476
+ limit: number;
477
+ skip: number;
478
+ currentPage: number;
479
+ totalPages: number;
480
+ }>;
481
+ 400: z.ZodObject<{
482
+ statusCode: z.ZodNumber;
483
+ message: z.ZodString;
484
+ code: z.ZodString;
485
+ details: z.ZodOptional<z.ZodUnknown>;
486
+ timestamp: z.ZodString;
487
+ path: z.ZodString;
488
+ correlationId: z.ZodOptional<z.ZodString>;
489
+ }, "strip", z.ZodTypeAny, {
490
+ code: string;
491
+ path: string;
492
+ message: string;
493
+ statusCode: number;
494
+ timestamp: string;
495
+ details?: unknown;
496
+ correlationId?: string | undefined;
497
+ }, {
498
+ code: string;
499
+ path: string;
500
+ message: string;
501
+ statusCode: number;
502
+ timestamp: string;
503
+ details?: unknown;
504
+ correlationId?: string | undefined;
505
+ }>;
506
+ 401: z.ZodObject<{
507
+ statusCode: z.ZodNumber;
508
+ message: z.ZodString;
509
+ code: z.ZodString;
510
+ details: z.ZodOptional<z.ZodUnknown>;
511
+ timestamp: z.ZodString;
512
+ path: z.ZodString;
513
+ correlationId: z.ZodOptional<z.ZodString>;
514
+ }, "strip", z.ZodTypeAny, {
515
+ code: string;
516
+ path: string;
517
+ message: string;
518
+ statusCode: number;
519
+ timestamp: string;
520
+ details?: unknown;
521
+ correlationId?: string | undefined;
522
+ }, {
523
+ code: string;
524
+ path: string;
525
+ message: string;
526
+ statusCode: number;
527
+ timestamp: string;
528
+ details?: unknown;
529
+ correlationId?: string | undefined;
530
+ }>;
531
+ 429: z.ZodObject<{
532
+ statusCode: z.ZodNumber;
533
+ message: z.ZodString;
534
+ code: z.ZodString;
535
+ details: z.ZodOptional<z.ZodUnknown>;
536
+ timestamp: z.ZodString;
537
+ path: z.ZodString;
538
+ correlationId: z.ZodOptional<z.ZodString>;
539
+ }, "strip", z.ZodTypeAny, {
540
+ code: string;
541
+ path: string;
542
+ message: string;
543
+ statusCode: number;
544
+ timestamp: string;
545
+ details?: unknown;
546
+ correlationId?: string | undefined;
547
+ }, {
548
+ code: string;
549
+ path: string;
550
+ message: string;
551
+ statusCode: number;
552
+ timestamp: string;
553
+ details?: unknown;
554
+ correlationId?: string | undefined;
555
+ }>;
556
+ };
557
+ };
558
+ lookupWithWorkerPostcode: {
559
+ metadata: {
560
+ tags: string[];
561
+ };
562
+ query: z.ZodObject<{
563
+ limit: z.ZodDefault<z.ZodNumber>;
564
+ page: z.ZodDefault<z.ZodNumber>;
565
+ } & {
566
+ postcode: z.ZodString;
567
+ tradeId: z.ZodString;
568
+ radiusM: z.ZodDefault<z.ZodNumber>;
569
+ }, "strip", z.ZodTypeAny, {
570
+ limit: number;
571
+ postcode: string;
572
+ page: number;
573
+ tradeId: string;
574
+ radiusM: number;
575
+ }, {
576
+ postcode: string;
577
+ tradeId: string;
578
+ limit?: number | undefined;
579
+ page?: number | undefined;
580
+ radiusM?: number | undefined;
581
+ }>;
582
+ summary: "Curated workers near a postcode, including worker postcode";
583
+ method: "GET";
584
+ path: "/v2/candidate-lookup-with-worker-postcode";
585
+ responses: {
586
+ 200: z.ZodObject<{
587
+ items: z.ZodArray<z.ZodObject<{
147
588
  workerName: z.ZodString;
148
589
  phoneNumbers: z.ZodNullable<z.ZodString>;
149
590
  distanceKm: z.ZodNumber;
@@ -157,6 +598,16 @@ export declare const candidateLookupContract: {
157
598
  matchedPostcode: z.ZodString;
158
599
  postcodeLevel: z.ZodEnum<["unit", "sector", "district", "area"]>;
159
600
  travelBorrowedKm: z.ZodNullable<z.ZodNumber>;
601
+ /**
602
+ * The postcode of the job the travel time was borrowed from, or null when no
603
+ * time could be borrowed. Travel times are never computed for the requested
604
+ * postcode itself — they come from a live job at that postcode sharing the
605
+ * requested trade. Surfacing the source keeps a borrowed number legible as
606
+ * borrowed.
607
+ */
608
+ travelFromPostcode: z.ZodNullable<z.ZodString>;
609
+ } & {
610
+ postcode: z.ZodNullable<z.ZodString>;
160
611
  }, "strip", z.ZodTypeAny, {
161
612
  workerName: string;
162
613
  phoneNumbers: string | null;
@@ -171,6 +622,8 @@ export declare const candidateLookupContract: {
171
622
  matchedPostcode: string;
172
623
  postcodeLevel: "unit" | "sector" | "district" | "area";
173
624
  travelBorrowedKm: number | null;
625
+ travelFromPostcode: string | null;
626
+ postcode: string | null;
174
627
  }, {
175
628
  workerName: string;
176
629
  phoneNumbers: string | null;
@@ -185,9 +638,16 @@ export declare const candidateLookupContract: {
185
638
  matchedPostcode: string;
186
639
  postcodeLevel: "unit" | "sector" | "district" | "area";
187
640
  travelBorrowedKm: number | null;
641
+ travelFromPostcode: string | null;
642
+ postcode: string | null;
188
643
  }>, "many">;
644
+ totalCount: z.ZodNumber;
645
+ limit: z.ZodNumber;
646
+ skip: z.ZodNumber;
647
+ currentPage: z.ZodNumber;
648
+ totalPages: z.ZodNumber;
189
649
  }, "strip", z.ZodTypeAny, {
190
- results: {
650
+ items: {
191
651
  workerName: string;
192
652
  phoneNumbers: string | null;
193
653
  distanceKm: number;
@@ -201,9 +661,16 @@ export declare const candidateLookupContract: {
201
661
  matchedPostcode: string;
202
662
  postcodeLevel: "unit" | "sector" | "district" | "area";
203
663
  travelBorrowedKm: number | null;
664
+ travelFromPostcode: string | null;
665
+ postcode: string | null;
204
666
  }[];
667
+ totalCount: number;
668
+ limit: number;
669
+ skip: number;
670
+ currentPage: number;
671
+ totalPages: number;
205
672
  }, {
206
- results: {
673
+ items: {
207
674
  workerName: string;
208
675
  phoneNumbers: string | null;
209
676
  distanceKm: number;
@@ -217,7 +684,14 @@ export declare const candidateLookupContract: {
217
684
  matchedPostcode: string;
218
685
  postcodeLevel: "unit" | "sector" | "district" | "area";
219
686
  travelBorrowedKm: number | null;
687
+ travelFromPostcode: string | null;
688
+ postcode: string | null;
220
689
  }[];
690
+ totalCount: number;
691
+ limit: number;
692
+ skip: number;
693
+ currentPage: number;
694
+ totalPages: number;
221
695
  }>;
222
696
  400: z.ZodObject<{
223
697
  statusCode: z.ZodNumber;
@@ -1 +1 @@
1
- {"version":3,"file":"candidate-lookup.contract.d.ts","sourceRoot":"","sources":["../../contracts/candidate-lookup/candidate-lookup.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAExC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBlC,CAAC"}
1
+ {"version":3,"file":"candidate-lookup.contract.d.ts","sourceRoot":"","sources":["../../contracts/candidate-lookup/candidate-lookup.contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;IAcnC;;;;;;OAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;QAZxC;;;;;;WAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQJ,CAAC;AAEF,eAAO,MAAM,0CAA0C;;;;;;;;;;;;;;IAhBrD;;;;;;OAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAaD,CAAC;AAEL,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,0CAA0C,CAClD,CAAC;AAEF,eAAO,MAAM,+CAA+C;;;;;;;;;;;;;;;QAzB1D;;;;;;WAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBsE,CAAC;AAE5E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;EAIrC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAlClC;;;;;;uBAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBANH;;;;;;uBAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDH,CAAC"}
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.candidateLookupContract = exports.CandidateLookupResponseSchema = exports.CandidateLookupRowSchema = void 0;
3
+ exports.candidateLookupContract = exports.CandidateLookupQuerySchema = exports.CandidateLookupWithWorkerPostcodeResponseSchema = exports.CandidateLookupWithWorkerPostcodeRowSchema = exports.CandidateLookupResponseSchema = exports.CandidateLookupRowSchema = void 0;
4
4
  const core_1 = require("@ts-rest/core");
5
5
  const zod_1 = require("zod");
6
6
  const error_schemas_1 = require("../common/error-schemas");
7
+ const pagination_query_schema_1 = require("../common/pagination-query.schema");
8
+ const pagination_schema_1 = require("../common/pagination.schema");
7
9
  const c = (0, core_1.initContract)();
8
10
  exports.CandidateLookupRowSchema = zod_1.z.object({
9
11
  workerName: zod_1.z.string(),
@@ -19,19 +21,30 @@ exports.CandidateLookupRowSchema = zod_1.z.object({
19
21
  matchedPostcode: zod_1.z.string(),
20
22
  postcodeLevel: zod_1.z.enum(['unit', 'sector', 'district', 'area']),
21
23
  travelBorrowedKm: zod_1.z.number().nullable(),
24
+ /**
25
+ * The postcode of the job the travel time was borrowed from, or null when no
26
+ * time could be borrowed. Travel times are never computed for the requested
27
+ * postcode itself — they come from a live job at that postcode sharing the
28
+ * requested trade. Surfacing the source keeps a borrowed number legible as
29
+ * borrowed.
30
+ */
31
+ travelFromPostcode: zod_1.z.string().nullable(),
22
32
  });
23
- exports.CandidateLookupResponseSchema = zod_1.z.object({
24
- results: zod_1.z.array(exports.CandidateLookupRowSchema),
33
+ exports.CandidateLookupResponseSchema = (0, pagination_schema_1.createPaginatedResponseSchema)(exports.CandidateLookupRowSchema);
34
+ exports.CandidateLookupWithWorkerPostcodeRowSchema = exports.CandidateLookupRowSchema.extend({
35
+ postcode: zod_1.z.string().nullable(),
36
+ });
37
+ exports.CandidateLookupWithWorkerPostcodeResponseSchema = (0, pagination_schema_1.createPaginatedResponseSchema)(exports.CandidateLookupWithWorkerPostcodeRowSchema);
38
+ exports.CandidateLookupQuerySchema = pagination_query_schema_1.PaginationQuerySchema.extend({
39
+ postcode: zod_1.z.string().trim().min(1).max(10),
40
+ tradeId: zod_1.z.string().uuid(),
41
+ radiusM: zod_1.z.coerce.number().int().min(100).max(55000).default(55000),
25
42
  });
26
43
  exports.candidateLookupContract = c.router({
27
44
  lookup: {
28
45
  method: 'GET',
29
46
  path: '/v2/candidate-lookup',
30
- query: zod_1.z.object({
31
- postcode: zod_1.z.string().trim().min(1).max(10),
32
- tradeId: zod_1.z.string().uuid(),
33
- radiusM: zod_1.z.coerce.number().int().min(100).max(55000).optional(),
34
- }),
47
+ query: exports.CandidateLookupQuerySchema,
35
48
  responses: {
36
49
  200: exports.CandidateLookupResponseSchema,
37
50
  400: error_schemas_1.ErrorResponseSchema,
@@ -41,4 +54,17 @@ exports.candidateLookupContract = c.router({
41
54
  summary: 'Curated workers near a postcode for a given trade',
42
55
  metadata: { tags: ['Candidate Lookup'] },
43
56
  },
57
+ lookupWithWorkerPostcode: {
58
+ method: 'GET',
59
+ path: '/v2/candidate-lookup-with-worker-postcode',
60
+ query: exports.CandidateLookupQuerySchema,
61
+ responses: {
62
+ 200: exports.CandidateLookupWithWorkerPostcodeResponseSchema,
63
+ 400: error_schemas_1.ErrorResponseSchema,
64
+ 401: error_schemas_1.ErrorResponseSchema,
65
+ 429: error_schemas_1.ErrorResponseSchema,
66
+ },
67
+ summary: 'Curated workers near a postcode, including worker postcode',
68
+ metadata: { tags: ['Candidate Lookup'] },
69
+ },
44
70
  });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=candidate-lookup.contract.spec.d.ts.map