@dakkitor/api-contracts 1.1.29 → 1.1.31

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.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Project: Internal Recruitment Platform API
3
+ * File: abilities.contract.ts
4
+ *
5
+ * Description: Exports CASL ability definitions for each user role.
6
+ * These are the single source of truth for role-based permissions.
7
+ */
8
+ export interface AbilityRule {
9
+ action: string;
10
+ subject: string;
11
+ fields?: string[];
12
+ conditions?: Record<string, unknown>;
13
+ inverted?: boolean;
14
+ }
15
+ export declare const AdminAbilities: AbilityRule[];
16
+ export declare const FirstAgentAbilities: AbilityRule[];
17
+ export declare const SecondAgentAbilities: AbilityRule[];
18
+ export declare const RoleAbilities: {
19
+ readonly ADMIN: AbilityRule[];
20
+ readonly FIRST_AGENT: AbilityRule[];
21
+ readonly SECOND_AGENT: AbilityRule[];
22
+ };
23
+ export type RoleAbilitiesType = typeof RoleAbilities;
24
+ //# sourceMappingURL=abilities.contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abilities.contract.d.ts","sourceRoot":"","sources":["../../contracts/abilities/abilities.contract.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,cAAc,EAAE,WAAW,EAAoC,CAAC;AAC7E,eAAO,MAAM,mBAAmB,EAAE,WAAW,EACP,CAAC;AACvC,eAAO,MAAM,oBAAoB,EAAE,WAAW,EACP,CAAC;AAExC,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,OAAO,aAAa,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * Project: Internal Recruitment Platform API
4
+ * File: abilities.contract.ts
5
+ *
6
+ * Description: Exports CASL ability definitions for each user role.
7
+ * These are the single source of truth for role-based permissions.
8
+ */
9
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.RoleAbilities = exports.SecondAgentAbilities = exports.FirstAgentAbilities = exports.AdminAbilities = void 0;
14
+ const admin_abilities_json_1 = __importDefault(require("./admin.abilities.json"));
15
+ const first_agent_abilities_json_1 = __importDefault(require("./first-agent.abilities.json"));
16
+ const second_agent_abilities_json_1 = __importDefault(require("./second-agent.abilities.json"));
17
+ exports.AdminAbilities = admin_abilities_json_1.default;
18
+ exports.FirstAgentAbilities = first_agent_abilities_json_1.default;
19
+ exports.SecondAgentAbilities = second_agent_abilities_json_1.default;
20
+ exports.RoleAbilities = {
21
+ ADMIN: exports.AdminAbilities,
22
+ FIRST_AGENT: exports.FirstAgentAbilities,
23
+ SECOND_AGENT: exports.SecondAgentAbilities,
24
+ };
@@ -0,0 +1,22 @@
1
+ [
2
+ {
3
+ "action": "manage",
4
+ "subject": "all"
5
+ },
6
+ {
7
+ "action": "update",
8
+ "subject": "User",
9
+ "conditions": {
10
+ "id": "{{ id }}"
11
+ },
12
+ "inverted": true
13
+ },
14
+ {
15
+ "action": "delete",
16
+ "subject": "User",
17
+ "conditions": {
18
+ "id": "{{ id }}"
19
+ },
20
+ "inverted": true
21
+ }
22
+ ]
@@ -0,0 +1,573 @@
1
+ [
2
+ {
3
+ "action": "read",
4
+ "subject": "User",
5
+ "conditions": {
6
+ "roles": {
7
+ "$in": [
8
+ "FIRST_AGENT",
9
+ "SECOND_AGENT"
10
+ ]
11
+ }
12
+ }
13
+ },
14
+ {
15
+ "action": "update",
16
+ "subject": "User",
17
+ "fields": [
18
+ "password"
19
+ ],
20
+ "conditions": {
21
+ "id": "{{ id }}"
22
+ }
23
+ },
24
+ {
25
+ "action": "read",
26
+ "subject": "Qualification"
27
+ },
28
+ {
29
+ "action": "read",
30
+ "subject": "QualificationType"
31
+ },
32
+ {
33
+ "action": "read",
34
+ "subject": "Trade"
35
+ },
36
+ {
37
+ "action": "read",
38
+ "subject": "Company",
39
+ "fields": [
40
+ "id",
41
+ "name",
42
+ "updatedAt",
43
+ "createdAt"
44
+ ]
45
+ },
46
+ {
47
+ "action": "create",
48
+ "subject": "Location",
49
+ "fields": [
50
+ "address",
51
+ "postcode"
52
+ ]
53
+ },
54
+ {
55
+ "action": "update",
56
+ "subject": "Job",
57
+ "fields": [
58
+ "description",
59
+ "location",
60
+ "location.address",
61
+ "location.postcode",
62
+ "pay",
63
+ "pay.*",
64
+ "numberOfPositions",
65
+ "workHours",
66
+ "status",
67
+ "tradeId",
68
+ "jobQualifications",
69
+ "jobQualifications[*].*"
70
+ ]
71
+ },
72
+ {
73
+ "action": "create",
74
+ "subject": "Job"
75
+ },
76
+ {
77
+ "action": "read",
78
+ "subject": "FilterJobSchema",
79
+ "fields": [
80
+ "tradeId",
81
+ "status",
82
+ "postcode",
83
+ "distance",
84
+ "pay",
85
+ "pay.*",
86
+ "createdAt",
87
+ "createdAt.*",
88
+ "sortBy",
89
+ "sortOrder",
90
+ "page",
91
+ "limit"
92
+ ]
93
+ },
94
+ {
95
+ "action": "read",
96
+ "subject": "Job",
97
+ "fields": [
98
+ "id",
99
+ "description",
100
+ "location",
101
+ "location.*",
102
+ "tradeId",
103
+ "pay",
104
+ "pay.*",
105
+ "jobQualifications",
106
+ "jobQualifications[*].*",
107
+ "currentCollaboration",
108
+ "currentCollaboration.company.*",
109
+ "currentCollaboration.client.*",
110
+ "currentCollaboration.userId",
111
+ "numberOfPositions",
112
+ "workHours",
113
+ "status",
114
+ "startDate",
115
+ "endDate",
116
+ "createdAt",
117
+ "updatedAt"
118
+ ],
119
+ "conditions": {
120
+ "currentCollaboration.userId": "{{ id }}"
121
+ }
122
+ },
123
+ {
124
+ "action": "create",
125
+ "subject": "Collaboration",
126
+ "fields": [
127
+ "client",
128
+ "client.id",
129
+ "company",
130
+ "company.id"
131
+ ]
132
+ },
133
+ {
134
+ "action": "read",
135
+ "subject": "Collaboration",
136
+ "fields": [
137
+ "id",
138
+ "company",
139
+ "company.*",
140
+ "client",
141
+ "client.*",
142
+ "userId",
143
+ "status",
144
+ "createdAt",
145
+ "updatedAt"
146
+ ],
147
+ "conditions": {
148
+ "userId": "{{ id }}"
149
+ }
150
+ },
151
+ {
152
+ "action": "update",
153
+ "subject": "Collaboration",
154
+ "fields": [
155
+ "id",
156
+ "company",
157
+ "company.id"
158
+ ],
159
+ "conditions": {
160
+ "userId": "{{ id }}"
161
+ }
162
+ },
163
+ {
164
+ "action": "read",
165
+ "subject": "Client",
166
+ "fields": [
167
+ "id",
168
+ "name",
169
+ "crn",
170
+ "govLink",
171
+ "director",
172
+ "blacklistReason",
173
+ "status",
174
+ "createdAt",
175
+ "updatedAt",
176
+ "version",
177
+ "agentClientLinks",
178
+ "agentClientLinks.agentId"
179
+ ],
180
+ "conditions": {
181
+ "agentClientLinks.agentId": "{{ id }}"
182
+ }
183
+ },
184
+ {
185
+ "action": "create",
186
+ "subject": "Client"
187
+ },
188
+ {
189
+ "action": "read",
190
+ "subject": "AgentClientLink",
191
+ "conditions": {
192
+ "agentId": "{{ id }}"
193
+ }
194
+ },
195
+ {
196
+ "action": "update",
197
+ "subject": "Client",
198
+ "fields": [
199
+ "name",
200
+ "director",
201
+ "blacklistReason",
202
+ "status"
203
+ ],
204
+ "conditions": {
205
+ "agentClientLinks.agentId": "{{ id }}"
206
+ }
207
+ },
208
+ {
209
+ "action": "read",
210
+ "subject": "ClientContact",
211
+ "fields": [
212
+ "id",
213
+ "clientId",
214
+ "client",
215
+ "client.*",
216
+ "name",
217
+ "position",
218
+ "phone",
219
+ "email",
220
+ "source",
221
+ "createdById",
222
+ "createdAt",
223
+ "updatedAt"
224
+ ],
225
+ "conditions": {
226
+ "createdById": "{{ id }}"
227
+ }
228
+ },
229
+ {
230
+ "action": "update",
231
+ "subject": "ClientContact",
232
+ "fields": [
233
+ "name",
234
+ "position",
235
+ "phone",
236
+ "email",
237
+ "source"
238
+ ],
239
+ "conditions": {
240
+ "createdById": "{{ id }}"
241
+ }
242
+ },
243
+ {
244
+ "action": "create",
245
+ "subject": "ClientContact"
246
+ },
247
+ {
248
+ "action": "read",
249
+ "subject": "CollaborationChecking",
250
+ "fields": [
251
+ "id",
252
+ "collaborationId",
253
+ "collaboration",
254
+ "collaboration.client.*",
255
+ "collaboration.company.*",
256
+ "urgency",
257
+ "decision",
258
+ "decisionTimestamp",
259
+ "decisionComment",
260
+ "isTermsAndConditionsConfirmed",
261
+ "termsAndConditionsConfirmedTimestamp",
262
+ "emailType",
263
+ "email",
264
+ "introductionEmailSent",
265
+ "introductionEmailTimestamp",
266
+ "collaborationEmailSent",
267
+ "collaborationEmailTimestamp",
268
+ "createdAt",
269
+ "updatedAt"
270
+ ],
271
+ "conditions": {
272
+ "collaboration.userId": "{{ id }}"
273
+ }
274
+ },
275
+ {
276
+ "action": "create",
277
+ "subject": "CollaborationChecking",
278
+ "fields": [
279
+ "collaboration.id",
280
+ "clientContact.id",
281
+ "urgency",
282
+ "emailType",
283
+ "email"
284
+ ],
285
+ "conditions": {
286
+ "collaboration.userId": "{{ id }}"
287
+ }
288
+ },
289
+ {
290
+ "action": "update",
291
+ "subject": "CollaborationChecking",
292
+ "fields": [
293
+ "urgency",
294
+ "emailType"
295
+ ],
296
+ "conditions": {
297
+ "collaboration.userId": "{{ id }}"
298
+ }
299
+ },
300
+ {
301
+ "action": "update",
302
+ "subject": "Active",
303
+ "fields": [
304
+ "statusFa"
305
+ ],
306
+ "conditions": {
307
+ "booking.job.currentCollaboration.userId": "{{ id }}"
308
+ }
309
+ },
310
+ {
311
+ "action": "read",
312
+ "subject": "Active",
313
+ "fields": [
314
+ "id",
315
+ "statusFa",
316
+ "statusFaUpdatedAt",
317
+ "hoursWorked",
318
+ "hoursWorkedUpdatedAt",
319
+ "date",
320
+ "booking",
321
+ "booking.id",
322
+ "booking.job.currentCollaboration.userId",
323
+ "booking.job.currentCollaboration.company.*",
324
+ "booking.job.currentCollaboration.client.*",
325
+ "booking.job.location.*",
326
+ "booking.job.pay.*",
327
+ "booking.job.jobQualifications[*].*",
328
+ "booking.job.*",
329
+ "booking.worker",
330
+ "booking.worker.firstName",
331
+ "booking.worker.lastName",
332
+ "booking.status",
333
+ "booking.pay.rate",
334
+ "booking.pay.unit",
335
+ "booking.createdAt",
336
+ "booking.updatedAt",
337
+ "booking.startDate",
338
+ "booking.endDate",
339
+ "booking.user.*",
340
+ "booking.statusUpdatedAt",
341
+ "createdAt",
342
+ "updatedAt"
343
+ ],
344
+ "conditions": {
345
+ "booking.job.currentCollaboration.userId": "{{ id }}"
346
+ }
347
+ },
348
+ {
349
+ "action": "read",
350
+ "subject": "Booking",
351
+ "fields": [
352
+ "id",
353
+ "job",
354
+ "job.currentCollaboration.userId",
355
+ "job.currentCollaboration.company.*",
356
+ "job.currentCollaboration.client.*",
357
+ "job.location.*",
358
+ "job.pay.*",
359
+ "job.jobQualifications[*].*",
360
+ "job.*",
361
+ "worker",
362
+ "worker.firstName",
363
+ "worker.lastName",
364
+ "status",
365
+ "pay",
366
+ "pay.rate",
367
+ "pay.unit",
368
+ "createdAt",
369
+ "updatedAt",
370
+ "startDate",
371
+ "endDate",
372
+ "user",
373
+ "user.*",
374
+ "statusUpdatedAt"
375
+ ],
376
+ "conditions": {
377
+ "job.currentCollaboration.userId": "{{ id }}"
378
+ }
379
+ },
380
+ {
381
+ "action": "read",
382
+ "subject": "File",
383
+ "conditions": {
384
+ "userId": "{{ id }}"
385
+ }
386
+ },
387
+ {
388
+ "action": "read",
389
+ "subject": "FilterBookingSchema",
390
+ "fields": [
391
+ "workerName",
392
+ "job",
393
+ "job.*",
394
+ "createdAt",
395
+ "createdAt.*",
396
+ "startDate",
397
+ "startDate.*",
398
+ "endDate",
399
+ "endDate.*",
400
+ "sortBy",
401
+ "sortOrder",
402
+ "status",
403
+ "clientId",
404
+ "companyId",
405
+ "agentName",
406
+ "page",
407
+ "limit"
408
+ ]
409
+ },
410
+ {
411
+ "action": "read",
412
+ "subject": "FilterActiveSchema",
413
+ "fields": [
414
+ "bookingId",
415
+ "date",
416
+ "date.*",
417
+ "pay",
418
+ "pay.*",
419
+ "status",
420
+ "status.*",
421
+ "createdAt",
422
+ "createdAt.*",
423
+ "sortBy",
424
+ "sortOrder",
425
+ "page",
426
+ "limit"
427
+ ]
428
+ },
429
+ {
430
+ "action": "read",
431
+ "subject": "FilterUserSchema",
432
+ "fields": [
433
+ "name",
434
+ "email",
435
+ "phone",
436
+ "roles",
437
+ "roles.*",
438
+ "sortBy",
439
+ "sortOrder",
440
+ "page",
441
+ "limit"
442
+ ]
443
+ },
444
+ {
445
+ "action": "read",
446
+ "subject": "FilterCompanySchema",
447
+ "fields": [
448
+ "name",
449
+ "sortBy",
450
+ "sortOrder",
451
+ "page",
452
+ "limit"
453
+ ]
454
+ },
455
+ {
456
+ "action": "read",
457
+ "subject": "FilterClientSchema",
458
+ "fields": [
459
+ "name",
460
+ "status",
461
+ "director",
462
+ "createdAt",
463
+ "createdAt.*",
464
+ "sortBy",
465
+ "sortOrder",
466
+ "page",
467
+ "limit"
468
+ ]
469
+ },
470
+ {
471
+ "action": "read",
472
+ "subject": "FilterAgentClientLinkSchema",
473
+ "fields": [
474
+ "clientId",
475
+ "agentId",
476
+ "linkType",
477
+ "sortBy",
478
+ "sortOrder",
479
+ "page",
480
+ "limit"
481
+ ]
482
+ },
483
+ {
484
+ "action": "read",
485
+ "subject": "FilterClientContactSchema",
486
+ "fields": [
487
+ "name",
488
+ "email",
489
+ "phone",
490
+ "clientId",
491
+ "createdById",
492
+ "position",
493
+ "source",
494
+ "sortBy",
495
+ "sortOrder",
496
+ "page",
497
+ "limit"
498
+ ]
499
+ },
500
+ {
501
+ "action": "read",
502
+ "subject": "FilterCollaborationSchema",
503
+ "fields": [
504
+ "companyId",
505
+ "clientId",
506
+ "userId",
507
+ "status",
508
+ "sortBy",
509
+ "sortOrder",
510
+ "page",
511
+ "limit"
512
+ ]
513
+ },
514
+ {
515
+ "action": "read",
516
+ "subject": "FilterCollaborationCheckingSchema",
517
+ "fields": [
518
+ "companyId",
519
+ "clientId",
520
+ "urgency",
521
+ "decision",
522
+ "createdById",
523
+ "sortBy",
524
+ "sortOrder",
525
+ "page",
526
+ "limit"
527
+ ]
528
+ },
529
+ {
530
+ "action": "read",
531
+ "subject": "FilterCallHistorySchema",
532
+ "fields": [
533
+ "assignmentId",
534
+ "rating",
535
+ "callType",
536
+ "callDateFrom",
537
+ "callDateTo",
538
+ "sortBy",
539
+ "sortOrder",
540
+ "page",
541
+ "limit"
542
+ ]
543
+ },
544
+ {
545
+ "action": "read",
546
+ "subject": "FilterLocationSchema",
547
+ "fields": [
548
+ "page",
549
+ "limit"
550
+ ]
551
+ },
552
+ {
553
+ "action": "read",
554
+ "subject": "LeadAssignment",
555
+ "conditions": {
556
+ "agentId": "{{ id }}"
557
+ }
558
+ },
559
+ {
560
+ "action": "update",
561
+ "subject": "LeadAssignment",
562
+ "conditions": {
563
+ "agentId": "{{ id }}"
564
+ }
565
+ },
566
+ {
567
+ "action": "read",
568
+ "subject": "CallHistory",
569
+ "conditions": {
570
+ "assignment.agentId": "{{ id }}"
571
+ }
572
+ }
573
+ ]