@kernhq/module-hr 0.15.0 → 0.17.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 (57) hide show
  1. package/dist/contract/index.d.ts +1 -0
  2. package/dist/contract/index.d.ts.map +1 -1
  3. package/dist/contract/index.js +1 -0
  4. package/dist/contract/index.js.map +1 -1
  5. package/dist/contract/models.d.ts +1 -0
  6. package/dist/contract/models.d.ts.map +1 -1
  7. package/dist/contract/models.js +15 -0
  8. package/dist/contract/models.js.map +1 -1
  9. package/dist/contract/permissions.d.ts +8 -0
  10. package/dist/contract/permissions.d.ts.map +1 -1
  11. package/dist/contract/permissions.js +20 -0
  12. package/dist/contract/permissions.js.map +1 -1
  13. package/dist/contract/privacy.d.ts +860 -0
  14. package/dist/contract/privacy.d.ts.map +1 -0
  15. package/dist/contract/privacy.js +412 -0
  16. package/dist/contract/privacy.js.map +1 -0
  17. package/dist/contract/router.d.ts +815 -0
  18. package/dist/contract/router.d.ts.map +1 -1
  19. package/dist/contract/router.js +105 -0
  20. package/dist/contract/router.js.map +1 -1
  21. package/dist/server/index.d.ts.map +1 -1
  22. package/dist/server/index.js +51 -0
  23. package/dist/server/index.js.map +1 -1
  24. package/dist/server/jobs.d.ts.map +1 -1
  25. package/dist/server/jobs.js +44 -7
  26. package/dist/server/jobs.js.map +1 -1
  27. package/dist/server/router.d.ts +994 -1
  28. package/dist/server/router.d.ts.map +1 -1
  29. package/dist/server/router.js +766 -282
  30. package/dist/server/router.js.map +1 -1
  31. package/dist/server/schema.d.ts +397 -1
  32. package/dist/server/schema.d.ts.map +1 -1
  33. package/dist/server/schema.js +109 -0
  34. package/dist/server/schema.js.map +1 -1
  35. package/dist/server/services/audit.d.ts +249 -0
  36. package/dist/server/services/audit.d.ts.map +1 -0
  37. package/dist/server/services/audit.js +230 -0
  38. package/dist/server/services/audit.js.map +1 -0
  39. package/dist/server/services/people.d.ts +53 -1
  40. package/dist/server/services/people.d.ts.map +1 -1
  41. package/dist/server/services/people.js +74 -1
  42. package/dist/server/services/people.js.map +1 -1
  43. package/dist/server/services/privacy.d.ts +514 -0
  44. package/dist/server/services/privacy.d.ts.map +1 -0
  45. package/dist/server/services/privacy.js +972 -0
  46. package/dist/server/services/privacy.js.map +1 -0
  47. package/migrations/0011_privacy.sql +77 -0
  48. package/migrations/meta/0011_snapshot.json +4450 -0
  49. package/migrations/meta/_journal.json +7 -0
  50. package/package.json +1 -1
  51. package/src/client/messages.ts +17 -0
  52. package/src/client/widgets/ApprovalsWidget.svelte +119 -8
  53. package/src/contract/index.ts +1 -0
  54. package/src/contract/models.ts +15 -0
  55. package/src/contract/permissions.ts +22 -0
  56. package/src/contract/privacy.ts +452 -0
  57. package/src/contract/router.ts +121 -0
@@ -1,4 +1,121 @@
1
- import { type Kernel, type RequestContext } from '@kernhq/kernel';
1
+ import { type Kernel, type RequestContext, type Tx } from '@kernhq/kernel';
2
+ import { type SubjectAppliers } from './services/approvals.js';
3
+ import { AttendanceService } from './services/attendance.js';
4
+ import { LedgerService } from './services/ledger.js';
5
+ import { ResolveService } from './services/resolve.js';
6
+ /**
7
+ * What a *decided* request does to its subject, and the calculation both halves of that stand on.
8
+ *
9
+ * These lived inside `implement_`'s closure, and that is the whole reason `ApprovalService` had
10
+ * appliers only when a person was on the other end of the call: a job cannot reach into a router's
11
+ * closure, so `sweepTimeouts` would advance an intermediate step and then refuse the step that
12
+ * *completes* a request — logging that it had reminded instead. A deadline an administrator set,
13
+ * believed, and told their staff about did nothing on the one step that mattered.
14
+ *
15
+ * So it is a factory both callers can reach: `implement_` below, and `hrJobs` in `jobs.ts`. It is a
16
+ * factory rather than a class because the closure is the point — `applyApproval` needs `simulate`,
17
+ * `simulate` needs the ledger and the composed calendar, and threading those through method
18
+ * arguments would buy nothing.
19
+ *
20
+ * The alternative was a second `simulate` in the job, and it is worth naming why not: two copies of
21
+ * a leave calculation drift, both of them type-check while they drift, and the first sign of it is
22
+ * an employee whose balance disagrees with the days they were granted.
23
+ *
24
+ * Services are passed in rather than constructed here so a caller keeps one instance of each — two
25
+ * `AttendanceService`s is not a bug today and is one cache away from being one.
26
+ */
27
+ export declare function hrSubjects(deps: {
28
+ resolve: ResolveService;
29
+ ledger: LedgerService;
30
+ attendance: AttendanceService;
31
+ }): {
32
+ loadRequest: (tx: Tx, workspaceId: string, requestId: string) => Promise<{
33
+ id: string;
34
+ workspaceId: string;
35
+ personId: string;
36
+ leaveTypeId: string;
37
+ startsOn: string;
38
+ endsOn: string;
39
+ startPart: string;
40
+ endPart: string;
41
+ hours: string | null;
42
+ workingDays: string;
43
+ minutes: number;
44
+ status: string;
45
+ reason: string | null;
46
+ documentFileId: string | null;
47
+ approvalRequestId: string | null;
48
+ idempotencyKey: string | null;
49
+ decidedAt: Date | null;
50
+ createdAt: Date;
51
+ updatedAt: Date;
52
+ }>;
53
+ simulate: (tx: Tx, workspaceId: string, personId: string, input: {
54
+ leaveTypeId: string;
55
+ startsOn: string;
56
+ endsOn: string;
57
+ startPart: "full" | "morning" | "afternoon";
58
+ endPart: "full" | "morning" | "afternoon";
59
+ hours?: number | null;
60
+ }) => Promise<{
61
+ workingDays: number;
62
+ minutes: number;
63
+ days: {
64
+ date: string;
65
+ fraction: number;
66
+ counted: boolean;
67
+ reason: string | null;
68
+ }[];
69
+ balanceBeforeMinutes: number;
70
+ balanceAfterMinutes: number;
71
+ blockers: {
72
+ code: string;
73
+ message: string;
74
+ }[];
75
+ }>;
76
+ applyApproval: (tx: Tx, workspaceId: string, leaveRequestId: string, actorId: string | null) => Promise<void>;
77
+ applyRegularization: (tx: Tx, workspaceId: string, regularizationId: string) => Promise<void>;
78
+ personContext: (tx: Tx, workspaceId: string, personId: string) => Promise<{
79
+ timezone: string;
80
+ schedule: import("./services/attendance.js").ResolvedSchedule;
81
+ resolution: {
82
+ personId: string;
83
+ on: string;
84
+ primaryOfficeId: string | null;
85
+ primaryOfficeName: string | null;
86
+ otherOfficeIds: string[];
87
+ country: string | null;
88
+ timezone: string;
89
+ timezoneFrom: "person" | "office" | "legal_entity" | "org_unit" | "position" | "workspace";
90
+ calendarId: string | null;
91
+ calendarFrom: "person" | "office" | "legal_entity" | "org_unit" | "position" | "workspace" | null;
92
+ workingWeek: {
93
+ mon: number;
94
+ tue: number;
95
+ wed: number;
96
+ thu: number;
97
+ fri: number;
98
+ sat: number;
99
+ sun: number;
100
+ };
101
+ legalEntityId: string | null;
102
+ orgUnitId: string | null;
103
+ orgUnitPath: string | null;
104
+ managerPersonId: string | null;
105
+ };
106
+ }>;
107
+ /**
108
+ * The same two functions in the shape `ApprovalService` calls them in, keyed by `subjectType` —
109
+ * the only thing the engine knows about a subject.
110
+ *
111
+ * Parameterised by the actor because that is the one thing the two callers genuinely disagree
112
+ * about: a person approving leave is written onto the ledger entry as `created_by`, and a
113
+ * deadline running out is written as nobody. Passing the approver's id for a timeout would put
114
+ * a name against a decision that person did not make, which is exactly what
115
+ * `TIMEOUT_APPROVER_ID` exists to avoid one table over.
116
+ */
117
+ appliersFor: (actorId: string | null) => SubjectAppliers;
118
+ };
2
119
  /**
3
120
  * The router.
4
121
  *
@@ -73,6 +190,7 @@ export declare function implement_(kernel: Kernel): {
73
190
  timezone: import("zod").ZodNullable<import("zod").ZodString>;
74
191
  custom: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
75
192
  personnelHidden: import("zod").ZodDefault<import("zod").ZodBoolean>;
193
+ erasedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
76
194
  createdAt: import("zod").ZodISODateTime;
77
195
  updatedAt: import("zod").ZodISODateTime;
78
196
  workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
@@ -151,6 +269,7 @@ export declare function implement_(kernel: Kernel): {
151
269
  timezone: import("zod").ZodNullable<import("zod").ZodString>;
152
270
  custom: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
153
271
  personnelHidden: import("zod").ZodDefault<import("zod").ZodBoolean>;
272
+ erasedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
154
273
  createdAt: import("zod").ZodISODateTime;
155
274
  updatedAt: import("zod").ZodISODateTime;
156
275
  workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
@@ -223,6 +342,7 @@ export declare function implement_(kernel: Kernel): {
223
342
  timezone: import("zod").ZodNullable<import("zod").ZodString>;
224
343
  custom: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
225
344
  personnelHidden: import("zod").ZodDefault<import("zod").ZodBoolean>;
345
+ erasedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
226
346
  createdAt: import("zod").ZodISODateTime;
227
347
  updatedAt: import("zod").ZodISODateTime;
228
348
  workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
@@ -312,6 +432,7 @@ export declare function implement_(kernel: Kernel): {
312
432
  timezone: import("zod").ZodNullable<import("zod").ZodString>;
313
433
  custom: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
314
434
  personnelHidden: import("zod").ZodDefault<import("zod").ZodBoolean>;
435
+ erasedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
315
436
  createdAt: import("zod").ZodISODateTime;
316
437
  updatedAt: import("zod").ZodISODateTime;
317
438
  workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
@@ -392,6 +513,7 @@ export declare function implement_(kernel: Kernel): {
392
513
  timezone: import("zod").ZodNullable<import("zod").ZodString>;
393
514
  custom: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
394
515
  personnelHidden: import("zod").ZodDefault<import("zod").ZodBoolean>;
516
+ erasedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
395
517
  createdAt: import("zod").ZodISODateTime;
396
518
  updatedAt: import("zod").ZodISODateTime;
397
519
  workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
@@ -467,6 +589,7 @@ export declare function implement_(kernel: Kernel): {
467
589
  timezone: import("zod").ZodNullable<import("zod").ZodString>;
468
590
  custom: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
469
591
  personnelHidden: import("zod").ZodDefault<import("zod").ZodBoolean>;
592
+ erasedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
470
593
  createdAt: import("zod").ZodISODateTime;
471
594
  updatedAt: import("zod").ZodISODateTime;
472
595
  workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
@@ -1976,6 +2099,7 @@ export declare function implement_(kernel: Kernel): {
1976
2099
  timezone: import("zod").ZodNullable<import("zod").ZodString>;
1977
2100
  custom: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
1978
2101
  personnelHidden: import("zod").ZodDefault<import("zod").ZodBoolean>;
2102
+ erasedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
1979
2103
  createdAt: import("zod").ZodISODateTime;
1980
2104
  updatedAt: import("zod").ZodISODateTime;
1981
2105
  workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
@@ -8339,5 +8463,874 @@ export declare function implement_(kernel: Kernel): {
8339
8463
  };
8340
8464
  }>>, Record<never, never>>;
8341
8465
  };
8466
+ privacy: {
8467
+ subjectAccess: import("@orpc/server").Procedure<import("@orpc/server").MergedInitialContext<RequestContext & Record<never, never>, RequestContext & Record<never, never> & Omit<RequestContext & Record<never, never>, keyof RequestContext> & Omit<RequestContext & Record<never, never>, "workspaceId" | "requestId" | "kernel" | "principal" | "ip" | "headers">, RequestContext>, Omit<import("@orpc/server").MergedCurrentContext<RequestContext, {
8468
+ workspaceId: string;
8469
+ kernel: Kernel;
8470
+ principal: {
8471
+ kind: "service" | "user" | "api_key" | "anonymous";
8472
+ userId: (string & import("zod").$brand<"UserId">) | null;
8473
+ email: string | null;
8474
+ name: string | null;
8475
+ locale: "en" | "fa" | "ar" | "de";
8476
+ instanceAdmin: boolean;
8477
+ service: string | null;
8478
+ memberships: {
8479
+ workspaceId: string & import("zod").$brand<"WorkspaceId">;
8480
+ role: "owner" | "admin" | "member" | "guest";
8481
+ roleIds: string[];
8482
+ groupIds: string[];
8483
+ status: "active" | "invited" | "suspended";
8484
+ }[];
8485
+ permissionVersion: number;
8486
+ };
8487
+ requestId: string;
8488
+ ip: string;
8489
+ headers: Record<string, string | string[] | undefined>;
8490
+ }>, never> & Record<never, never>, import("zod").ZodObject<{
8491
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8492
+ personId: import("zod").ZodUUID;
8493
+ purpose: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
8494
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
8495
+ manifest: import("zod").ZodObject<{
8496
+ personId: import("zod").ZodUUID;
8497
+ generatedAt: import("zod").ZodISODateTime;
8498
+ generatedBy: import("zod").ZodNullable<import("zod").ZodUUID>;
8499
+ moduleVersion: import("zod").ZodString;
8500
+ truncated: import("zod").ZodArray<import("zod").ZodObject<{
8501
+ section: import("zod").ZodString;
8502
+ returned: import("zod").ZodNumber;
8503
+ cap: import("zod").ZodNumber;
8504
+ }, import("zod/v4/core").$strip>>;
8505
+ excluded: import("zod").ZodArray<import("zod").ZodObject<{
8506
+ section: import("zod").ZodString;
8507
+ reason: import("zod").ZodEnum<{
8508
+ fileContentsNotExportable: "fileContentsNotExportable";
8509
+ notRequested: "notRequested";
8510
+ }>;
8511
+ }, import("zod/v4/core").$strip>>;
8512
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8513
+ }, import("zod/v4/core").$strip>;
8514
+ person: import("zod").ZodObject<{
8515
+ userId: import("zod").ZodNullable<import("zod").ZodUUID>;
8516
+ employeeNo: import("zod").ZodNullable<import("zod").ZodString>;
8517
+ displayName: import("zod").ZodString;
8518
+ workEmail: import("zod").ZodNullable<import("zod").ZodEmail>;
8519
+ personalEmail: import("zod").ZodNullable<import("zod").ZodEmail>;
8520
+ phone: import("zod").ZodNullable<import("zod").ZodString>;
8521
+ photoFileId: import("zod").ZodNullable<import("zod").ZodUUID>;
8522
+ status: import("zod").ZodEnum<{
8523
+ onboarding: "onboarding";
8524
+ active: "active";
8525
+ on_leave: "on_leave";
8526
+ offboarding: "offboarding";
8527
+ terminated: "terminated";
8528
+ }>;
8529
+ hiredOn: import("zod").ZodNullable<import("zod").ZodISODate>;
8530
+ terminatedOn: import("zod").ZodNullable<import("zod").ZodISODate>;
8531
+ timezone: import("zod").ZodNullable<import("zod").ZodString>;
8532
+ custom: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
8533
+ personnelHidden: import("zod").ZodDefault<import("zod").ZodBoolean>;
8534
+ erasedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8535
+ createdAt: import("zod").ZodISODateTime;
8536
+ updatedAt: import("zod").ZodISODateTime;
8537
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8538
+ id: import("zod").ZodUUID;
8539
+ }, import("zod/v4/core").$strip>;
8540
+ sensitive: import("zod").ZodObject<{
8541
+ nationalId: import("zod").ZodNullable<import("zod").ZodString>;
8542
+ birthDate: import("zod").ZodNullable<import("zod").ZodISODate>;
8543
+ iban: import("zod").ZodNullable<import("zod").ZodString>;
8544
+ emergencyContact: import("zod").ZodNullable<import("zod").ZodObject<{
8545
+ name: import("zod").ZodString;
8546
+ relationship: import("zod").ZodOptional<import("zod").ZodString>;
8547
+ phone: import("zod").ZodString;
8548
+ }, import("zod/v4/core").$strip>>;
8549
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8550
+ personId: import("zod").ZodUUID;
8551
+ }, import("zod/v4/core").$strip>;
8552
+ employment: import("zod").ZodArray<import("zod").ZodObject<{
8553
+ personId: import("zod").ZodUUID;
8554
+ effectiveFrom: import("zod").ZodISODate;
8555
+ effectiveTo: import("zod").ZodNullable<import("zod").ZodISODate>;
8556
+ orgUnitId: import("zod").ZodNullable<import("zod").ZodUUID>;
8557
+ positionId: import("zod").ZodNullable<import("zod").ZodUUID>;
8558
+ legalEntityId: import("zod").ZodNullable<import("zod").ZodUUID>;
8559
+ costCenterId: import("zod").ZodNullable<import("zod").ZodUUID>;
8560
+ managerPersonId: import("zod").ZodNullable<import("zod").ZodUUID>;
8561
+ employmentType: import("zod").ZodEnum<{
8562
+ full_time: "full_time";
8563
+ part_time: "part_time";
8564
+ contract: "contract";
8565
+ intern: "intern";
8566
+ temporary: "temporary";
8567
+ freelance: "freelance";
8568
+ }>;
8569
+ fte: import("zod").ZodNumber;
8570
+ contractHoursWeek: import("zod").ZodNullable<import("zod").ZodNumber>;
8571
+ reason: import("zod").ZodNullable<import("zod").ZodString>;
8572
+ createdAt: import("zod").ZodISODateTime;
8573
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8574
+ id: import("zod").ZodUUID;
8575
+ }, import("zod/v4/core").$strip>>;
8576
+ offices: import("zod").ZodArray<import("zod").ZodObject<{
8577
+ personId: import("zod").ZodUUID;
8578
+ officeId: import("zod").ZodUUID;
8579
+ isPrimary: import("zod").ZodBoolean;
8580
+ effectiveFrom: import("zod").ZodISODate;
8581
+ effectiveTo: import("zod").ZodNullable<import("zod").ZodISODate>;
8582
+ reason: import("zod").ZodNullable<import("zod").ZodString>;
8583
+ createdAt: import("zod").ZodISODateTime;
8584
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8585
+ id: import("zod").ZodUUID;
8586
+ }, import("zod/v4/core").$strip>>;
8587
+ history: import("zod").ZodArray<import("zod").ZodObject<{
8588
+ id: import("zod").ZodUUID;
8589
+ field: import("zod").ZodString;
8590
+ from: import("zod").ZodUnknown;
8591
+ to: import("zod").ZodUnknown;
8592
+ at: import("zod").ZodISODateTime;
8593
+ actorId: import("zod").ZodNullable<import("zod").ZodUUID>;
8594
+ source: import("zod").ZodString;
8595
+ }, import("zod/v4/core").$strip>>;
8596
+ documents: import("zod").ZodArray<import("zod").ZodObject<{
8597
+ personId: import("zod").ZodUUID;
8598
+ fileId: import("zod").ZodUUID;
8599
+ name: import("zod").ZodString;
8600
+ kind: import("zod").ZodString;
8601
+ issuedOn: import("zod").ZodNullable<import("zod").ZodISODate>;
8602
+ expiresOn: import("zod").ZodNullable<import("zod").ZodISODate>;
8603
+ uploadedBy: import("zod").ZodNullable<import("zod").ZodUUID>;
8604
+ createdAt: import("zod").ZodISODateTime;
8605
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8606
+ id: import("zod").ZodUUID;
8607
+ }, import("zod/v4/core").$strip>>;
8608
+ leave: import("zod").ZodObject<{
8609
+ types: import("zod").ZodArray<import("zod").ZodObject<{
8610
+ key: import("zod").ZodString;
8611
+ name: import("zod").ZodString;
8612
+ paid: import("zod").ZodBoolean;
8613
+ unit: import("zod").ZodEnum<{
8614
+ half_day: "half_day";
8615
+ day: "day";
8616
+ hour: "hour";
8617
+ }>;
8618
+ color: import("zod").ZodNullable<import("zod").ZodString>;
8619
+ icon: import("zod").ZodNullable<import("zod").ZodString>;
8620
+ requiresDocumentAfterDays: import("zod").ZodNullable<import("zod").ZodNumber>;
8621
+ countsWorkingDaysOnly: import("zod").ZodBoolean;
8622
+ allowNegative: import("zod").ZodBoolean;
8623
+ maxNegativeMinutes: import("zod").ZodNumber;
8624
+ order: import("zod").ZodNumber;
8625
+ archivedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8626
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8627
+ id: import("zod").ZodUUID;
8628
+ }, import("zod/v4/core").$strip>>;
8629
+ requests: import("zod").ZodArray<import("zod").ZodObject<{
8630
+ personId: import("zod").ZodUUID;
8631
+ leaveTypeId: import("zod").ZodUUID;
8632
+ startsOn: import("zod").ZodISODate;
8633
+ endsOn: import("zod").ZodISODate;
8634
+ startPart: import("zod").ZodEnum<{
8635
+ full: "full";
8636
+ morning: "morning";
8637
+ afternoon: "afternoon";
8638
+ }>;
8639
+ endPart: import("zod").ZodEnum<{
8640
+ full: "full";
8641
+ morning: "morning";
8642
+ afternoon: "afternoon";
8643
+ }>;
8644
+ hours: import("zod").ZodNullable<import("zod").ZodNumber>;
8645
+ workingDays: import("zod").ZodNumber;
8646
+ minutes: import("zod").ZodNumber;
8647
+ status: import("zod").ZodEnum<{
8648
+ pending: "pending";
8649
+ approved: "approved";
8650
+ rejected: "rejected";
8651
+ cancelled: "cancelled";
8652
+ draft: "draft";
8653
+ withdrawn: "withdrawn";
8654
+ }>;
8655
+ reason: import("zod").ZodNullable<import("zod").ZodString>;
8656
+ documentFileId: import("zod").ZodNullable<import("zod").ZodUUID>;
8657
+ approvalRequestId: import("zod").ZodNullable<import("zod").ZodUUID>;
8658
+ decidedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8659
+ createdAt: import("zod").ZodISODateTime;
8660
+ updatedAt: import("zod").ZodISODateTime;
8661
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8662
+ id: import("zod").ZodUUID;
8663
+ }, import("zod/v4/core").$strip>>;
8664
+ days: import("zod").ZodArray<import("zod").ZodObject<{
8665
+ id: import("zod").ZodUUID;
8666
+ requestId: import("zod").ZodUUID;
8667
+ date: import("zod").ZodISODate;
8668
+ fraction: import("zod").ZodNumber;
8669
+ counted: import("zod").ZodBoolean;
8670
+ status: import("zod").ZodString;
8671
+ }, import("zod/v4/core").$strip>>;
8672
+ ledger: import("zod").ZodArray<import("zod").ZodObject<{
8673
+ personId: import("zod").ZodUUID;
8674
+ leaveTypeId: import("zod").ZodUUID;
8675
+ kind: import("zod").ZodEnum<{
8676
+ grant: "grant";
8677
+ accrual: "accrual";
8678
+ consumption: "consumption";
8679
+ reversal: "reversal";
8680
+ expiry: "expiry";
8681
+ adjustment: "adjustment";
8682
+ carry_in: "carry_in";
8683
+ carry_out: "carry_out";
8684
+ encashment: "encashment";
8685
+ }>;
8686
+ amountMinutes: import("zod").ZodNumber;
8687
+ effectiveOn: import("zod").ZodISODate;
8688
+ periodYear: import("zod").ZodNumber;
8689
+ requestId: import("zod").ZodNullable<import("zod").ZodUUID>;
8690
+ reversesEntryId: import("zod").ZodNullable<import("zod").ZodUUID>;
8691
+ policyHash: import("zod").ZodNullable<import("zod").ZodString>;
8692
+ reason: import("zod").ZodNullable<import("zod").ZodString>;
8693
+ createdBy: import("zod").ZodNullable<import("zod").ZodUUID>;
8694
+ createdAt: import("zod").ZodISODateTime;
8695
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8696
+ id: import("zod").ZodUUID;
8697
+ }, import("zod/v4/core").$strip>>;
8698
+ closingBalanceMinutes: import("zod").ZodNumber;
8699
+ }, import("zod/v4/core").$strip>;
8700
+ attendance: import("zod").ZodObject<{
8701
+ punches: import("zod").ZodArray<import("zod").ZodObject<{
8702
+ personId: import("zod").ZodUUID;
8703
+ direction: import("zod").ZodEnum<{
8704
+ out: "out";
8705
+ in: "in";
8706
+ break_start: "break_start";
8707
+ break_end: "break_end";
8708
+ }>;
8709
+ at: import("zod").ZodISODateTime;
8710
+ clientReportedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8711
+ skewMs: import("zod").ZodNullable<import("zod").ZodNumber>;
8712
+ businessDate: import("zod").ZodISODate;
8713
+ timezone: import("zod").ZodString;
8714
+ method: import("zod").ZodEnum<{
8715
+ web: "web";
8716
+ mobile: "mobile";
8717
+ kiosk: "kiosk";
8718
+ qr: "qr";
8719
+ device: "device";
8720
+ import: "import";
8721
+ manual: "manual";
8722
+ auto: "auto";
8723
+ }>;
8724
+ officeId: import("zod").ZodNullable<import("zod").ZodUUID>;
8725
+ deviceId: import("zod").ZodNullable<import("zod").ZodUUID>;
8726
+ geo: import("zod").ZodNullable<import("zod").ZodObject<{
8727
+ lat: import("zod").ZodNumber;
8728
+ lng: import("zod").ZodNumber;
8729
+ accuracyM: import("zod").ZodOptional<import("zod").ZodNumber>;
8730
+ }, import("zod/v4/core").$strip>>;
8731
+ trust: import("zod").ZodEnum<{
8732
+ trusted: "trusted";
8733
+ claimed: "claimed";
8734
+ disputed: "disputed";
8735
+ }>;
8736
+ voidedByPunchId: import("zod").ZodNullable<import("zod").ZodUUID>;
8737
+ note: import("zod").ZodNullable<import("zod").ZodString>;
8738
+ createdAt: import("zod").ZodISODateTime;
8739
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8740
+ id: import("zod").ZodUUID;
8741
+ }, import("zod/v4/core").$strip>>;
8742
+ days: import("zod").ZodArray<import("zod").ZodObject<{
8743
+ personId: import("zod").ZodUUID;
8744
+ businessDate: import("zod").ZodISODate;
8745
+ scheduledMinutes: import("zod").ZodNumber;
8746
+ workedMinutes: import("zod").ZodNumber;
8747
+ breakMinutes: import("zod").ZodNumber;
8748
+ overtimeMinutes: import("zod").ZodNumber;
8749
+ beyondCapMinutes: import("zod").ZodNullable<import("zod").ZodNumber>;
8750
+ lateMinutes: import("zod").ZodNumber;
8751
+ earlyLeaveMinutes: import("zod").ZodNumber;
8752
+ status: import("zod").ZodEnum<{
8753
+ leave: "leave";
8754
+ pending: "pending";
8755
+ present: "present";
8756
+ absent: "absent";
8757
+ holiday: "holiday";
8758
+ weekend: "weekend";
8759
+ partial: "partial";
8760
+ }>;
8761
+ leaveRequestId: import("zod").ZodNullable<import("zod").ZodUUID>;
8762
+ anomalies: import("zod").ZodArray<import("zod").ZodString>;
8763
+ firstIn: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8764
+ lastOut: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8765
+ policyHash: import("zod").ZodNullable<import("zod").ZodString>;
8766
+ locked: import("zod").ZodBoolean;
8767
+ computedAt: import("zod").ZodISODateTime;
8768
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8769
+ id: import("zod").ZodUUID;
8770
+ }, import("zod/v4/core").$strip>>;
8771
+ }, import("zod/v4/core").$strip>;
8772
+ regularizations: import("zod").ZodArray<import("zod").ZodObject<{
8773
+ personId: import("zod").ZodUUID;
8774
+ businessDate: import("zod").ZodISODate;
8775
+ punchId: import("zod").ZodNullable<import("zod").ZodUUID>;
8776
+ proposed: import("zod").ZodArray<import("zod").ZodObject<{
8777
+ direction: import("zod").ZodEnum<{
8778
+ out: "out";
8779
+ in: "in";
8780
+ break_start: "break_start";
8781
+ break_end: "break_end";
8782
+ }>;
8783
+ at: import("zod").ZodISODateTime;
8784
+ }, import("zod/v4/core").$strip>>;
8785
+ reason: import("zod").ZodString;
8786
+ status: import("zod").ZodEnum<{
8787
+ pending: "pending";
8788
+ approved: "approved";
8789
+ rejected: "rejected";
8790
+ cancelled: "cancelled";
8791
+ }>;
8792
+ approvalRequestId: import("zod").ZodNullable<import("zod").ZodUUID>;
8793
+ appliedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8794
+ createdAt: import("zod").ZodISODateTime;
8795
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8796
+ id: import("zod").ZodUUID;
8797
+ }, import("zod/v4/core").$strip>>;
8798
+ approvals: import("zod").ZodObject<{
8799
+ raised: import("zod").ZodArray<import("zod").ZodObject<{
8800
+ subjectType: import("zod").ZodEnum<{
8801
+ leave: "leave";
8802
+ regularization: "regularization";
8803
+ overtime: "overtime";
8804
+ timesheet: "timesheet";
8805
+ shift_swap: "shift_swap";
8806
+ }>;
8807
+ subjectId: import("zod").ZodUUID;
8808
+ summary: import("zod").ZodString;
8809
+ summaryParams: import("zod").ZodNullable<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodNumber]>>>;
8810
+ status: import("zod").ZodEnum<{
8811
+ pending: "pending";
8812
+ approved: "approved";
8813
+ rejected: "rejected";
8814
+ cancelled: "cancelled";
8815
+ }>;
8816
+ currentStep: import("zod").ZodNumber;
8817
+ requestedBy: import("zod").ZodNullable<import("zod").ZodUUID>;
8818
+ requesterPersonId: import("zod").ZodNullable<import("zod").ZodUUID>;
8819
+ requesterName: import("zod").ZodNullable<import("zod").ZodString>;
8820
+ requestedAt: import("zod").ZodISODateTime;
8821
+ decidedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8822
+ steps: import("zod").ZodArray<import("zod").ZodObject<{
8823
+ id: import("zod").ZodUUID;
8824
+ requestId: import("zod").ZodUUID;
8825
+ stepIndex: import("zod").ZodNumber;
8826
+ name: import("zod").ZodString;
8827
+ mode: import("zod").ZodEnum<{
8828
+ any: "any";
8829
+ all: "all";
8830
+ quorum: "quorum";
8831
+ }>;
8832
+ minApprovals: import("zod").ZodNumber;
8833
+ approverIds: import("zod").ZodArray<import("zod").ZodUUID>;
8834
+ status: import("zod").ZodEnum<{
8835
+ pending: "pending";
8836
+ approved: "approved";
8837
+ rejected: "rejected";
8838
+ cancelled: "cancelled";
8839
+ }>;
8840
+ dueAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8841
+ escalatedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8842
+ decisions: import("zod").ZodArray<import("zod").ZodObject<{
8843
+ id: import("zod").ZodUUID;
8844
+ stepId: import("zod").ZodUUID;
8845
+ approverId: import("zod").ZodUUID;
8846
+ onBehalfOfId: import("zod").ZodNullable<import("zod").ZodUUID>;
8847
+ decision: import("zod").ZodEnum<{
8848
+ approve: "approve";
8849
+ reject: "reject";
8850
+ }>;
8851
+ comment: import("zod").ZodNullable<import("zod").ZodString>;
8852
+ at: import("zod").ZodISODateTime;
8853
+ }, import("zod/v4/core").$strip>>;
8854
+ }, import("zod/v4/core").$strip>>;
8855
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8856
+ id: import("zod").ZodUUID;
8857
+ }, import("zod/v4/core").$strip>>;
8858
+ approverOn: import("zod").ZodArray<import("zod").ZodObject<{
8859
+ id: import("zod").ZodUUID;
8860
+ requestId: import("zod").ZodUUID;
8861
+ stepIndex: import("zod").ZodNumber;
8862
+ name: import("zod").ZodString;
8863
+ mode: import("zod").ZodEnum<{
8864
+ any: "any";
8865
+ all: "all";
8866
+ quorum: "quorum";
8867
+ }>;
8868
+ minApprovals: import("zod").ZodNumber;
8869
+ approverIds: import("zod").ZodArray<import("zod").ZodUUID>;
8870
+ status: import("zod").ZodEnum<{
8871
+ pending: "pending";
8872
+ approved: "approved";
8873
+ rejected: "rejected";
8874
+ cancelled: "cancelled";
8875
+ }>;
8876
+ dueAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8877
+ escalatedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
8878
+ decisions: import("zod").ZodArray<import("zod").ZodObject<{
8879
+ id: import("zod").ZodUUID;
8880
+ stepId: import("zod").ZodUUID;
8881
+ approverId: import("zod").ZodUUID;
8882
+ onBehalfOfId: import("zod").ZodNullable<import("zod").ZodUUID>;
8883
+ decision: import("zod").ZodEnum<{
8884
+ approve: "approve";
8885
+ reject: "reject";
8886
+ }>;
8887
+ comment: import("zod").ZodNullable<import("zod").ZodString>;
8888
+ at: import("zod").ZodISODateTime;
8889
+ }, import("zod/v4/core").$strip>>;
8890
+ }, import("zod/v4/core").$strip>>;
8891
+ decisions: import("zod").ZodArray<import("zod").ZodObject<{
8892
+ id: import("zod").ZodUUID;
8893
+ stepId: import("zod").ZodUUID;
8894
+ approverId: import("zod").ZodUUID;
8895
+ onBehalfOfId: import("zod").ZodNullable<import("zod").ZodUUID>;
8896
+ decision: import("zod").ZodEnum<{
8897
+ approve: "approve";
8898
+ reject: "reject";
8899
+ }>;
8900
+ comment: import("zod").ZodNullable<import("zod").ZodString>;
8901
+ at: import("zod").ZodISODateTime;
8902
+ }, import("zod/v4/core").$strip>>;
8903
+ }, import("zod/v4/core").$strip>;
8904
+ delegations: import("zod").ZodObject<{
8905
+ given: import("zod").ZodArray<import("zod").ZodObject<{
8906
+ fromPersonId: import("zod").ZodUUID;
8907
+ toPersonId: import("zod").ZodUUID;
8908
+ subjectType: import("zod").ZodNullable<import("zod").ZodEnum<{
8909
+ leave: "leave";
8910
+ regularization: "regularization";
8911
+ overtime: "overtime";
8912
+ timesheet: "timesheet";
8913
+ shift_swap: "shift_swap";
8914
+ }>>;
8915
+ startsOn: import("zod").ZodISODate;
8916
+ endsOn: import("zod").ZodISODate;
8917
+ reason: import("zod").ZodNullable<import("zod").ZodString>;
8918
+ createdAt: import("zod").ZodISODateTime;
8919
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8920
+ id: import("zod").ZodUUID;
8921
+ }, import("zod/v4/core").$strip>>;
8922
+ received: import("zod").ZodArray<import("zod").ZodObject<{
8923
+ fromPersonId: import("zod").ZodUUID;
8924
+ toPersonId: import("zod").ZodUUID;
8925
+ subjectType: import("zod").ZodNullable<import("zod").ZodEnum<{
8926
+ leave: "leave";
8927
+ regularization: "regularization";
8928
+ overtime: "overtime";
8929
+ timesheet: "timesheet";
8930
+ shift_swap: "shift_swap";
8931
+ }>>;
8932
+ startsOn: import("zod").ZodISODate;
8933
+ endsOn: import("zod").ZodISODate;
8934
+ reason: import("zod").ZodNullable<import("zod").ZodString>;
8935
+ createdAt: import("zod").ZodISODateTime;
8936
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
8937
+ id: import("zod").ZodUUID;
8938
+ }, import("zod/v4/core").$strip>>;
8939
+ }, import("zod/v4/core").$strip>;
8940
+ policiesInForce: import("zod").ZodArray<import("zod").ZodObject<{
8941
+ kind: import("zod").ZodEnum<{
8942
+ overtime: "overtime";
8943
+ accrual: "accrual";
8944
+ carry_forward: "carry_forward";
8945
+ rounding: "rounding";
8946
+ working_time: "working_time";
8947
+ }>;
8948
+ policyId: import("zod").ZodNullable<import("zod").ZodUUID>;
8949
+ policyName: import("zod").ZodNullable<import("zod").ZodString>;
8950
+ config: import("zod").ZodNullable<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>;
8951
+ from: import("zod").ZodNullable<import("zod").ZodEnum<{
8952
+ person: "person";
8953
+ office: "office";
8954
+ legal_entity: "legal_entity";
8955
+ org_unit: "org_unit";
8956
+ position: "position";
8957
+ workspace: "workspace";
8958
+ }>>;
8959
+ fromSubjectId: import("zod").ZodNullable<import("zod").ZodUUID>;
8960
+ }, import("zod/v4/core").$strip>>;
8961
+ accessLog: import("zod").ZodArray<import("zod").ZodObject<{
8962
+ id: import("zod").ZodUUID;
8963
+ personId: import("zod").ZodUUID;
8964
+ actorUserId: import("zod").ZodUUID;
8965
+ actorPersonId: import("zod").ZodNullable<import("zod").ZodUUID>;
8966
+ fields: import("zod").ZodArray<import("zod").ZodString>;
8967
+ purpose: import("zod").ZodNullable<import("zod").ZodString>;
8968
+ via: import("zod").ZodEnum<{
8969
+ ui: "ui";
8970
+ api: "api";
8971
+ export: "export";
8972
+ }>;
8973
+ at: import("zod").ZodISODateTime;
8974
+ }, import("zod/v4/core").$strip>>;
8975
+ }, import("zod/v4/core").$strip>, import("@orpc/server").MergedErrorMap<Record<never, never>, import("@orpc/server").MergedErrorMap<Record<never, never>, {
8976
+ BAD_REQUEST: {
8977
+ data: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
8978
+ };
8979
+ UNAUTHORIZED: {};
8980
+ FORBIDDEN: {
8981
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
8982
+ permission: import("zod").ZodOptional<import("zod").ZodString>;
8983
+ }, import("zod/v4/core").$strip>>;
8984
+ };
8985
+ NOT_FOUND: {};
8986
+ CONFLICT: {
8987
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
8988
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
8989
+ }, import("zod/v4/core").$strip>>;
8990
+ };
8991
+ RATE_LIMITED: {};
8992
+ MODULE_DISABLED: {
8993
+ data: import("zod").ZodObject<{
8994
+ module: import("zod").ZodString;
8995
+ }, import("zod/v4/core").$strip>;
8996
+ };
8997
+ }>>, Record<never, never>>;
8998
+ erase: import("@orpc/server").Procedure<import("@orpc/server").MergedInitialContext<RequestContext & Record<never, never>, RequestContext & Record<never, never> & Omit<RequestContext & Record<never, never>, keyof RequestContext> & Omit<RequestContext & Record<never, never>, "workspaceId" | "requestId" | "kernel" | "principal" | "ip" | "headers">, RequestContext>, Omit<import("@orpc/server").MergedCurrentContext<RequestContext, {
8999
+ workspaceId: string;
9000
+ kernel: Kernel;
9001
+ principal: {
9002
+ kind: "service" | "user" | "api_key" | "anonymous";
9003
+ userId: (string & import("zod").$brand<"UserId">) | null;
9004
+ email: string | null;
9005
+ name: string | null;
9006
+ locale: "en" | "fa" | "ar" | "de";
9007
+ instanceAdmin: boolean;
9008
+ service: string | null;
9009
+ memberships: {
9010
+ workspaceId: string & import("zod").$brand<"WorkspaceId">;
9011
+ role: "owner" | "admin" | "member" | "guest";
9012
+ roleIds: string[];
9013
+ groupIds: string[];
9014
+ status: "active" | "invited" | "suspended";
9015
+ }[];
9016
+ permissionVersion: number;
9017
+ };
9018
+ requestId: string;
9019
+ ip: string;
9020
+ headers: Record<string, string | string[] | undefined>;
9021
+ }>, never> & Record<never, never>, import("zod").ZodObject<{
9022
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
9023
+ personId: import("zod").ZodUUID;
9024
+ dryRun: import("zod").ZodDefault<import("zod").ZodBoolean>;
9025
+ reason: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
9026
+ keepNationalIdForAudit: import("zod").ZodDefault<import("zod").ZodBoolean>;
9027
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
9028
+ personId: import("zod").ZodUUID;
9029
+ dryRun: import("zod").ZodBoolean;
9030
+ erasedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
9031
+ displayName: import("zod").ZodString;
9032
+ redacted: import("zod").ZodArray<import("zod").ZodObject<{
9033
+ class: import("zod").ZodEnum<{
9034
+ sensitive: "sensitive";
9035
+ employment: "employment";
9036
+ approvals: "approvals";
9037
+ attendance: "attendance";
9038
+ documents: "documents";
9039
+ punches: "punches";
9040
+ identity: "identity";
9041
+ history: "history";
9042
+ leaveRequests: "leaveRequests";
9043
+ leaveLedger: "leaveLedger";
9044
+ officeAssignments: "officeAssignments";
9045
+ approvalDecisions: "approvalDecisions";
9046
+ regularizations: "regularizations";
9047
+ delegations: "delegations";
9048
+ headship: "headship";
9049
+ }>;
9050
+ table: import("zod").ZodString;
9051
+ rows: import("zod").ZodNumber;
9052
+ columns: import("zod").ZodArray<import("zod").ZodString>;
9053
+ }, import("zod/v4/core").$strip>>;
9054
+ kept: import("zod").ZodArray<import("zod").ZodObject<{
9055
+ class: import("zod").ZodEnum<{
9056
+ sensitive: "sensitive";
9057
+ employment: "employment";
9058
+ approvals: "approvals";
9059
+ attendance: "attendance";
9060
+ documents: "documents";
9061
+ punches: "punches";
9062
+ identity: "identity";
9063
+ history: "history";
9064
+ leaveRequests: "leaveRequests";
9065
+ leaveLedger: "leaveLedger";
9066
+ officeAssignments: "officeAssignments";
9067
+ approvalDecisions: "approvalDecisions";
9068
+ regularizations: "regularizations";
9069
+ delegations: "delegations";
9070
+ headship: "headship";
9071
+ }>;
9072
+ table: import("zod").ZodString;
9073
+ rows: import("zod").ZodNumber;
9074
+ basis: import("zod").ZodEnum<{
9075
+ payRecord: "payRecord";
9076
+ auditTrail: "auditTrail";
9077
+ retentionHorizon: "retentionHorizon";
9078
+ notRemovable: "notRemovable";
9079
+ anotherPersonsRecord: "anotherPersonsRecord";
9080
+ }>;
9081
+ retentionDays: import("zod").ZodNullable<import("zod").ZodNumber>;
9082
+ }, import("zod/v4/core").$strip>>;
9083
+ caveats: import("zod").ZodArray<import("zod").ZodEnum<{
9084
+ documentFilesRemain: "documentFilesRemain";
9085
+ photoFileOrphaned: "photoFileOrphaned";
9086
+ leaveDocumentFilesRemain: "leaveDocumentFilesRemain";
9087
+ nationalIdKeptForAudit: "nationalIdKeptForAudit";
9088
+ actorHistoryKept: "actorHistoryKept";
9089
+ lockedPeriodUntouched: "lockedPeriodUntouched";
9090
+ }>>;
9091
+ filesRemaining: import("zod").ZodArray<import("zod").ZodUUID>;
9092
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
9093
+ }, import("zod/v4/core").$strip>, import("@orpc/server").MergedErrorMap<Record<never, never>, import("@orpc/server").MergedErrorMap<Record<never, never>, {
9094
+ BAD_REQUEST: {
9095
+ data: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
9096
+ };
9097
+ UNAUTHORIZED: {};
9098
+ FORBIDDEN: {
9099
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
9100
+ permission: import("zod").ZodOptional<import("zod").ZodString>;
9101
+ }, import("zod/v4/core").$strip>>;
9102
+ };
9103
+ NOT_FOUND: {};
9104
+ CONFLICT: {
9105
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
9106
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
9107
+ }, import("zod/v4/core").$strip>>;
9108
+ };
9109
+ RATE_LIMITED: {};
9110
+ MODULE_DISABLED: {
9111
+ data: import("zod").ZodObject<{
9112
+ module: import("zod").ZodString;
9113
+ }, import("zod/v4/core").$strip>;
9114
+ };
9115
+ }>>, Record<never, never>>;
9116
+ accessLog: {
9117
+ list: import("@orpc/server").Procedure<import("@orpc/server").MergedInitialContext<RequestContext & Record<never, never>, RequestContext & Record<never, never> & Omit<RequestContext & Record<never, never>, keyof RequestContext>, RequestContext>, Omit<RequestContext, "workspaceId" | "requestId" | "kernel" | "principal" | "ip" | "headers"> & {
9118
+ workspaceId: string;
9119
+ kernel: Kernel;
9120
+ principal: {
9121
+ kind: "service" | "user" | "api_key" | "anonymous";
9122
+ userId: (string & import("zod").$brand<"UserId">) | null;
9123
+ email: string | null;
9124
+ name: string | null;
9125
+ locale: "en" | "fa" | "ar" | "de";
9126
+ instanceAdmin: boolean;
9127
+ service: string | null;
9128
+ memberships: {
9129
+ workspaceId: string & import("zod").$brand<"WorkspaceId">;
9130
+ role: "owner" | "admin" | "member" | "guest";
9131
+ roleIds: string[];
9132
+ groupIds: string[];
9133
+ status: "active" | "invited" | "suspended";
9134
+ }[];
9135
+ permissionVersion: number;
9136
+ };
9137
+ requestId: string;
9138
+ ip: string;
9139
+ headers: Record<string, string | string[] | undefined>;
9140
+ }, import("zod").ZodObject<{
9141
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
9142
+ personId: import("zod").ZodOptional<import("zod").ZodUUID>;
9143
+ actorUserId: import("zod").ZodOptional<import("zod").ZodUUID>;
9144
+ cursor: import("zod").ZodOptional<import("zod").ZodString>;
9145
+ limit: import("zod").ZodDefault<import("zod").ZodNumber>;
9146
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
9147
+ items: import("zod").ZodArray<import("zod").ZodObject<{
9148
+ id: import("zod").ZodUUID;
9149
+ personId: import("zod").ZodUUID;
9150
+ actorUserId: import("zod").ZodUUID;
9151
+ actorPersonId: import("zod").ZodNullable<import("zod").ZodUUID>;
9152
+ fields: import("zod").ZodArray<import("zod").ZodString>;
9153
+ purpose: import("zod").ZodNullable<import("zod").ZodString>;
9154
+ via: import("zod").ZodEnum<{
9155
+ ui: "ui";
9156
+ api: "api";
9157
+ export: "export";
9158
+ }>;
9159
+ at: import("zod").ZodISODateTime;
9160
+ }, import("zod/v4/core").$strip>>;
9161
+ nextCursor: import("zod").ZodNullable<import("zod").ZodString>;
9162
+ total: import("zod").ZodOptional<import("zod").ZodNumber>;
9163
+ }, import("zod/v4/core").$strip>, import("@orpc/server").MergedErrorMap<Record<never, never>, import("@orpc/server").MergedErrorMap<Record<never, never>, {
9164
+ BAD_REQUEST: {
9165
+ data: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
9166
+ };
9167
+ UNAUTHORIZED: {};
9168
+ FORBIDDEN: {
9169
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
9170
+ permission: import("zod").ZodOptional<import("zod").ZodString>;
9171
+ }, import("zod/v4/core").$strip>>;
9172
+ };
9173
+ NOT_FOUND: {};
9174
+ CONFLICT: {
9175
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
9176
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
9177
+ }, import("zod/v4/core").$strip>>;
9178
+ };
9179
+ RATE_LIMITED: {};
9180
+ MODULE_DISABLED: {
9181
+ data: import("zod").ZodObject<{
9182
+ module: import("zod").ZodString;
9183
+ }, import("zod/v4/core").$strip>;
9184
+ };
9185
+ }>>, Record<never, never>>;
9186
+ };
9187
+ retention: {
9188
+ get: import("@orpc/server").Procedure<import("@orpc/server").MergedInitialContext<RequestContext & Record<never, never>, RequestContext & Record<never, never> & Omit<RequestContext & Record<never, never>, keyof RequestContext> & Omit<RequestContext & Record<never, never>, "workspaceId" | "requestId" | "kernel" | "principal" | "ip" | "headers">, RequestContext>, Omit<import("@orpc/server").MergedCurrentContext<RequestContext, {
9189
+ workspaceId: string;
9190
+ kernel: Kernel;
9191
+ principal: {
9192
+ kind: "service" | "user" | "api_key" | "anonymous";
9193
+ userId: (string & import("zod").$brand<"UserId">) | null;
9194
+ email: string | null;
9195
+ name: string | null;
9196
+ locale: "en" | "fa" | "ar" | "de";
9197
+ instanceAdmin: boolean;
9198
+ service: string | null;
9199
+ memberships: {
9200
+ workspaceId: string & import("zod").$brand<"WorkspaceId">;
9201
+ role: "owner" | "admin" | "member" | "guest";
9202
+ roleIds: string[];
9203
+ groupIds: string[];
9204
+ status: "active" | "invited" | "suspended";
9205
+ }[];
9206
+ permissionVersion: number;
9207
+ };
9208
+ requestId: string;
9209
+ ip: string;
9210
+ headers: Record<string, string | string[] | undefined>;
9211
+ }>, never> & Record<never, never>, import("zod").ZodObject<{
9212
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
9213
+ withCounts: import("zod").ZodDefault<import("zod").ZodBoolean>;
9214
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
9215
+ classes: import("zod").ZodArray<import("zod").ZodObject<{
9216
+ class: import("zod").ZodEnum<{
9217
+ leave: "leave";
9218
+ punchDetail: "punchDetail";
9219
+ punches: "punches";
9220
+ attendanceDays: "attendanceDays";
9221
+ personHistory: "personHistory";
9222
+ personDocuments: "personDocuments";
9223
+ terminatedPeople: "terminatedPeople";
9224
+ sensitiveAccessLog: "sensitiveAccessLog";
9225
+ }>;
9226
+ days: import("zod").ZodNullable<import("zod").ZodNumber>;
9227
+ dueNow: import("zod").ZodNullable<import("zod").ZodNumber>;
9228
+ }, import("zod/v4/core").$strip>>;
9229
+ updatedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
9230
+ updatedBy: import("zod").ZodNullable<import("zod").ZodUUID>;
9231
+ sweepEnabled: import("zod").ZodLiteral<false>;
9232
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
9233
+ }, import("zod/v4/core").$strip>, import("@orpc/server").MergedErrorMap<Record<never, never>, import("@orpc/server").MergedErrorMap<Record<never, never>, {
9234
+ BAD_REQUEST: {
9235
+ data: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
9236
+ };
9237
+ UNAUTHORIZED: {};
9238
+ FORBIDDEN: {
9239
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
9240
+ permission: import("zod").ZodOptional<import("zod").ZodString>;
9241
+ }, import("zod/v4/core").$strip>>;
9242
+ };
9243
+ NOT_FOUND: {};
9244
+ CONFLICT: {
9245
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
9246
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
9247
+ }, import("zod/v4/core").$strip>>;
9248
+ };
9249
+ RATE_LIMITED: {};
9250
+ MODULE_DISABLED: {
9251
+ data: import("zod").ZodObject<{
9252
+ module: import("zod").ZodString;
9253
+ }, import("zod/v4/core").$strip>;
9254
+ };
9255
+ }>>, Record<never, never>>;
9256
+ set: import("@orpc/server").Procedure<import("@orpc/server").MergedInitialContext<RequestContext & Record<never, never>, RequestContext & Record<never, never> & Omit<RequestContext & Record<never, never>, keyof RequestContext> & Omit<RequestContext & Record<never, never>, "workspaceId" | "requestId" | "kernel" | "principal" | "ip" | "headers">, RequestContext>, Omit<import("@orpc/server").MergedCurrentContext<RequestContext, {
9257
+ workspaceId: string;
9258
+ kernel: Kernel;
9259
+ principal: {
9260
+ kind: "service" | "user" | "api_key" | "anonymous";
9261
+ userId: (string & import("zod").$brand<"UserId">) | null;
9262
+ email: string | null;
9263
+ name: string | null;
9264
+ locale: "en" | "fa" | "ar" | "de";
9265
+ instanceAdmin: boolean;
9266
+ service: string | null;
9267
+ memberships: {
9268
+ workspaceId: string & import("zod").$brand<"WorkspaceId">;
9269
+ role: "owner" | "admin" | "member" | "guest";
9270
+ roleIds: string[];
9271
+ groupIds: string[];
9272
+ status: "active" | "invited" | "suspended";
9273
+ }[];
9274
+ permissionVersion: number;
9275
+ };
9276
+ requestId: string;
9277
+ ip: string;
9278
+ headers: Record<string, string | string[] | undefined>;
9279
+ }>, never> & Record<never, never>, import("zod").ZodObject<{
9280
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
9281
+ retention: import("zod").ZodObject<{
9282
+ punchDetail: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodNumber>>>;
9283
+ punches: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodNumber>>>;
9284
+ attendanceDays: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodNumber>>>;
9285
+ leave: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodNumber>>>;
9286
+ personHistory: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodNumber>>>;
9287
+ personDocuments: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodNumber>>>;
9288
+ terminatedPeople: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodNumber>>>;
9289
+ sensitiveAccessLog: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodNumber>>>;
9290
+ }, import("zod/v4/core").$strip>;
9291
+ }, import("zod/v4/core").$strip>, import("zod").ZodObject<{
9292
+ classes: import("zod").ZodArray<import("zod").ZodObject<{
9293
+ class: import("zod").ZodEnum<{
9294
+ leave: "leave";
9295
+ punchDetail: "punchDetail";
9296
+ punches: "punches";
9297
+ attendanceDays: "attendanceDays";
9298
+ personHistory: "personHistory";
9299
+ personDocuments: "personDocuments";
9300
+ terminatedPeople: "terminatedPeople";
9301
+ sensitiveAccessLog: "sensitiveAccessLog";
9302
+ }>;
9303
+ days: import("zod").ZodNullable<import("zod").ZodNumber>;
9304
+ dueNow: import("zod").ZodNullable<import("zod").ZodNumber>;
9305
+ }, import("zod/v4/core").$strip>>;
9306
+ updatedAt: import("zod").ZodNullable<import("zod").ZodISODateTime>;
9307
+ updatedBy: import("zod").ZodNullable<import("zod").ZodUUID>;
9308
+ sweepEnabled: import("zod").ZodLiteral<false>;
9309
+ workspaceId: import("zod/v4/core").$ZodBranded<import("zod").ZodUUID, "WorkspaceId", "out">;
9310
+ }, import("zod/v4/core").$strip>, import("@orpc/server").MergedErrorMap<Record<never, never>, import("@orpc/server").MergedErrorMap<Record<never, never>, {
9311
+ BAD_REQUEST: {
9312
+ data: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>>>;
9313
+ };
9314
+ UNAUTHORIZED: {};
9315
+ FORBIDDEN: {
9316
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
9317
+ permission: import("zod").ZodOptional<import("zod").ZodString>;
9318
+ }, import("zod/v4/core").$strip>>;
9319
+ };
9320
+ NOT_FOUND: {};
9321
+ CONFLICT: {
9322
+ data: import("zod").ZodOptional<import("zod").ZodObject<{
9323
+ reason: import("zod").ZodOptional<import("zod").ZodString>;
9324
+ }, import("zod/v4/core").$strip>>;
9325
+ };
9326
+ RATE_LIMITED: {};
9327
+ MODULE_DISABLED: {
9328
+ data: import("zod").ZodObject<{
9329
+ module: import("zod").ZodString;
9330
+ }, import("zod/v4/core").$strip>;
9331
+ };
9332
+ }>>, Record<never, never>>;
9333
+ };
9334
+ };
8342
9335
  };
8343
9336
  //# sourceMappingURL=router.d.ts.map