@kernhq/module-hr 0.17.1 → 0.18.1

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 (36) hide show
  1. package/dist/contract/capabilities.d.ts.map +1 -1
  2. package/dist/contract/capabilities.js +10 -0
  3. package/dist/contract/capabilities.js.map +1 -1
  4. package/dist/contract/index.d.ts +1 -0
  5. package/dist/contract/index.d.ts.map +1 -1
  6. package/dist/contract/index.js +1 -0
  7. package/dist/contract/index.js.map +1 -1
  8. package/dist/contract/permissions.d.ts +8 -0
  9. package/dist/contract/permissions.d.ts.map +1 -1
  10. package/dist/contract/permissions.js +25 -0
  11. package/dist/contract/permissions.js.map +1 -1
  12. package/dist/contract/reports.d.ts +505 -0
  13. package/dist/contract/reports.d.ts.map +1 -0
  14. package/dist/contract/reports.js +328 -0
  15. package/dist/contract/reports.js.map +1 -0
  16. package/dist/contract/router.d.ts +422 -0
  17. package/dist/contract/router.d.ts.map +1 -1
  18. package/dist/contract/router.js +97 -0
  19. package/dist/contract/router.js.map +1 -1
  20. package/dist/server/router.d.ts +488 -0
  21. package/dist/server/router.d.ts.map +1 -1
  22. package/dist/server/router.js +439 -17
  23. package/dist/server/router.js.map +1 -1
  24. package/dist/server/services/ledger.d.ts.map +1 -1
  25. package/dist/server/services/ledger.js +27 -3
  26. package/dist/server/services/ledger.js.map +1 -1
  27. package/dist/server/services/reports.d.ts +321 -0
  28. package/dist/server/services/reports.d.ts.map +1 -0
  29. package/dist/server/services/reports.js +634 -0
  30. package/dist/server/services/reports.js.map +1 -0
  31. package/package.json +1 -1
  32. package/src/contract/capabilities.ts +10 -0
  33. package/src/contract/index.ts +1 -0
  34. package/src/contract/permissions.ts +27 -0
  35. package/src/contract/reports.ts +373 -0
  36. package/src/contract/router.ts +110 -0
@@ -0,0 +1,505 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Four numbers a company acts on, and the three rules that make them safe to act on.
4
+ *
5
+ * **1. A total states its own denominator.** "47 hours of overtime" means nothing on its own; "47
6
+ * hours · 12 of 38 people · 1–31 October · Istanbul office" is a fact. Every report here carries a
7
+ * `ReportHeader` saying who it counted, over what range, under which slice, and — because two
8
+ * managers must never read the same title over different populations — **which permission produced
9
+ * it**. A report is a separate grant, not a narrowing: a reader without the key gets nothing rather
10
+ * than a quieter number.
11
+ *
12
+ * **2. Unknown is not zero.** Every figure a person's data cannot answer is `null` here, and a
13
+ * screen renders `null` as an em dash. Never 0%, never "0 days absent". The three that bite:
14
+ * somebody with no schedule has no attendance percentage (the denominator is zero, not the
15
+ * numerator); an office with no calendar attached has no expected working days (Mon–Fri would be an
16
+ * assumption this module does not make, and it is wrong for every Gulf and Iranian office); and
17
+ * `beyondCapMinutes` is null where **no cap was in force**, which is a different fact from a cap
18
+ * that nothing exceeded.
19
+ *
20
+ * **3. Nothing here is projected or entitled.** No year-end balance, no "at this rate you will pass
21
+ * the annual ceiling in November", no allowance remaining. All three need either a policy that may
22
+ * not exist or a workspace day length this module does not hold — `MINUTES_PER_DAY` is a constant,
23
+ * so a `day`-unit figure is an 8-hour day whatever the leave type is called. `dayLengthMinutes` on
24
+ * the balance report says so on its face rather than leaving a reader to assume their own.
25
+ *
26
+ * The reports read; nothing here recomputes a day sheet. A "refresh" on a reports page is a write
27
+ * into a month payroll may already have filed, and `AttendanceService.recomputeDay` is the only
28
+ * thing entitled to decide whether a day may move.
29
+ */
30
+ /**
31
+ * The longest range a report may cover, in days.
32
+ *
33
+ * A year, because an annual overtime figure against a statutory ceiling is a real question and a
34
+ * two-year one is not. An unsliced attendance or overtime report is a single grouped aggregate, so
35
+ * the length costs the database and nothing else.
36
+ */
37
+ export declare const MAX_REPORT_DAYS = 366;
38
+ /**
39
+ * The longest range a report may cover once it is **sliced**, and the range the absence report is
40
+ * held to whatever it is sliced by.
41
+ *
42
+ * Both walk the resolution ladder once per day in the range, because a number has to be attributed
43
+ * to the office in force on the day it describes rather than the one somebody sits in today. That
44
+ * is a handful of small indexed queries per day; a quarter is fine and a year is not. The absence
45
+ * report pays it unsliced as well, because a person's expected days come from their office's
46
+ * calendar and that is the same walk.
47
+ *
48
+ * The honest fix is a range-aware batch in `ResolveService` — one walk that answers a span rather
49
+ * than a date. Until that exists, this is the cap rather than a slow report nobody can cancel.
50
+ */
51
+ export declare const MAX_SLICED_REPORT_DAYS = 92;
52
+ /**
53
+ * The most person-days a per-day report will resolve before refusing.
54
+ *
55
+ * `people × days`, and it is a refusal with both numbers in it rather than a timeout: a report that
56
+ * quietly takes four minutes is worse than one that says "1,900 people over 92 days is 174,800
57
+ * person-days — ask for one office, or a shorter range".
58
+ */
59
+ export declare const MAX_PERSON_DAYS = 60000;
60
+ /**
61
+ * How a report was narrowed.
62
+ *
63
+ * `workspace` is everybody; `office` and `legal_entity` are what the resolution ladder can answer
64
+ * about a person on a date. **There is no `cost_center`**, and the omission is deliberate:
65
+ * `PersonResolution` carries `primaryOfficeId`, `legalEntityId` and `orgUnitId` and no cost centre,
66
+ * so a cost-centre slice would have to join `employments` inside a report handler — a second
67
+ * resolution ladder, which is the drift `ResolveService`'s header exists to prevent. It arrives
68
+ * when `PersonResolution` grows the field, not before.
69
+ */
70
+ export declare const ReportSliceBy: z.ZodEnum<{
71
+ office: "office";
72
+ legal_entity: "legal_entity";
73
+ workspace: "workspace";
74
+ }>;
75
+ export type ReportSliceBy = z.infer<typeof ReportSliceBy>;
76
+ export declare const ReportSlice: z.ZodObject<{
77
+ by: z.ZodEnum<{
78
+ office: "office";
79
+ legal_entity: "legal_entity";
80
+ workspace: "workspace";
81
+ }>;
82
+ id: z.ZodNullable<z.ZodUUID>;
83
+ name: z.ZodNullable<z.ZodString>;
84
+ }, z.core.$strip>;
85
+ export type ReportSlice = z.infer<typeof ReportSlice>;
86
+ /**
87
+ * When a person was attributed to the slice.
88
+ *
89
+ * `each_day` is what everything in this module that computes a *number* already does — a day sheet
90
+ * is rebuilt against the entity in force on the day it covers, a period lock resolves per date, the
91
+ * accrual job resolves on the last day of the period. Copying the nearest list handler, which
92
+ * filters on "assignment with no end date", is the wrong instinct: it hands a transfer's whole
93
+ * previous quarter to the receiving office.
94
+ *
95
+ * `as_of_date` is honest for a balance, which is a position rather than a per-day quantity, and
96
+ * `attributionOn` says which date. `not_applicable` is an unsliced report, where nobody is
97
+ * attributed to anything.
98
+ */
99
+ export declare const ReportAttribution: z.ZodEnum<{
100
+ each_day: "each_day";
101
+ as_of_date: "as_of_date";
102
+ not_applicable: "not_applicable";
103
+ }>;
104
+ export type ReportAttribution = z.infer<typeof ReportAttribution>;
105
+ /**
106
+ * Which grant produced this population, and at what scope it was asked.
107
+ *
108
+ * On the response rather than left implicit, because the failure this prevents is not a leak: it is
109
+ * two managers opening "Overtime · October · Istanbul", getting different totals under one title,
110
+ * and neither being told why. `askedAt` is always `workspace` — `hr.attendance.view_team` and
111
+ * `hr.leave.view_team` are declared at object scope, and `Authz.can(object, id)` falls through to
112
+ * the workspace-level effective set, so binding a key to an office id narrows nothing today. Saying
113
+ * so here stops a reader inferring a narrowing that is not happening.
114
+ */
115
+ export declare const ReportScope: z.ZodObject<{
116
+ permissions: z.ZodArray<z.ZodString>;
117
+ askedAt: z.ZodLiteral<"workspace">;
118
+ }, z.core.$strip>;
119
+ export type ReportScope = z.infer<typeof ReportScope>;
120
+ export declare const ReportHeader: z.ZodObject<{
121
+ from: z.ZodISODate;
122
+ to: z.ZodISODate;
123
+ slice: z.ZodObject<{
124
+ by: z.ZodEnum<{
125
+ office: "office";
126
+ legal_entity: "legal_entity";
127
+ workspace: "workspace";
128
+ }>;
129
+ id: z.ZodNullable<z.ZodUUID>;
130
+ name: z.ZodNullable<z.ZodString>;
131
+ }, z.core.$strip>;
132
+ scope: z.ZodObject<{
133
+ permissions: z.ZodArray<z.ZodString>;
134
+ askedAt: z.ZodLiteral<"workspace">;
135
+ }, z.core.$strip>;
136
+ population: z.ZodNumber;
137
+ counted: z.ZodNumber;
138
+ attribution: z.ZodEnum<{
139
+ each_day: "each_day";
140
+ as_of_date: "as_of_date";
141
+ not_applicable: "not_applicable";
142
+ }>;
143
+ attributionOn: z.ZodNullable<z.ZodISODate>;
144
+ truncated: z.ZodBoolean;
145
+ }, z.core.$strip>;
146
+ export type ReportHeader = z.infer<typeof ReportHeader>;
147
+ /**
148
+ * Whether the figures can move again.
149
+ *
150
+ * A range that straddles a lock boundary mixes final figures with provisional ones — tonight's
151
+ * `reconcile-days` will change the open half — so a report must never present the mixed total as
152
+ * final. Where a workspace has no periods at all (the `periods` capability ships off), every day is
153
+ * open and that is entirely normal: `final: false` with `lockedDays: 0` is not a warning.
154
+ */
155
+ export declare const ReportFinality: z.ZodObject<{
156
+ lockedDays: z.ZodNumber;
157
+ openDays: z.ZodNumber;
158
+ final: z.ZodBoolean;
159
+ firstOpenDay: z.ZodNullable<z.ZodISODate>;
160
+ lastLockedDay: z.ZodNullable<z.ZodISODate>;
161
+ }, z.core.$strip>;
162
+ export type ReportFinality = z.infer<typeof ReportFinality>;
163
+ export declare const AttendanceSummaryRow: z.ZodObject<{
164
+ personId: z.ZodUUID;
165
+ displayName: z.ZodString;
166
+ days: z.ZodNumber;
167
+ scheduledMinutes: z.ZodNumber;
168
+ workedMinutes: z.ZodNumber;
169
+ scheduledWorkedMinutes: z.ZodNumber;
170
+ breakMinutes: z.ZodNumber;
171
+ lateMinutes: z.ZodNumber;
172
+ earlyLeaveMinutes: z.ZodNumber;
173
+ workedRatio: z.ZodNullable<z.ZodNumber>;
174
+ noScheduleDays: z.ZodNumber;
175
+ unknownScheduleDays: z.ZodNumber;
176
+ }, z.core.$strip>;
177
+ export type AttendanceSummaryRow = z.infer<typeof AttendanceSummaryRow>;
178
+ export declare const AttendanceSummaryTotals: z.ZodObject<{
179
+ scheduledMinutes: z.ZodNumber;
180
+ workedMinutes: z.ZodNumber;
181
+ breakMinutes: z.ZodNumber;
182
+ lateMinutes: z.ZodNumber;
183
+ earlyLeaveMinutes: z.ZodNumber;
184
+ days: z.ZodNumber;
185
+ scheduledWorkedMinutes: z.ZodNumber;
186
+ workedRatio: z.ZodNullable<z.ZodNumber>;
187
+ noScheduleDays: z.ZodNumber;
188
+ unknownScheduleDays: z.ZodNumber;
189
+ }, z.core.$strip>;
190
+ export type AttendanceSummaryTotals = z.infer<typeof AttendanceSummaryTotals>;
191
+ export declare const AttendanceSummaryReport: z.ZodObject<{
192
+ header: z.ZodObject<{
193
+ from: z.ZodISODate;
194
+ to: z.ZodISODate;
195
+ slice: z.ZodObject<{
196
+ by: z.ZodEnum<{
197
+ office: "office";
198
+ legal_entity: "legal_entity";
199
+ workspace: "workspace";
200
+ }>;
201
+ id: z.ZodNullable<z.ZodUUID>;
202
+ name: z.ZodNullable<z.ZodString>;
203
+ }, z.core.$strip>;
204
+ scope: z.ZodObject<{
205
+ permissions: z.ZodArray<z.ZodString>;
206
+ askedAt: z.ZodLiteral<"workspace">;
207
+ }, z.core.$strip>;
208
+ population: z.ZodNumber;
209
+ counted: z.ZodNumber;
210
+ attribution: z.ZodEnum<{
211
+ each_day: "each_day";
212
+ as_of_date: "as_of_date";
213
+ not_applicable: "not_applicable";
214
+ }>;
215
+ attributionOn: z.ZodNullable<z.ZodISODate>;
216
+ truncated: z.ZodBoolean;
217
+ }, z.core.$strip>;
218
+ finality: z.ZodObject<{
219
+ lockedDays: z.ZodNumber;
220
+ openDays: z.ZodNumber;
221
+ final: z.ZodBoolean;
222
+ firstOpenDay: z.ZodNullable<z.ZodISODate>;
223
+ lastLockedDay: z.ZodNullable<z.ZodISODate>;
224
+ }, z.core.$strip>;
225
+ totals: z.ZodObject<{
226
+ scheduledMinutes: z.ZodNumber;
227
+ workedMinutes: z.ZodNumber;
228
+ breakMinutes: z.ZodNumber;
229
+ lateMinutes: z.ZodNumber;
230
+ earlyLeaveMinutes: z.ZodNumber;
231
+ days: z.ZodNumber;
232
+ scheduledWorkedMinutes: z.ZodNumber;
233
+ workedRatio: z.ZodNullable<z.ZodNumber>;
234
+ noScheduleDays: z.ZodNumber;
235
+ unknownScheduleDays: z.ZodNumber;
236
+ }, z.core.$strip>;
237
+ rows: z.ZodArray<z.ZodObject<{
238
+ personId: z.ZodUUID;
239
+ displayName: z.ZodString;
240
+ days: z.ZodNumber;
241
+ scheduledMinutes: z.ZodNumber;
242
+ workedMinutes: z.ZodNumber;
243
+ scheduledWorkedMinutes: z.ZodNumber;
244
+ breakMinutes: z.ZodNumber;
245
+ lateMinutes: z.ZodNumber;
246
+ earlyLeaveMinutes: z.ZodNumber;
247
+ workedRatio: z.ZodNullable<z.ZodNumber>;
248
+ noScheduleDays: z.ZodNumber;
249
+ unknownScheduleDays: z.ZodNumber;
250
+ }, z.core.$strip>>;
251
+ }, z.core.$strip>;
252
+ export type AttendanceSummaryReport = z.infer<typeof AttendanceSummaryReport>;
253
+ export declare const OvertimeRow: z.ZodObject<{
254
+ personId: z.ZodUUID;
255
+ displayName: z.ZodString;
256
+ days: z.ZodNumber;
257
+ overtimeMinutes: z.ZodNumber;
258
+ beyondCapMinutes: z.ZodNullable<z.ZodNumber>;
259
+ cappedDays: z.ZodNumber;
260
+ uncappedDays: z.ZodNumber;
261
+ }, z.core.$strip>;
262
+ export type OvertimeRow = z.infer<typeof OvertimeRow>;
263
+ export declare const OvertimeTotals: z.ZodObject<{
264
+ overtimeMinutes: z.ZodNumber;
265
+ beyondCapMinutes: z.ZodNullable<z.ZodNumber>;
266
+ days: z.ZodNumber;
267
+ cappedDays: z.ZodNumber;
268
+ uncappedDays: z.ZodNumber;
269
+ }, z.core.$strip>;
270
+ export type OvertimeTotals = z.infer<typeof OvertimeTotals>;
271
+ export declare const OvertimeReport: z.ZodObject<{
272
+ header: z.ZodObject<{
273
+ from: z.ZodISODate;
274
+ to: z.ZodISODate;
275
+ slice: z.ZodObject<{
276
+ by: z.ZodEnum<{
277
+ office: "office";
278
+ legal_entity: "legal_entity";
279
+ workspace: "workspace";
280
+ }>;
281
+ id: z.ZodNullable<z.ZodUUID>;
282
+ name: z.ZodNullable<z.ZodString>;
283
+ }, z.core.$strip>;
284
+ scope: z.ZodObject<{
285
+ permissions: z.ZodArray<z.ZodString>;
286
+ askedAt: z.ZodLiteral<"workspace">;
287
+ }, z.core.$strip>;
288
+ population: z.ZodNumber;
289
+ counted: z.ZodNumber;
290
+ attribution: z.ZodEnum<{
291
+ each_day: "each_day";
292
+ as_of_date: "as_of_date";
293
+ not_applicable: "not_applicable";
294
+ }>;
295
+ attributionOn: z.ZodNullable<z.ZodISODate>;
296
+ truncated: z.ZodBoolean;
297
+ }, z.core.$strip>;
298
+ finality: z.ZodObject<{
299
+ lockedDays: z.ZodNumber;
300
+ openDays: z.ZodNumber;
301
+ final: z.ZodBoolean;
302
+ firstOpenDay: z.ZodNullable<z.ZodISODate>;
303
+ lastLockedDay: z.ZodNullable<z.ZodISODate>;
304
+ }, z.core.$strip>;
305
+ totals: z.ZodObject<{
306
+ overtimeMinutes: z.ZodNumber;
307
+ beyondCapMinutes: z.ZodNullable<z.ZodNumber>;
308
+ days: z.ZodNumber;
309
+ cappedDays: z.ZodNumber;
310
+ uncappedDays: z.ZodNumber;
311
+ }, z.core.$strip>;
312
+ rows: z.ZodArray<z.ZodObject<{
313
+ personId: z.ZodUUID;
314
+ displayName: z.ZodString;
315
+ days: z.ZodNumber;
316
+ overtimeMinutes: z.ZodNumber;
317
+ beyondCapMinutes: z.ZodNullable<z.ZodNumber>;
318
+ cappedDays: z.ZodNumber;
319
+ uncappedDays: z.ZodNumber;
320
+ }, z.core.$strip>>;
321
+ }, z.core.$strip>;
322
+ export type OvertimeReport = z.infer<typeof OvertimeReport>;
323
+ /**
324
+ * What the expected-days figure rests on, per person.
325
+ *
326
+ * `no_schedule` and `no_calendar` are **named rows, not silent drops**. A person with no schedule
327
+ * assignment owes no hours, so "absent" is not a fact this module holds about them — and in a
328
+ * workspace that clocks in only its shift staff they are the majority. An office with no calendar
329
+ * attached would fall back to Monday–Friday, which is an assumption rather than an answer, so the
330
+ * expectation is withheld and the reason is printed instead.
331
+ */
332
+ export declare const AbsenceBasis: z.ZodEnum<{
333
+ calendar: "calendar";
334
+ no_calendar: "no_calendar";
335
+ no_schedule: "no_schedule";
336
+ }>;
337
+ export type AbsenceBasis = z.infer<typeof AbsenceBasis>;
338
+ export declare const AbsenceRow: z.ZodObject<{
339
+ personId: z.ZodUUID;
340
+ displayName: z.ZodString;
341
+ basis: z.ZodEnum<{
342
+ calendar: "calendar";
343
+ no_calendar: "no_calendar";
344
+ no_schedule: "no_schedule";
345
+ }>;
346
+ expectedDays: z.ZodNullable<z.ZodNumber>;
347
+ workedDays: z.ZodNullable<z.ZodNumber>;
348
+ leaveDays: z.ZodNullable<z.ZodNumber>;
349
+ absentDays: z.ZodNullable<z.ZodNumber>;
350
+ absenceRate: z.ZodNullable<z.ZodNumber>;
351
+ }, z.core.$strip>;
352
+ export type AbsenceRow = z.infer<typeof AbsenceRow>;
353
+ export declare const AbsenceTotals: z.ZodObject<{
354
+ measured: z.ZodNumber;
355
+ expectedDays: z.ZodNumber;
356
+ workedDays: z.ZodNumber;
357
+ leaveDays: z.ZodNullable<z.ZodNumber>;
358
+ absentDays: z.ZodNumber;
359
+ absenceRate: z.ZodNullable<z.ZodNumber>;
360
+ }, z.core.$strip>;
361
+ export type AbsenceTotals = z.infer<typeof AbsenceTotals>;
362
+ export declare const AbsenceReport: z.ZodObject<{
363
+ header: z.ZodObject<{
364
+ from: z.ZodISODate;
365
+ to: z.ZodISODate;
366
+ slice: z.ZodObject<{
367
+ by: z.ZodEnum<{
368
+ office: "office";
369
+ legal_entity: "legal_entity";
370
+ workspace: "workspace";
371
+ }>;
372
+ id: z.ZodNullable<z.ZodUUID>;
373
+ name: z.ZodNullable<z.ZodString>;
374
+ }, z.core.$strip>;
375
+ scope: z.ZodObject<{
376
+ permissions: z.ZodArray<z.ZodString>;
377
+ askedAt: z.ZodLiteral<"workspace">;
378
+ }, z.core.$strip>;
379
+ population: z.ZodNumber;
380
+ counted: z.ZodNumber;
381
+ attribution: z.ZodEnum<{
382
+ each_day: "each_day";
383
+ as_of_date: "as_of_date";
384
+ not_applicable: "not_applicable";
385
+ }>;
386
+ attributionOn: z.ZodNullable<z.ZodISODate>;
387
+ truncated: z.ZodBoolean;
388
+ }, z.core.$strip>;
389
+ finality: z.ZodObject<{
390
+ lockedDays: z.ZodNumber;
391
+ openDays: z.ZodNumber;
392
+ final: z.ZodBoolean;
393
+ firstOpenDay: z.ZodNullable<z.ZodISODate>;
394
+ lastLockedDay: z.ZodNullable<z.ZodISODate>;
395
+ }, z.core.$strip>;
396
+ leaveCounted: z.ZodBoolean;
397
+ totals: z.ZodObject<{
398
+ measured: z.ZodNumber;
399
+ expectedDays: z.ZodNumber;
400
+ workedDays: z.ZodNumber;
401
+ leaveDays: z.ZodNullable<z.ZodNumber>;
402
+ absentDays: z.ZodNumber;
403
+ absenceRate: z.ZodNullable<z.ZodNumber>;
404
+ }, z.core.$strip>;
405
+ excluded: z.ZodObject<{
406
+ noSchedule: z.ZodNumber;
407
+ noCalendar: z.ZodNumber;
408
+ }, z.core.$strip>;
409
+ rows: z.ZodArray<z.ZodObject<{
410
+ personId: z.ZodUUID;
411
+ displayName: z.ZodString;
412
+ basis: z.ZodEnum<{
413
+ calendar: "calendar";
414
+ no_calendar: "no_calendar";
415
+ no_schedule: "no_schedule";
416
+ }>;
417
+ expectedDays: z.ZodNullable<z.ZodNumber>;
418
+ workedDays: z.ZodNullable<z.ZodNumber>;
419
+ leaveDays: z.ZodNullable<z.ZodNumber>;
420
+ absentDays: z.ZodNullable<z.ZodNumber>;
421
+ absenceRate: z.ZodNullable<z.ZodNumber>;
422
+ }, z.core.$strip>>;
423
+ }, z.core.$strip>;
424
+ export type AbsenceReport = z.infer<typeof AbsenceReport>;
425
+ export declare const LeaveBalanceRow: z.ZodObject<{
426
+ personId: z.ZodUUID;
427
+ displayName: z.ZodString;
428
+ leaveTypeId: z.ZodUUID;
429
+ leaveTypeName: z.ZodString;
430
+ unit: z.ZodEnum<{
431
+ half_day: "half_day";
432
+ day: "day";
433
+ hour: "hour";
434
+ }>;
435
+ balanceMinutes: z.ZodNumber;
436
+ bookedMinutes: z.ZodNumber;
437
+ pendingMinutes: z.ZodNumber;
438
+ availableMinutes: z.ZodNumber;
439
+ balance: z.ZodNumber;
440
+ available: z.ZodNumber;
441
+ }, z.core.$strip>;
442
+ export type LeaveBalanceRow = z.infer<typeof LeaveBalanceRow>;
443
+ export declare const LeaveBalanceReport: z.ZodObject<{
444
+ header: z.ZodObject<{
445
+ from: z.ZodISODate;
446
+ to: z.ZodISODate;
447
+ slice: z.ZodObject<{
448
+ by: z.ZodEnum<{
449
+ office: "office";
450
+ legal_entity: "legal_entity";
451
+ workspace: "workspace";
452
+ }>;
453
+ id: z.ZodNullable<z.ZodUUID>;
454
+ name: z.ZodNullable<z.ZodString>;
455
+ }, z.core.$strip>;
456
+ scope: z.ZodObject<{
457
+ permissions: z.ZodArray<z.ZodString>;
458
+ askedAt: z.ZodLiteral<"workspace">;
459
+ }, z.core.$strip>;
460
+ population: z.ZodNumber;
461
+ counted: z.ZodNumber;
462
+ attribution: z.ZodEnum<{
463
+ each_day: "each_day";
464
+ as_of_date: "as_of_date";
465
+ not_applicable: "not_applicable";
466
+ }>;
467
+ attributionOn: z.ZodNullable<z.ZodISODate>;
468
+ truncated: z.ZodBoolean;
469
+ }, z.core.$strip>;
470
+ periodYear: z.ZodNumber;
471
+ dayLengthMinutes: z.ZodNumber;
472
+ totals: z.ZodArray<z.ZodObject<{
473
+ leaveTypeId: z.ZodUUID;
474
+ leaveTypeName: z.ZodString;
475
+ unit: z.ZodEnum<{
476
+ half_day: "half_day";
477
+ day: "day";
478
+ hour: "hour";
479
+ }>;
480
+ people: z.ZodNumber;
481
+ balanceMinutes: z.ZodNumber;
482
+ bookedMinutes: z.ZodNumber;
483
+ pendingMinutes: z.ZodNumber;
484
+ availableMinutes: z.ZodNumber;
485
+ }, z.core.$strip>>;
486
+ rows: z.ZodArray<z.ZodObject<{
487
+ personId: z.ZodUUID;
488
+ displayName: z.ZodString;
489
+ leaveTypeId: z.ZodUUID;
490
+ leaveTypeName: z.ZodString;
491
+ unit: z.ZodEnum<{
492
+ half_day: "half_day";
493
+ day: "day";
494
+ hour: "hour";
495
+ }>;
496
+ balanceMinutes: z.ZodNumber;
497
+ bookedMinutes: z.ZodNumber;
498
+ pendingMinutes: z.ZodNumber;
499
+ availableMinutes: z.ZodNumber;
500
+ balance: z.ZodNumber;
501
+ available: z.ZodNumber;
502
+ }, z.core.$strip>>;
503
+ }, z.core.$strip>;
504
+ export type LeaveBalanceReport = z.infer<typeof LeaveBalanceReport>;
505
+ //# sourceMappingURL=reports.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reports.d.ts","sourceRoot":"","sources":["../../src/contract/reports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAA;AAExC;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,QAAS,CAAA;AAErC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;;;;EAAkD,CAAA;AAC5E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEzD,eAAO,MAAM,WAAW;;;;;;;;iBAMtB,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAErD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB;;;;EAAuD,CAAA;AACrF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEjE;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW;;;iBAItB,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CA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