@dakkitor/api-contracts 1.4.0 → 1.6.0

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 (139) hide show
  1. package/dist/abilities/abilities.contract.d.ts +8 -2
  2. package/dist/abilities/abilities.contract.d.ts.map +1 -1
  3. package/dist/abilities/abilities.contract.js +48 -1
  4. package/dist/abilities/abilities.contract.spec.js +98 -0
  5. package/dist/abilities/first-agent.abilities.json +9 -2
  6. package/dist/abilities/outreach-service.abilities.json +14 -0
  7. package/dist/abilities/outreach.abilities.json +25 -0
  8. package/dist/abilities/second-agent.abilities.json +5 -1
  9. package/dist/actives/actives.contract.d.ts +7160 -7021
  10. package/dist/actives/actives.contract.d.ts.map +1 -1
  11. package/dist/actives/actives.contract.js +2 -0
  12. package/dist/actives/actives.contract.spec.d.ts +2 -0
  13. package/dist/actives/actives.contract.spec.d.ts.map +1 -0
  14. package/dist/actives/actives.contract.spec.js +35 -0
  15. package/dist/agent-client-links/agent-client-links.contract.d.ts +1087 -1087
  16. package/dist/auth/auth.contract.d.ts +108 -108
  17. package/dist/bookings/bookings.contract.d.ts +10131 -9939
  18. package/dist/bookings/bookings.contract.d.ts.map +1 -1
  19. package/dist/call-history/call-history.contract.d.ts +718 -718
  20. package/dist/calls-feed/calls-feed.contract.d.ts +86 -86
  21. package/dist/client-contacts/client-contacts.contract.d.ts +469 -469
  22. package/dist/clients/clients.contract.d.ts +203 -203
  23. package/dist/collaboration-checkings/collaboration-checkings.contract.d.ts +2713 -2713
  24. package/dist/collaborations/collaborations.contract.d.ts +2270 -2270
  25. package/dist/common/common-schemas.d.ts +12 -12
  26. package/dist/companies/companies.contract.d.ts +74 -74
  27. package/dist/crews/crews.contract.d.ts +253 -253
  28. package/dist/cron-executions/cron-executions.contract.d.ts +182 -182
  29. package/dist/curated-worker-leads/candidate-coordination.contract.d.ts +3353 -3353
  30. package/dist/curated-worker-leads/candidate-edit-session.contract.d.ts +20 -20
  31. package/dist/curated-worker-leads/consent-queue.contract.d.ts +196 -166
  32. package/dist/curated-worker-leads/consent-queue.contract.d.ts.map +1 -1
  33. package/dist/curated-worker-leads/curated-worker-lead-config.contract.d.ts +16 -16
  34. package/dist/curated-worker-leads/curated-worker-leads.contract.d.ts +2 -2
  35. package/dist/curated-worker-leads/jobs-tab.contract.d.ts +1192 -564
  36. package/dist/curated-worker-leads/jobs-tab.contract.d.ts.map +1 -1
  37. package/dist/curated-worker-leads/jobs-tab.contract.js +65 -2
  38. package/dist/curated-worker-leads/lead-agent-area.contract.d.ts +4 -4
  39. package/dist/curated-worker-leads/outreach-pool-summary.contract.spec.d.ts +2 -0
  40. package/dist/curated-worker-leads/outreach-pool-summary.contract.spec.d.ts.map +1 -0
  41. package/dist/curated-worker-leads/outreach-pool-summary.contract.spec.js +39 -0
  42. package/dist/curated-worker-leads/owned-jobs-tab.contract.d.ts +46 -46
  43. package/dist/curated-workers/curated-workers.contract.d.ts +789 -789
  44. package/dist/dashboards/agent-daily-metrics.contract.d.ts +2 -2
  45. package/dist/dashboards/dashboard-widgets.contract.d.ts +292 -292
  46. package/dist/dashboards/dashboard.contract.d.ts +12 -12
  47. package/dist/document-intake/document-intake.contract.d.ts +601 -601
  48. package/dist/export-jobs/export-jobs.contract.d.ts +572 -562
  49. package/dist/export-jobs/export-jobs.contract.d.ts.map +1 -1
  50. package/dist/exports-events/exports-events.schemas.d.ts +6 -6
  51. package/dist/files/files.contract.d.ts +74 -74
  52. package/dist/index.d.ts +10 -0
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +10 -0
  55. package/dist/interactions/interactions.contract.d.ts +6 -6
  56. package/dist/job-clusters/job-clusters.contract.d.ts +112 -112
  57. package/dist/jobs/job-moderation-fields.spec.d.ts +2 -0
  58. package/dist/jobs/job-moderation-fields.spec.d.ts.map +1 -0
  59. package/dist/jobs/job-moderation-fields.spec.js +72 -0
  60. package/dist/jobs/jobs.contract.d.ts +7734 -7474
  61. package/dist/jobs/jobs.contract.d.ts.map +1 -1
  62. package/dist/jobs/jobs.contract.js +57 -0
  63. package/dist/kpi-impersonation/kpi-impersonation.contract.d.ts +141 -141
  64. package/dist/lead-assignments/lead-assignments.contract.d.ts +911 -911
  65. package/dist/lead-distribution/agent-lead-distribution.contract.d.ts +209 -209
  66. package/dist/lead-distribution/lead-distribution-config.contract.d.ts +77 -77
  67. package/dist/leads/leads.contract.d.ts +283 -283
  68. package/dist/locations/locations.contract.d.ts +49 -49
  69. package/dist/notifications/notifications.contract.d.ts +49 -49
  70. package/dist/offices/offices.contract.d.ts +34 -34
  71. package/dist/outreach/__tests__/outreach-claim.test.js +1 -0
  72. package/dist/outreach/__tests__/outreach-contract-additions.spec.d.ts +2 -0
  73. package/dist/outreach/__tests__/outreach-contract-additions.spec.d.ts.map +1 -0
  74. package/dist/outreach/__tests__/outreach-contract-additions.spec.js +89 -0
  75. package/dist/outreach/__tests__/outreach-requests.contract.spec.d.ts +2 -0
  76. package/dist/outreach/__tests__/outreach-requests.contract.spec.d.ts.map +1 -0
  77. package/dist/outreach/__tests__/outreach-requests.contract.spec.js +77 -0
  78. package/dist/outreach/__tests__/outreach-routes.test.js +14 -3
  79. package/dist/outreach/__tests__/outreach.schemas.test.js +5 -1
  80. package/dist/outreach/outreach-requests.contract.d.ts +1753 -0
  81. package/dist/outreach/outreach-requests.contract.d.ts.map +1 -0
  82. package/dist/outreach/outreach-requests.contract.js +154 -0
  83. package/dist/outreach/outreach-requests.schemas.d.ts +95 -0
  84. package/dist/outreach/outreach-requests.schemas.d.ts.map +1 -0
  85. package/dist/outreach/outreach-requests.schemas.js +63 -0
  86. package/dist/outreach/outreach.contract.d.ts +373 -101
  87. package/dist/outreach/outreach.contract.d.ts.map +1 -1
  88. package/dist/outreach/outreach.contract.js +18 -0
  89. package/dist/outreach/outreach.contract.spec.d.ts +2 -0
  90. package/dist/outreach/outreach.contract.spec.d.ts.map +1 -0
  91. package/dist/outreach/outreach.contract.spec.js +54 -0
  92. package/dist/outreach/outreach.schemas.d.ts +15 -10
  93. package/dist/outreach/outreach.schemas.d.ts.map +1 -1
  94. package/dist/outreach/outreach.schemas.js +5 -2
  95. package/dist/own-research/own-research.contract.d.ts +775 -775
  96. package/dist/postcodes/postcodes.contract.d.ts +24 -24
  97. package/dist/proofs/proof-type.enum.d.ts +4 -4
  98. package/dist/proofs/proofs.contract.d.ts +363 -363
  99. package/dist/proofs/proofs.dtos.d.ts +124 -124
  100. package/dist/qualifications/qualifications.contract.d.ts +38 -38
  101. package/dist/relay-pods/relay-pod-sessions.contract.d.ts +680 -0
  102. package/dist/relay-pods/relay-pod-sessions.contract.d.ts.map +1 -0
  103. package/dist/relay-pods/relay-pod-sessions.contract.js +67 -0
  104. package/dist/relay-pods/relay-pod-sessions.contract.spec.d.ts +2 -0
  105. package/dist/relay-pods/relay-pod-sessions.contract.spec.d.ts.map +1 -0
  106. package/dist/relay-pods/relay-pod-sessions.contract.spec.js +129 -0
  107. package/dist/relay-pods/relay-pods.contract.d.ts +1569 -0
  108. package/dist/relay-pods/relay-pods.contract.d.ts.map +1 -0
  109. package/dist/relay-pods/relay-pods.contract.js +188 -0
  110. package/dist/relay-pods/relay-pods.contract.spec.d.ts +2 -0
  111. package/dist/relay-pods/relay-pods.contract.spec.d.ts.map +1 -0
  112. package/dist/relay-pods/relay-pods.contract.spec.js +141 -0
  113. package/dist/relay-pods/relay-pods.schemas.d.ts +415 -0
  114. package/dist/relay-pods/relay-pods.schemas.d.ts.map +1 -0
  115. package/dist/relay-pods/relay-pods.schemas.js +112 -0
  116. package/dist/shared/live-booking.schema.d.ts +4 -4
  117. package/dist/shared/summary-schemas.d.ts +6 -6
  118. package/dist/sheets-sync/sheets-sync.contract.d.ts +939 -939
  119. package/dist/telegram/telegram.contract.d.ts +22 -22
  120. package/dist/trades/trades.contract.d.ts +90 -90
  121. package/dist/user-access-grants/user-access-grants.contract.d.ts +165 -165
  122. package/dist/users/__tests__/assignable-roles.spec.d.ts +2 -0
  123. package/dist/users/__tests__/assignable-roles.spec.d.ts.map +1 -0
  124. package/dist/users/__tests__/assignable-roles.spec.js +41 -0
  125. package/dist/users/users.contract.d.ts +399 -393
  126. package/dist/users/users.contract.d.ts.map +1 -1
  127. package/dist/users/users.contract.js +11 -0
  128. package/dist/worker-identity-cases/worker-identity-cases.contract.d.ts +585 -527
  129. package/dist/worker-identity-cases/worker-identity-cases.contract.d.ts.map +1 -1
  130. package/dist/worker-merge-proposals/worker-merge-proposals.contract.d.ts +278 -236
  131. package/dist/worker-merge-proposals/worker-merge-proposals.contract.d.ts.map +1 -1
  132. package/dist/worker-merge-proposals/worker-merge-proposals.contract.js +1 -0
  133. package/dist/worker-source-identity-conflicts/worker-source-identity-conflicts.contract.d.ts +153 -153
  134. package/dist/worker-source-identity-conflicts/worker-source-identity-conflicts.schemas.d.ts +59 -59
  135. package/dist/workers/workers.contract.d.ts +2919 -2919
  136. package/package.json +1 -1
  137. package/dist/bookings/bookings.contract.spec.d.ts +0 -2
  138. package/dist/bookings/bookings.contract.spec.d.ts.map +0 -1
  139. package/dist/bookings/bookings.contract.spec.js +0 -11
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outreach-requests.contract.d.ts","sourceRoot":"","sources":["../../contracts/outreach/outreach-requests.contract.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,cAAc,6BAA6B,CAAC;AAI5C,2EAA2E;AAC3E,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEM,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAC5C,OAAO,8BAA8B,CACtC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;EASM,CAAC;AAEnD,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIM,CAAC;AAEtD,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8GpC,CAAC"}
@@ -0,0 +1,154 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.outreachRequestsContract = exports.ListOutreachRequestsResponseSchema = exports.CreateOutreachRequestBodySchema = exports.OutreachRequestQueueItemSchema = void 0;
18
+ /**
19
+ * Project: Internal Recruitment Platform API
20
+ * File: outreach-requests.contract.ts
21
+ *
22
+ * Description: Agents mark jobs for outreach; the rack works the queue.
23
+ *
24
+ * Two lanes share one router because ts-rest does not model auth: `create` and
25
+ * `cancel` are the agent's JWT, `list` / `start` / `complete` are the service
26
+ * key. The server enforces the split with different guards per controller — see
27
+ * outreach-requests.v2.controller.ts and outreach.v2.controller.ts.
28
+ */
29
+ const core_1 = require("@ts-rest/core");
30
+ const zod_1 = require("zod");
31
+ const error_schemas_1 = require("../common/error-schemas");
32
+ const outreach_schemas_1 = require("./outreach.schemas");
33
+ const outreach_requests_schemas_1 = require("./outreach-requests.schemas");
34
+ __exportStar(require("./outreach-requests.schemas"), exports);
35
+ const c = (0, core_1.initContract)();
36
+ /** A queue row plus enough of the job to label a campaign in Relay Lab. */
37
+ exports.OutreachRequestQueueItemSchema = outreach_requests_schemas_1.OutreachRequestSchema.extend({
38
+ job: outreach_schemas_1.OutreachJobSchema,
39
+ }).openapi({ title: 'OutreachRequestQueueItem' });
40
+ exports.CreateOutreachRequestBodySchema = zod_1.z
41
+ .object({
42
+ jobId: zod_1.z.string().uuid().describe('Job to mark for outreach'),
43
+ targetPodId: zod_1.z
44
+ .string()
45
+ .uuid()
46
+ .optional()
47
+ .describe('Explicit Relay pod target when more than one can be managed'),
48
+ })
49
+ .openapi({ title: 'CreateOutreachRequestBody' });
50
+ exports.ListOutreachRequestsResponseSchema = zod_1.z
51
+ .object({
52
+ items: zod_1.z.array(exports.OutreachRequestQueueItemSchema),
53
+ })
54
+ .openapi({ title: 'ListOutreachRequestsResponse' });
55
+ exports.outreachRequestsContract = c.router({
56
+ create: {
57
+ method: 'POST',
58
+ path: '/outreach/requests',
59
+ body: exports.CreateOutreachRequestBodySchema,
60
+ responses: {
61
+ // A second "Start outreach" click is NOT an error: the route returns
62
+ // the existing open request so the button can render its state. There
63
+ // is deliberately no 409 here.
64
+ 200: outreach_requests_schemas_1.OutreachRequestSchema,
65
+ 404: error_schemas_1.ErrorResponseSchema,
66
+ },
67
+ summary: 'Mark a job for outreach',
68
+ description: 'Idempotent per job: if an open (PENDING or RUNNING) request already ' +
69
+ 'exists it is returned unchanged. Snapshots the eligible-candidate ' +
70
+ 'count onto the row at creation. 404 when the job does not exist or ' +
71
+ 'is not open (AVAILABLE with a free position).',
72
+ metadata: { tags: ['Outreach'] },
73
+ },
74
+ cancel: {
75
+ method: 'POST',
76
+ path: '/outreach/requests/:id/cancel',
77
+ pathParams: zod_1.z.object({ id: zod_1.z.string().uuid() }),
78
+ body: zod_1.z.object({}),
79
+ responses: {
80
+ 200: outreach_requests_schemas_1.OutreachRequestSchema,
81
+ 404: error_schemas_1.ErrorResponseSchema,
82
+ 409: error_schemas_1.ErrorResponseSchema,
83
+ },
84
+ summary: 'Withdraw an outreach request',
85
+ description: 'PENDING only. Rejects non-PENDING requests with 409. A successful ' +
86
+ 'cancellation is terminal and frees the job for a new request.',
87
+ metadata: { tags: ['Outreach'] },
88
+ },
89
+ reassign: {
90
+ method: 'POST',
91
+ path: '/outreach/requests/:id/reassign',
92
+ pathParams: zod_1.z.object({ id: zod_1.z.string().uuid() }),
93
+ body: zod_1.z.object({ targetPodId: zod_1.z.string().uuid() }).strict(),
94
+ responses: {
95
+ 200: outreach_requests_schemas_1.OutreachRequestSchema,
96
+ 404: error_schemas_1.ErrorResponseSchema,
97
+ 409: error_schemas_1.ErrorResponseSchema,
98
+ },
99
+ summary: 'Reassign a pending outreach request to another Relay pod',
100
+ description: 'PENDING only. Rejects non-PENDING requests with 409. Returns the request with its updated assigned pod snapshot.',
101
+ metadata: { tags: ['Outreach'] },
102
+ },
103
+ list: {
104
+ method: 'GET',
105
+ path: '/outreach/requests',
106
+ query: zod_1.z.object({
107
+ status: outreach_requests_schemas_1.OutreachRequestStatusSchema.optional().describe('Narrow to one state. Default: PENDING and RUNNING.'),
108
+ }),
109
+ responses: {
110
+ 200: exports.ListOutreachRequestsResponseSchema,
111
+ },
112
+ summary: 'The open outreach queue',
113
+ description: 'PENDING and RUNNING requests, oldest first, with job facts for ' +
114
+ 'labelling. Service lane only — the service account still cannot ' +
115
+ 'read jobs generally.',
116
+ metadata: { tags: ['Outreach'] },
117
+ },
118
+ start: {
119
+ method: 'POST',
120
+ path: '/outreach/requests/:id/start',
121
+ pathParams: zod_1.z.object({ id: zod_1.z.string().uuid() }),
122
+ body: zod_1.z.object({}),
123
+ responses: {
124
+ 200: outreach_requests_schemas_1.OutreachRequestSchema,
125
+ 404: error_schemas_1.ErrorResponseSchema,
126
+ },
127
+ summary: 'Mark a request as being worked',
128
+ description: 'PENDING -> RUNNING. Idempotent: starting a RUNNING request returns ' +
129
+ 'it unchanged. Starting a terminal request is a 404.',
130
+ metadata: { tags: ['Outreach'] },
131
+ },
132
+ complete: {
133
+ method: 'POST',
134
+ path: '/outreach/requests/:id/complete',
135
+ pathParams: zod_1.z.object({ id: zod_1.z.string().uuid() }),
136
+ body: zod_1.z.object({}),
137
+ responses: {
138
+ 200: outreach_requests_schemas_1.OutreachRequestSchema,
139
+ 404: error_schemas_1.ErrorResponseSchema,
140
+ },
141
+ summary: 'Mark a request as drained or ended',
142
+ description: 'RUNNING -> COMPLETED. Terminal; frees the job for a new ' +
143
+ 'request. Completing an already COMPLETED request is a 200 no-op.',
144
+ metadata: { tags: ['Outreach'] },
145
+ },
146
+ }, {
147
+ pathPrefix: '/v2',
148
+ commonResponses: {
149
+ 400: error_schemas_1.ErrorResponseSchema,
150
+ 401: error_schemas_1.ErrorResponseSchema,
151
+ 403: error_schemas_1.ErrorResponseSchema,
152
+ 500: error_schemas_1.ErrorResponseSchema,
153
+ },
154
+ });
@@ -0,0 +1,95 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * `COMPLETED` and `CANCELLED` are terminal and free the job for a new
4
+ * request. The invariant that at most one PENDING-or-RUNNING request exists
5
+ * per job is a partial unique index in the database, not an application
6
+ * check — mirroring uq_candidate_contact_sessions_active_canonical, which is
7
+ * the real guarantee behind the claim path.
8
+ */
9
+ export declare const OutreachRequestStatusSchema: z.ZodEnum<["PENDING", "RUNNING", "COMPLETED", "CANCELLED"]>;
10
+ export type OutreachRequestStatus = z.infer<typeof OutreachRequestStatusSchema>;
11
+ /**
12
+ * `eligibleAtRequest` is a POINT-IN-TIME snapshot taken when the request was
13
+ * raised, not a live figure. The pool changes on every send, and refreshing it
14
+ * would reintroduce the per-job counting cost this design avoids on the feed.
15
+ * The live number is whatever claim-next finds. Label it as a snapshot.
16
+ */
17
+ export declare const OutreachRequestSchema: z.ZodObject<{
18
+ id: z.ZodString;
19
+ jobId: z.ZodString;
20
+ requestedByUserId: z.ZodString;
21
+ status: z.ZodEnum<["PENDING", "RUNNING", "COMPLETED", "CANCELLED"]>;
22
+ eligibleAtRequest: z.ZodNumber;
23
+ requestedByName: z.ZodNullable<z.ZodString>;
24
+ contactedCount: z.ZodNumber;
25
+ createdAt: z.ZodString;
26
+ startedAt: z.ZodNullable<z.ZodString>;
27
+ completedAt: z.ZodNullable<z.ZodString>;
28
+ assignedPod: z.ZodNullable<z.ZodObject<{
29
+ id: z.ZodString;
30
+ slug: z.ZodString;
31
+ displayName: z.ZodString;
32
+ ownerUserId: z.ZodString;
33
+ ownerName: z.ZodNullable<z.ZodString>;
34
+ publicBaseUrl: z.ZodEffects<z.ZodString, string, string>;
35
+ status: z.ZodEnum<["ACTIVE", "INACTIVE"]>;
36
+ }, "strict", z.ZodTypeAny, {
37
+ id: string;
38
+ status: "ACTIVE" | "INACTIVE";
39
+ slug: string;
40
+ displayName: string;
41
+ ownerUserId: string;
42
+ ownerName: string | null;
43
+ publicBaseUrl: string;
44
+ }, {
45
+ id: string;
46
+ status: "ACTIVE" | "INACTIVE";
47
+ slug: string;
48
+ displayName: string;
49
+ ownerUserId: string;
50
+ ownerName: string | null;
51
+ publicBaseUrl: string;
52
+ }>>;
53
+ }, "strip", z.ZodTypeAny, {
54
+ id: string;
55
+ jobId: string;
56
+ requestedByUserId: string;
57
+ status: "PENDING" | "RUNNING" | "COMPLETED" | "CANCELLED";
58
+ eligibleAtRequest: number;
59
+ requestedByName: string | null;
60
+ contactedCount: number;
61
+ createdAt: string;
62
+ startedAt: string | null;
63
+ completedAt: string | null;
64
+ assignedPod: {
65
+ id: string;
66
+ status: "ACTIVE" | "INACTIVE";
67
+ slug: string;
68
+ displayName: string;
69
+ ownerUserId: string;
70
+ ownerName: string | null;
71
+ publicBaseUrl: string;
72
+ } | null;
73
+ }, {
74
+ id: string;
75
+ jobId: string;
76
+ requestedByUserId: string;
77
+ status: "PENDING" | "RUNNING" | "COMPLETED" | "CANCELLED";
78
+ eligibleAtRequest: number;
79
+ requestedByName: string | null;
80
+ contactedCount: number;
81
+ createdAt: string;
82
+ startedAt: string | null;
83
+ completedAt: string | null;
84
+ assignedPod: {
85
+ id: string;
86
+ status: "ACTIVE" | "INACTIVE";
87
+ slug: string;
88
+ displayName: string;
89
+ ownerUserId: string;
90
+ ownerName: string | null;
91
+ publicBaseUrl: string;
92
+ } | null;
93
+ }>;
94
+ export type OutreachRequest = z.infer<typeof OutreachRequestSchema>;
95
+ //# sourceMappingURL=outreach-requests.schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outreach-requests.schemas.d.ts","sourceRoot":"","sources":["../../contracts/outreach/outreach-requests.schemas.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,6DAEM,CAAC;AAE/C,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyBM,CAAC;AAEzC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OutreachRequestSchema = exports.OutreachRequestStatusSchema = void 0;
4
+ /**
5
+ * Project: Internal Recruitment Platform API
6
+ * File: outreach-requests.schemas.ts
7
+ *
8
+ * Description: The outreach REQUEST queue — an agent marks a job for outreach,
9
+ * the rack polls the queue and launches a campaign against it.
10
+ *
11
+ * Split out of outreach-requests.contract.ts so jobs-tab.contract.ts can import
12
+ * the status enum for its feed-card payload without importing a ts-rest router.
13
+ *
14
+ * Auth: two lanes. Creating and cancelling is a human agent's JWT; listing,
15
+ * starting and completing is the service account's Bearer key — the same key
16
+ * the claim routes already accept.
17
+ */
18
+ const zod_openapi_1 = require("@anatine/zod-openapi");
19
+ const zod_1 = require("zod");
20
+ const relay_pods_schemas_1 = require("../relay-pods/relay-pods.schemas");
21
+ (0, zod_openapi_1.extendZodWithOpenApi)(zod_1.z);
22
+ /**
23
+ * `COMPLETED` and `CANCELLED` are terminal and free the job for a new
24
+ * request. The invariant that at most one PENDING-or-RUNNING request exists
25
+ * per job is a partial unique index in the database, not an application
26
+ * check — mirroring uq_candidate_contact_sessions_active_canonical, which is
27
+ * the real guarantee behind the claim path.
28
+ */
29
+ exports.OutreachRequestStatusSchema = zod_1.z
30
+ .enum(['PENDING', 'RUNNING', 'COMPLETED', 'CANCELLED'])
31
+ .openapi({ title: 'OutreachRequestStatus' });
32
+ /**
33
+ * `eligibleAtRequest` is a POINT-IN-TIME snapshot taken when the request was
34
+ * raised, not a live figure. The pool changes on every send, and refreshing it
35
+ * would reintroduce the per-job counting cost this design avoids on the feed.
36
+ * The live number is whatever claim-next finds. Label it as a snapshot.
37
+ */
38
+ exports.OutreachRequestSchema = zod_1.z
39
+ .object({
40
+ id: zod_1.z.string().uuid(),
41
+ jobId: zod_1.z.string().uuid(),
42
+ requestedByUserId: zod_1.z.string().uuid(),
43
+ status: exports.OutreachRequestStatusSchema,
44
+ eligibleAtRequest: zod_1.z
45
+ .number()
46
+ .int()
47
+ .min(0)
48
+ .describe('Eligible candidates counted when the request was raised'),
49
+ requestedByName: zod_1.z
50
+ .string()
51
+ .nullable()
52
+ .describe('Agent who raised the request'),
53
+ contactedCount: zod_1.z
54
+ .number()
55
+ .int()
56
+ .min(0)
57
+ .describe('Sends confirmed against this job so far'),
58
+ createdAt: zod_1.z.string().datetime(),
59
+ startedAt: zod_1.z.string().datetime().nullable(),
60
+ completedAt: zod_1.z.string().datetime().nullable(),
61
+ assignedPod: relay_pods_schemas_1.RelayPodSummarySchema.nullable(),
62
+ })
63
+ .openapi({ title: 'OutreachRequest' });