@kernhq/module-hr 0.17.0 → 0.18.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.
@@ -15,6 +15,7 @@ export * from './models.js';
15
15
  export * from './permissions.js';
16
16
  export * from './policies.js';
17
17
  export * from './privacy.js';
18
+ export * from './reports.js';
18
19
  export * from './router.js';
19
20
  export * from './settings.js';
20
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
@@ -15,6 +15,7 @@ export * from './models.js';
15
15
  export * from './permissions.js';
16
16
  export * from './policies.js';
17
17
  export * from './privacy.js';
18
+ export * from './reports.js';
18
19
  export * from './router.js';
19
20
  export * from './settings.js';
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
@@ -202,6 +202,13 @@ export declare const hrPermissions: readonly [{
202
202
  readonly scope: "workspace";
203
203
  readonly defaultRoles: ["owner", "admin"];
204
204
  readonly dangerous: true;
205
+ }, {
206
+ readonly key: "hr.report.view";
207
+ readonly label: "Open HR reports";
208
+ readonly description: string;
209
+ readonly scope: "workspace";
210
+ readonly defaultRoles: ["owner", "admin"];
211
+ readonly dangerous: false;
205
212
  }, {
206
213
  readonly key: "hr.policy.view";
207
214
  readonly label: "View accrual, overtime and rounding policies";
@@ -281,6 +288,7 @@ export declare const HR_PERMISSIONS: {
281
288
  readonly attendanceView: "hr.attendance.view";
282
289
  readonly attendanceViewTeam: "hr.attendance.view_team";
283
290
  readonly attendanceManage: "hr.attendance.manage";
291
+ readonly reportView: "hr.report.view";
284
292
  readonly policyView: "hr.policy.view";
285
293
  readonly policyManage: "hr.policy.manage";
286
294
  readonly periodManage: "hr.period.manage";
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/contract/permissions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwTxB,CAAA;AAEF,+DAA+D;AAC/D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCjB,CAAA"}
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/contract/permissions.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkVxB,CAAA;AAEF,+DAA+D;AAC/D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCjB,CAAA"}
@@ -253,6 +253,30 @@ export const hrPermissions = definePermissions([
253
253
  // nothing asks a question these keys could answer — a role checkbox that gates nothing teaches an
254
254
  // administrator the same lesson a dead capability switch does. They come back with the approval
255
255
  // flow that needs them.
256
+ // ---------------------------------------------------------------- reports
257
+ {
258
+ key: 'hr.report.view',
259
+ label: 'Open HR reports',
260
+ description: 'Aggregate attendance, absence, overtime and leave balances across a team or an office. ' +
261
+ 'Each report also needs the key for the data it sums.',
262
+ scope: 'workspace',
263
+ defaultRoles: ['owner', 'admin'],
264
+ dangerous: false,
265
+ },
266
+ // Four procedures, one key, one commit — `reports.attendance`, `reports.overtime`,
267
+ // `reports.absence` and `reports.leaveBalance` all ship gated on it, exactly as `hr.privacy.manage`
268
+ // ships across four. It is a **second** check rather than a replacement: a report must not answer
269
+ // a question its row-level procedure would refuse, so each one also asks for the key that already
270
+ // guards the rows it sums — `hr.attendance.view_team` for the three attendance reports (which is
271
+ // what `attendance.days.list` costs to read a whole office) and `hr.leave.view_team` for balances
272
+ // (which is what `leave.balance.get` costs to read somebody else's).
273
+ //
274
+ // Why a key of its own at all, when the two above would do: a reports surface is the one place a
275
+ // whole population's figures are put in front of somebody in a form that goes into a payroll or a
276
+ // performance conversation, and a workspace has to be able to grant a manager their team's day
277
+ // sheets without granting them that. There is deliberately **no** `hr.report.export`: nothing in
278
+ // this module writes a file, and a key gating a button nobody built is the thing the removed
279
+ // `hr.overtime.*` block below is a note about.
256
280
  // ---------------------------------------------------------------- policies and periods
257
281
  {
258
282
  key: 'hr.policy.view',
@@ -353,6 +377,7 @@ export const HR_PERMISSIONS = {
353
377
  attendanceView: 'hr.attendance.view',
354
378
  attendanceViewTeam: 'hr.attendance.view_team',
355
379
  attendanceManage: 'hr.attendance.manage',
380
+ reportView: 'hr.report.view',
356
381
  policyView: 'hr.policy.view',
357
382
  policyManage: 'hr.policy.manage',
358
383
  periodManage: 'hr.period.manage',
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../src/contract/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB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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
+ breakMinutes: z.ZodNumber;
170
+ lateMinutes: z.ZodNumber;
171
+ earlyLeaveMinutes: z.ZodNumber;
172
+ workedRatio: z.ZodNullable<z.ZodNumber>;
173
+ noScheduleDays: z.ZodNumber;
174
+ unknownScheduleDays: z.ZodNumber;
175
+ }, z.core.$strip>;
176
+ export type AttendanceSummaryRow = z.infer<typeof AttendanceSummaryRow>;
177
+ export declare const AttendanceSummaryTotals: z.ZodObject<{
178
+ scheduledMinutes: z.ZodNumber;
179
+ workedMinutes: z.ZodNumber;
180
+ breakMinutes: z.ZodNumber;
181
+ lateMinutes: z.ZodNumber;
182
+ earlyLeaveMinutes: z.ZodNumber;
183
+ days: z.ZodNumber;
184
+ workedRatio: z.ZodNullable<z.ZodNumber>;
185
+ noScheduleDays: z.ZodNumber;
186
+ unknownScheduleDays: z.ZodNumber;
187
+ }, z.core.$strip>;
188
+ export type AttendanceSummaryTotals = z.infer<typeof AttendanceSummaryTotals>;
189
+ export declare const AttendanceSummaryReport: z.ZodObject<{
190
+ header: z.ZodObject<{
191
+ from: z.ZodISODate;
192
+ to: z.ZodISODate;
193
+ slice: z.ZodObject<{
194
+ by: z.ZodEnum<{
195
+ office: "office";
196
+ legal_entity: "legal_entity";
197
+ workspace: "workspace";
198
+ }>;
199
+ id: z.ZodNullable<z.ZodUUID>;
200
+ name: z.ZodNullable<z.ZodString>;
201
+ }, z.core.$strip>;
202
+ scope: z.ZodObject<{
203
+ permissions: z.ZodArray<z.ZodString>;
204
+ askedAt: z.ZodLiteral<"workspace">;
205
+ }, z.core.$strip>;
206
+ population: z.ZodNumber;
207
+ counted: z.ZodNumber;
208
+ attribution: z.ZodEnum<{
209
+ each_day: "each_day";
210
+ as_of_date: "as_of_date";
211
+ not_applicable: "not_applicable";
212
+ }>;
213
+ attributionOn: z.ZodNullable<z.ZodISODate>;
214
+ truncated: z.ZodBoolean;
215
+ }, z.core.$strip>;
216
+ finality: z.ZodObject<{
217
+ lockedDays: z.ZodNumber;
218
+ openDays: z.ZodNumber;
219
+ final: z.ZodBoolean;
220
+ firstOpenDay: z.ZodNullable<z.ZodISODate>;
221
+ lastLockedDay: z.ZodNullable<z.ZodISODate>;
222
+ }, z.core.$strip>;
223
+ totals: z.ZodObject<{
224
+ scheduledMinutes: z.ZodNumber;
225
+ workedMinutes: z.ZodNumber;
226
+ breakMinutes: z.ZodNumber;
227
+ lateMinutes: z.ZodNumber;
228
+ earlyLeaveMinutes: z.ZodNumber;
229
+ days: z.ZodNumber;
230
+ workedRatio: z.ZodNullable<z.ZodNumber>;
231
+ noScheduleDays: z.ZodNumber;
232
+ unknownScheduleDays: z.ZodNumber;
233
+ }, z.core.$strip>;
234
+ rows: z.ZodArray<z.ZodObject<{
235
+ personId: z.ZodUUID;
236
+ displayName: z.ZodString;
237
+ days: z.ZodNumber;
238
+ scheduledMinutes: z.ZodNumber;
239
+ workedMinutes: z.ZodNumber;
240
+ breakMinutes: z.ZodNumber;
241
+ lateMinutes: z.ZodNumber;
242
+ earlyLeaveMinutes: z.ZodNumber;
243
+ workedRatio: z.ZodNullable<z.ZodNumber>;
244
+ noScheduleDays: z.ZodNumber;
245
+ unknownScheduleDays: z.ZodNumber;
246
+ }, z.core.$strip>>;
247
+ }, z.core.$strip>;
248
+ export type AttendanceSummaryReport = z.infer<typeof AttendanceSummaryReport>;
249
+ export declare const OvertimeRow: z.ZodObject<{
250
+ personId: z.ZodUUID;
251
+ displayName: z.ZodString;
252
+ days: z.ZodNumber;
253
+ overtimeMinutes: z.ZodNumber;
254
+ beyondCapMinutes: z.ZodNullable<z.ZodNumber>;
255
+ cappedDays: z.ZodNumber;
256
+ uncappedDays: z.ZodNumber;
257
+ }, z.core.$strip>;
258
+ export type OvertimeRow = z.infer<typeof OvertimeRow>;
259
+ export declare const OvertimeTotals: z.ZodObject<{
260
+ overtimeMinutes: z.ZodNumber;
261
+ beyondCapMinutes: z.ZodNullable<z.ZodNumber>;
262
+ days: z.ZodNumber;
263
+ cappedDays: z.ZodNumber;
264
+ uncappedDays: z.ZodNumber;
265
+ }, z.core.$strip>;
266
+ export type OvertimeTotals = z.infer<typeof OvertimeTotals>;
267
+ export declare const OvertimeReport: z.ZodObject<{
268
+ header: z.ZodObject<{
269
+ from: z.ZodISODate;
270
+ to: z.ZodISODate;
271
+ slice: z.ZodObject<{
272
+ by: z.ZodEnum<{
273
+ office: "office";
274
+ legal_entity: "legal_entity";
275
+ workspace: "workspace";
276
+ }>;
277
+ id: z.ZodNullable<z.ZodUUID>;
278
+ name: z.ZodNullable<z.ZodString>;
279
+ }, z.core.$strip>;
280
+ scope: z.ZodObject<{
281
+ permissions: z.ZodArray<z.ZodString>;
282
+ askedAt: z.ZodLiteral<"workspace">;
283
+ }, z.core.$strip>;
284
+ population: z.ZodNumber;
285
+ counted: z.ZodNumber;
286
+ attribution: z.ZodEnum<{
287
+ each_day: "each_day";
288
+ as_of_date: "as_of_date";
289
+ not_applicable: "not_applicable";
290
+ }>;
291
+ attributionOn: z.ZodNullable<z.ZodISODate>;
292
+ truncated: z.ZodBoolean;
293
+ }, z.core.$strip>;
294
+ finality: z.ZodObject<{
295
+ lockedDays: z.ZodNumber;
296
+ openDays: z.ZodNumber;
297
+ final: z.ZodBoolean;
298
+ firstOpenDay: z.ZodNullable<z.ZodISODate>;
299
+ lastLockedDay: z.ZodNullable<z.ZodISODate>;
300
+ }, z.core.$strip>;
301
+ totals: z.ZodObject<{
302
+ overtimeMinutes: z.ZodNumber;
303
+ beyondCapMinutes: z.ZodNullable<z.ZodNumber>;
304
+ days: z.ZodNumber;
305
+ cappedDays: z.ZodNumber;
306
+ uncappedDays: z.ZodNumber;
307
+ }, z.core.$strip>;
308
+ rows: z.ZodArray<z.ZodObject<{
309
+ personId: z.ZodUUID;
310
+ displayName: z.ZodString;
311
+ days: z.ZodNumber;
312
+ overtimeMinutes: z.ZodNumber;
313
+ beyondCapMinutes: z.ZodNullable<z.ZodNumber>;
314
+ cappedDays: z.ZodNumber;
315
+ uncappedDays: z.ZodNumber;
316
+ }, z.core.$strip>>;
317
+ }, z.core.$strip>;
318
+ export type OvertimeReport = z.infer<typeof OvertimeReport>;
319
+ /**
320
+ * What the expected-days figure rests on, per person.
321
+ *
322
+ * `no_schedule` and `no_calendar` are **named rows, not silent drops**. A person with no schedule
323
+ * assignment owes no hours, so "absent" is not a fact this module holds about them — and in a
324
+ * workspace that clocks in only its shift staff they are the majority. An office with no calendar
325
+ * attached would fall back to Monday–Friday, which is an assumption rather than an answer, so the
326
+ * expectation is withheld and the reason is printed instead.
327
+ */
328
+ export declare const AbsenceBasis: z.ZodEnum<{
329
+ calendar: "calendar";
330
+ no_calendar: "no_calendar";
331
+ no_schedule: "no_schedule";
332
+ }>;
333
+ export type AbsenceBasis = z.infer<typeof AbsenceBasis>;
334
+ export declare const AbsenceRow: z.ZodObject<{
335
+ personId: z.ZodUUID;
336
+ displayName: z.ZodString;
337
+ basis: z.ZodEnum<{
338
+ calendar: "calendar";
339
+ no_calendar: "no_calendar";
340
+ no_schedule: "no_schedule";
341
+ }>;
342
+ expectedDays: z.ZodNullable<z.ZodNumber>;
343
+ workedDays: z.ZodNullable<z.ZodNumber>;
344
+ leaveDays: z.ZodNullable<z.ZodNumber>;
345
+ absentDays: z.ZodNullable<z.ZodNumber>;
346
+ absenceRate: z.ZodNullable<z.ZodNumber>;
347
+ }, z.core.$strip>;
348
+ export type AbsenceRow = z.infer<typeof AbsenceRow>;
349
+ export declare const AbsenceTotals: z.ZodObject<{
350
+ measured: z.ZodNumber;
351
+ expectedDays: z.ZodNumber;
352
+ workedDays: z.ZodNumber;
353
+ leaveDays: z.ZodNullable<z.ZodNumber>;
354
+ absentDays: z.ZodNumber;
355
+ absenceRate: z.ZodNullable<z.ZodNumber>;
356
+ }, z.core.$strip>;
357
+ export type AbsenceTotals = z.infer<typeof AbsenceTotals>;
358
+ export declare const AbsenceReport: z.ZodObject<{
359
+ header: z.ZodObject<{
360
+ from: z.ZodISODate;
361
+ to: z.ZodISODate;
362
+ slice: z.ZodObject<{
363
+ by: z.ZodEnum<{
364
+ office: "office";
365
+ legal_entity: "legal_entity";
366
+ workspace: "workspace";
367
+ }>;
368
+ id: z.ZodNullable<z.ZodUUID>;
369
+ name: z.ZodNullable<z.ZodString>;
370
+ }, z.core.$strip>;
371
+ scope: z.ZodObject<{
372
+ permissions: z.ZodArray<z.ZodString>;
373
+ askedAt: z.ZodLiteral<"workspace">;
374
+ }, z.core.$strip>;
375
+ population: z.ZodNumber;
376
+ counted: z.ZodNumber;
377
+ attribution: z.ZodEnum<{
378
+ each_day: "each_day";
379
+ as_of_date: "as_of_date";
380
+ not_applicable: "not_applicable";
381
+ }>;
382
+ attributionOn: z.ZodNullable<z.ZodISODate>;
383
+ truncated: z.ZodBoolean;
384
+ }, z.core.$strip>;
385
+ finality: z.ZodObject<{
386
+ lockedDays: z.ZodNumber;
387
+ openDays: z.ZodNumber;
388
+ final: z.ZodBoolean;
389
+ firstOpenDay: z.ZodNullable<z.ZodISODate>;
390
+ lastLockedDay: z.ZodNullable<z.ZodISODate>;
391
+ }, z.core.$strip>;
392
+ leaveCounted: z.ZodBoolean;
393
+ totals: z.ZodObject<{
394
+ measured: z.ZodNumber;
395
+ expectedDays: z.ZodNumber;
396
+ workedDays: z.ZodNumber;
397
+ leaveDays: z.ZodNullable<z.ZodNumber>;
398
+ absentDays: z.ZodNumber;
399
+ absenceRate: z.ZodNullable<z.ZodNumber>;
400
+ }, z.core.$strip>;
401
+ excluded: z.ZodObject<{
402
+ noSchedule: z.ZodNumber;
403
+ noCalendar: z.ZodNumber;
404
+ }, z.core.$strip>;
405
+ rows: z.ZodArray<z.ZodObject<{
406
+ personId: z.ZodUUID;
407
+ displayName: z.ZodString;
408
+ basis: z.ZodEnum<{
409
+ calendar: "calendar";
410
+ no_calendar: "no_calendar";
411
+ no_schedule: "no_schedule";
412
+ }>;
413
+ expectedDays: z.ZodNullable<z.ZodNumber>;
414
+ workedDays: z.ZodNullable<z.ZodNumber>;
415
+ leaveDays: z.ZodNullable<z.ZodNumber>;
416
+ absentDays: z.ZodNullable<z.ZodNumber>;
417
+ absenceRate: z.ZodNullable<z.ZodNumber>;
418
+ }, z.core.$strip>>;
419
+ }, z.core.$strip>;
420
+ export type AbsenceReport = z.infer<typeof AbsenceReport>;
421
+ export declare const LeaveBalanceRow: z.ZodObject<{
422
+ personId: z.ZodUUID;
423
+ displayName: z.ZodString;
424
+ leaveTypeId: z.ZodUUID;
425
+ leaveTypeName: z.ZodString;
426
+ unit: z.ZodEnum<{
427
+ half_day: "half_day";
428
+ day: "day";
429
+ hour: "hour";
430
+ }>;
431
+ balanceMinutes: z.ZodNumber;
432
+ bookedMinutes: z.ZodNumber;
433
+ pendingMinutes: z.ZodNumber;
434
+ availableMinutes: z.ZodNumber;
435
+ balance: z.ZodNumber;
436
+ available: z.ZodNumber;
437
+ }, z.core.$strip>;
438
+ export type LeaveBalanceRow = z.infer<typeof LeaveBalanceRow>;
439
+ export declare const LeaveBalanceReport: z.ZodObject<{
440
+ header: z.ZodObject<{
441
+ from: z.ZodISODate;
442
+ to: z.ZodISODate;
443
+ slice: z.ZodObject<{
444
+ by: z.ZodEnum<{
445
+ office: "office";
446
+ legal_entity: "legal_entity";
447
+ workspace: "workspace";
448
+ }>;
449
+ id: z.ZodNullable<z.ZodUUID>;
450
+ name: z.ZodNullable<z.ZodString>;
451
+ }, z.core.$strip>;
452
+ scope: z.ZodObject<{
453
+ permissions: z.ZodArray<z.ZodString>;
454
+ askedAt: z.ZodLiteral<"workspace">;
455
+ }, z.core.$strip>;
456
+ population: z.ZodNumber;
457
+ counted: z.ZodNumber;
458
+ attribution: z.ZodEnum<{
459
+ each_day: "each_day";
460
+ as_of_date: "as_of_date";
461
+ not_applicable: "not_applicable";
462
+ }>;
463
+ attributionOn: z.ZodNullable<z.ZodISODate>;
464
+ truncated: z.ZodBoolean;
465
+ }, z.core.$strip>;
466
+ periodYear: z.ZodNumber;
467
+ dayLengthMinutes: z.ZodNumber;
468
+ totals: z.ZodArray<z.ZodObject<{
469
+ leaveTypeId: z.ZodUUID;
470
+ leaveTypeName: z.ZodString;
471
+ unit: z.ZodEnum<{
472
+ half_day: "half_day";
473
+ day: "day";
474
+ hour: "hour";
475
+ }>;
476
+ people: z.ZodNumber;
477
+ balanceMinutes: z.ZodNumber;
478
+ bookedMinutes: z.ZodNumber;
479
+ pendingMinutes: z.ZodNumber;
480
+ availableMinutes: z.ZodNumber;
481
+ }, z.core.$strip>>;
482
+ rows: z.ZodArray<z.ZodObject<{
483
+ personId: z.ZodUUID;
484
+ displayName: z.ZodString;
485
+ leaveTypeId: z.ZodUUID;
486
+ leaveTypeName: z.ZodString;
487
+ unit: z.ZodEnum<{
488
+ half_day: "half_day";
489
+ day: "day";
490
+ hour: "hour";
491
+ }>;
492
+ balanceMinutes: z.ZodNumber;
493
+ bookedMinutes: z.ZodNumber;
494
+ pendingMinutes: z.ZodNumber;
495
+ availableMinutes: z.ZodNumber;
496
+ balance: z.ZodNumber;
497
+ available: z.ZodNumber;
498
+ }, z.core.$strip>>;
499
+ }, z.core.$strip>;
500
+ export type LeaveBalanceReport = z.infer<typeof LeaveBalanceReport>;
501
+ //# 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,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAA;AAErD,eAAO,MAAM,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