@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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reports.js","sourceRoot":"","sources":["../../../src/server/services/reports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,gBAAgB,CAAA;AACnD,OAAO,EAAE,GAAG,EAAe,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAStF,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AACpG,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,EACL,cAAc,EACd,WAAW,EACX,WAAW,EACX,aAAa,EACb,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,OAAO,EACP,MAAM,EACN,mBAAmB,GACpB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGpC;;;;;;;;;;;;;;;;GAgBG;AAEH,8EAA8E;AAE9E,kGAAkG;AAClG,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,GAAG,CAAA;AAEtE,4FAA4F;AAC5F,MAAM,UAAU,SAAS,CAAC,IAAa,EAAE,EAAW;IAClD,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAA;AACtD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,KAAK,CAAC,SAAiB,EAAE,WAAmB;IAC1D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,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AAQ,EAAE,MAAM,EAAE,QAAQ,IAAI,CAAC,EAAE,CAAC,CAAA;IAC1D,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAA;AAClC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kernhq/module-hr",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Kern HR module: people, offices, org chart, calendars",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",
@@ -15,5 +15,6 @@ 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'
@@ -263,6 +263,32 @@ export const hrPermissions = definePermissions([
263
263
  // administrator the same lesson a dead capability switch does. They come back with the approval
264
264
  // flow that needs them.
265
265
 
266
+ // ---------------------------------------------------------------- reports
267
+ {
268
+ key: 'hr.report.view',
269
+ label: 'Open HR reports',
270
+ description:
271
+ 'Aggregate attendance, absence, overtime and leave balances across a team or an office. ' +
272
+ 'Each report also needs the key for the data it sums.',
273
+ scope: 'workspace',
274
+ defaultRoles: ['owner', 'admin'],
275
+ dangerous: false,
276
+ },
277
+ // Four procedures, one key, one commit — `reports.attendance`, `reports.overtime`,
278
+ // `reports.absence` and `reports.leaveBalance` all ship gated on it, exactly as `hr.privacy.manage`
279
+ // ships across four. It is a **second** check rather than a replacement: a report must not answer
280
+ // a question its row-level procedure would refuse, so each one also asks for the key that already
281
+ // guards the rows it sums — `hr.attendance.view_team` for the three attendance reports (which is
282
+ // what `attendance.days.list` costs to read a whole office) and `hr.leave.view_team` for balances
283
+ // (which is what `leave.balance.get` costs to read somebody else's).
284
+ //
285
+ // Why a key of its own at all, when the two above would do: a reports surface is the one place a
286
+ // whole population's figures are put in front of somebody in a form that goes into a payroll or a
287
+ // performance conversation, and a workspace has to be able to grant a manager their team's day
288
+ // sheets without granting them that. There is deliberately **no** `hr.report.export`: nothing in
289
+ // this module writes a file, and a key gating a button nobody built is the thing the removed
290
+ // `hr.overtime.*` block below is a note about.
291
+
266
292
  // ---------------------------------------------------------------- policies and periods
267
293
  {
268
294
  key: 'hr.policy.view',
@@ -368,6 +394,7 @@ export const HR_PERMISSIONS = {
368
394
  attendanceView: 'hr.attendance.view',
369
395
  attendanceViewTeam: 'hr.attendance.view_team',
370
396
  attendanceManage: 'hr.attendance.manage',
397
+ reportView: 'hr.report.view',
371
398
  policyView: 'hr.policy.view',
372
399
  policyManage: 'hr.policy.manage',
373
400
  periodManage: 'hr.period.manage',
@@ -0,0 +1,363 @@
1
+ import { z } from 'zod'
2
+ import { LeaveUnit } from './leave.js'
3
+ import { IsoDate } from './models.js'
4
+
5
+ /**
6
+ * Four numbers a company acts on, and the three rules that make them safe to act on.
7
+ *
8
+ * **1. A total states its own denominator.** "47 hours of overtime" means nothing on its own; "47
9
+ * hours · 12 of 38 people · 1–31 October · Istanbul office" is a fact. Every report here carries a
10
+ * `ReportHeader` saying who it counted, over what range, under which slice, and — because two
11
+ * managers must never read the same title over different populations — **which permission produced
12
+ * it**. A report is a separate grant, not a narrowing: a reader without the key gets nothing rather
13
+ * than a quieter number.
14
+ *
15
+ * **2. Unknown is not zero.** Every figure a person's data cannot answer is `null` here, and a
16
+ * screen renders `null` as an em dash. Never 0%, never "0 days absent". The three that bite:
17
+ * somebody with no schedule has no attendance percentage (the denominator is zero, not the
18
+ * numerator); an office with no calendar attached has no expected working days (Mon–Fri would be an
19
+ * assumption this module does not make, and it is wrong for every Gulf and Iranian office); and
20
+ * `beyondCapMinutes` is null where **no cap was in force**, which is a different fact from a cap
21
+ * that nothing exceeded.
22
+ *
23
+ * **3. Nothing here is projected or entitled.** No year-end balance, no "at this rate you will pass
24
+ * the annual ceiling in November", no allowance remaining. All three need either a policy that may
25
+ * not exist or a workspace day length this module does not hold — `MINUTES_PER_DAY` is a constant,
26
+ * so a `day`-unit figure is an 8-hour day whatever the leave type is called. `dayLengthMinutes` on
27
+ * the balance report says so on its face rather than leaving a reader to assume their own.
28
+ *
29
+ * The reports read; nothing here recomputes a day sheet. A "refresh" on a reports page is a write
30
+ * into a month payroll may already have filed, and `AttendanceService.recomputeDay` is the only
31
+ * thing entitled to decide whether a day may move.
32
+ */
33
+
34
+ /**
35
+ * The longest range a report may cover, in days.
36
+ *
37
+ * A year, because an annual overtime figure against a statutory ceiling is a real question and a
38
+ * two-year one is not. An unsliced attendance or overtime report is a single grouped aggregate, so
39
+ * the length costs the database and nothing else.
40
+ */
41
+ export const MAX_REPORT_DAYS = 366
42
+
43
+ /**
44
+ * The longest range a report may cover once it is **sliced**, and the range the absence report is
45
+ * held to whatever it is sliced by.
46
+ *
47
+ * Both walk the resolution ladder once per day in the range, because a number has to be attributed
48
+ * to the office in force on the day it describes rather than the one somebody sits in today. That
49
+ * is a handful of small indexed queries per day; a quarter is fine and a year is not. The absence
50
+ * report pays it unsliced as well, because a person's expected days come from their office's
51
+ * calendar and that is the same walk.
52
+ *
53
+ * The honest fix is a range-aware batch in `ResolveService` — one walk that answers a span rather
54
+ * than a date. Until that exists, this is the cap rather than a slow report nobody can cancel.
55
+ */
56
+ export const MAX_SLICED_REPORT_DAYS = 92
57
+
58
+ /**
59
+ * The most person-days a per-day report will resolve before refusing.
60
+ *
61
+ * `people × days`, and it is a refusal with both numbers in it rather than a timeout: a report that
62
+ * quietly takes four minutes is worse than one that says "1,900 people over 92 days is 174,800
63
+ * person-days — ask for one office, or a shorter range".
64
+ */
65
+ export const MAX_PERSON_DAYS = 60_000
66
+
67
+ /**
68
+ * How a report was narrowed.
69
+ *
70
+ * `workspace` is everybody; `office` and `legal_entity` are what the resolution ladder can answer
71
+ * about a person on a date. **There is no `cost_center`**, and the omission is deliberate:
72
+ * `PersonResolution` carries `primaryOfficeId`, `legalEntityId` and `orgUnitId` and no cost centre,
73
+ * so a cost-centre slice would have to join `employments` inside a report handler — a second
74
+ * resolution ladder, which is the drift `ResolveService`'s header exists to prevent. It arrives
75
+ * when `PersonResolution` grows the field, not before.
76
+ */
77
+ export const ReportSliceBy = z.enum(['workspace', 'office', 'legal_entity'])
78
+ export type ReportSliceBy = z.infer<typeof ReportSliceBy>
79
+
80
+ export const ReportSlice = z.object({
81
+ by: ReportSliceBy,
82
+ /** Null for `workspace`, which needs no id. */
83
+ id: z.uuid().nullable(),
84
+ /** Resolved for the reader, so the report can name its own population without a second call. */
85
+ name: z.string().nullable(),
86
+ })
87
+ export type ReportSlice = z.infer<typeof ReportSlice>
88
+
89
+ /**
90
+ * When a person was attributed to the slice.
91
+ *
92
+ * `each_day` is what everything in this module that computes a *number* already does — a day sheet
93
+ * is rebuilt against the entity in force on the day it covers, a period lock resolves per date, the
94
+ * accrual job resolves on the last day of the period. Copying the nearest list handler, which
95
+ * filters on "assignment with no end date", is the wrong instinct: it hands a transfer's whole
96
+ * previous quarter to the receiving office.
97
+ *
98
+ * `as_of_date` is honest for a balance, which is a position rather than a per-day quantity, and
99
+ * `attributionOn` says which date. `not_applicable` is an unsliced report, where nobody is
100
+ * attributed to anything.
101
+ */
102
+ export const ReportAttribution = z.enum(['each_day', 'as_of_date', 'not_applicable'])
103
+ export type ReportAttribution = z.infer<typeof ReportAttribution>
104
+
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 const ReportScope = z.object({
116
+ /** `hr.report.view`, plus the data key the figures needed. */
117
+ permissions: z.array(z.string()).min(1),
118
+ askedAt: z.literal('workspace'),
119
+ })
120
+ export type ReportScope = z.infer<typeof ReportScope>
121
+
122
+ export const ReportHeader = z.object({
123
+ from: IsoDate,
124
+ to: IsoDate,
125
+ slice: ReportSlice,
126
+ scope: ReportScope,
127
+ /** Everybody the slice covers over the range. **The denominator**, and never omitted. */
128
+ population: z.number().int(),
129
+ /** How many of `population` have anything at all behind the figures. */
130
+ counted: z.number().int(),
131
+ attribution: ReportAttribution,
132
+ /** The date `as_of_date` attribution used. Null for the other two. */
133
+ attributionOn: IsoDate.nullable(),
134
+ /** True when `rows` is the top `limit` of `counted` rather than all of it. */
135
+ truncated: z.boolean(),
136
+ })
137
+ export type ReportHeader = z.infer<typeof ReportHeader>
138
+
139
+ /**
140
+ * Whether the figures can move again.
141
+ *
142
+ * A range that straddles a lock boundary mixes final figures with provisional ones — tonight's
143
+ * `reconcile-days` will change the open half — so a report must never present the mixed total as
144
+ * final. Where a workspace has no periods at all (the `periods` capability ships off), every day is
145
+ * open and that is entirely normal: `final: false` with `lockedDays: 0` is not a warning.
146
+ */
147
+ export const ReportFinality = z.object({
148
+ lockedDays: z.number().int(),
149
+ openDays: z.number().int(),
150
+ /** True only when every day counted sits inside a locked period. */
151
+ final: z.boolean(),
152
+ /** The earliest day still able to move, or null when none is. */
153
+ firstOpenDay: IsoDate.nullable(),
154
+ /** The latest day already frozen, or null when none is. */
155
+ lastLockedDay: IsoDate.nullable(),
156
+ })
157
+ export type ReportFinality = z.infer<typeof ReportFinality>
158
+
159
+ // ---------------------------------------------------------------- attendance summary
160
+
161
+ export const AttendanceSummaryRow = z.object({
162
+ personId: z.uuid(),
163
+ /**
164
+ * The directory name, and the erasure token for somebody who has been erased.
165
+ *
166
+ * Their day sheets and ledger entries survive an erasure by design, so the row stays and the
167
+ * token is shown as it is stored. Dropping the row would change the total; printing "Unknown"
168
+ * would hide that this is a person the workspace deliberately redacted.
169
+ */
170
+ displayName: z.string(),
171
+ /** Day sheets counted. Not the length of the range — a day nobody punched has no sheet. */
172
+ days: z.number().int(),
173
+ scheduledMinutes: z.number().int(),
174
+ workedMinutes: z.number().int(),
175
+ breakMinutes: z.number().int(),
176
+ lateMinutes: z.number().int(),
177
+ earlyLeaveMinutes: z.number().int(),
178
+ /**
179
+ * `worked ÷ scheduled`, 0–1 — **null when nothing was scheduled**.
180
+ *
181
+ * Somebody with no schedule assignment owes no hours, so the denominator is zero and the answer
182
+ * is unknown rather than 0% or 100%. In a workspace that clocks in only part of its staff, that
183
+ * is most of the directory.
184
+ */
185
+ workedRatio: z.number().nullable(),
186
+ /** Sheets produced with no schedule in force, read off the policy stamp rather than guessed. */
187
+ noScheduleDays: z.number().int(),
188
+ /** Sheets with no policy stamp at all, where neither state can be claimed. */
189
+ unknownScheduleDays: z.number().int(),
190
+ })
191
+ export type AttendanceSummaryRow = z.infer<typeof AttendanceSummaryRow>
192
+
193
+ export const AttendanceSummaryTotals = AttendanceSummaryRow.omit({
194
+ personId: true,
195
+ displayName: true,
196
+ })
197
+ export type AttendanceSummaryTotals = z.infer<typeof AttendanceSummaryTotals>
198
+
199
+ export const AttendanceSummaryReport = z.object({
200
+ header: ReportHeader,
201
+ finality: ReportFinality,
202
+ /** Over the whole population, never only the rows returned. */
203
+ totals: AttendanceSummaryTotals,
204
+ rows: z.array(AttendanceSummaryRow),
205
+ })
206
+ export type AttendanceSummaryReport = z.infer<typeof AttendanceSummaryReport>
207
+
208
+ // ---------------------------------------------------------------- overtime
209
+
210
+ export const OvertimeRow = z.object({
211
+ personId: z.uuid(),
212
+ displayName: z.string(),
213
+ days: z.number().int(),
214
+ overtimeMinutes: z.number().int(),
215
+ /**
216
+ * Overtime an annual ceiling would not take — **null when no ceiling was in force on any day
217
+ * counted**, which is not zero.
218
+ *
219
+ * Zero means a ceiling applied and nothing passed it. Null means the question was never asked of
220
+ * these days. Coalescing the two destroys the distinction the column exists for, and it is the
221
+ * distinction a statutory-ceiling conversation turns on.
222
+ */
223
+ beyondCapMinutes: z.number().int().nullable(),
224
+ /** Days a ceiling applied to. Zero here is why `beyondCapMinutes` is null. */
225
+ cappedDays: z.number().int(),
226
+ uncappedDays: z.number().int(),
227
+ })
228
+ export type OvertimeRow = z.infer<typeof OvertimeRow>
229
+
230
+ export const OvertimeTotals = OvertimeRow.omit({ personId: true, displayName: true })
231
+ export type OvertimeTotals = z.infer<typeof OvertimeTotals>
232
+
233
+ export const OvertimeReport = z.object({
234
+ header: ReportHeader,
235
+ finality: ReportFinality,
236
+ totals: OvertimeTotals,
237
+ rows: z.array(OvertimeRow),
238
+ })
239
+ export type OvertimeReport = z.infer<typeof OvertimeReport>
240
+
241
+ // ---------------------------------------------------------------- absence
242
+
243
+ /**
244
+ * What the expected-days figure rests on, per person.
245
+ *
246
+ * `no_schedule` and `no_calendar` are **named rows, not silent drops**. A person with no schedule
247
+ * assignment owes no hours, so "absent" is not a fact this module holds about them — and in a
248
+ * workspace that clocks in only its shift staff they are the majority. An office with no calendar
249
+ * attached would fall back to Monday–Friday, which is an assumption rather than an answer, so the
250
+ * expectation is withheld and the reason is printed instead.
251
+ */
252
+ export const AbsenceBasis = z.enum(['calendar', 'no_calendar', 'no_schedule'])
253
+ export type AbsenceBasis = z.infer<typeof AbsenceBasis>
254
+
255
+ export const AbsenceRow = z.object({
256
+ personId: z.uuid(),
257
+ displayName: z.string(),
258
+ basis: AbsenceBasis,
259
+ /** Working days the calendar expected, weighted for half days. Null unless `basis` is `calendar`. */
260
+ expectedDays: z.number().nullable(),
261
+ /** Expected days with a day sheet showing work. */
262
+ workedDays: z.number().nullable(),
263
+ /**
264
+ * Expected days covered by approved, counted leave.
265
+ *
266
+ * **Null when the `leave` capability is off** rather than zero — the column is omitted, not
267
+ * answered. There is no breakdown by leave type here and there will not be one under this key:
268
+ * the team calendar deliberately withholds the type from anybody without `hr.leave.view_ledger`,
269
+ * so that the team can know somebody is away without knowing it is sick leave, and a per-type
270
+ * column would republish exactly that.
271
+ */
272
+ leaveDays: z.number().nullable(),
273
+ /** `expected − worked − leave`, floored at zero. Null wherever `expectedDays` is. */
274
+ absentDays: z.number().nullable(),
275
+ /** `absent ÷ expected`, 0–1. Null when there was nothing to expect. */
276
+ absenceRate: z.number().nullable(),
277
+ })
278
+ export type AbsenceRow = z.infer<typeof AbsenceRow>
279
+
280
+ export const AbsenceTotals = z.object({
281
+ /** People whose `basis` is `calendar` — the only ones the totals below are computed over. */
282
+ measured: z.number().int(),
283
+ expectedDays: z.number(),
284
+ workedDays: z.number(),
285
+ leaveDays: z.number().nullable(),
286
+ absentDays: z.number(),
287
+ absenceRate: z.number().nullable(),
288
+ })
289
+ export type AbsenceTotals = z.infer<typeof AbsenceTotals>
290
+
291
+ export const AbsenceReport = z.object({
292
+ header: ReportHeader,
293
+ finality: ReportFinality,
294
+ /**
295
+ * Whether approved leave was subtracted at all.
296
+ *
297
+ * False when the `leave` capability is off in this workspace, in which case every `leaveDays` is
298
+ * null and `absentDays` is `expected − worked`. Saying so is what stops a reader treating an
299
+ * inflated absence figure as a fact about attendance.
300
+ */
301
+ leaveCounted: z.boolean(),
302
+ totals: AbsenceTotals,
303
+ /** The two named buckets held out of the denominator, so nobody is dropped in silence. */
304
+ excluded: z.object({ noSchedule: z.number().int(), noCalendar: z.number().int() }),
305
+ rows: z.array(AbsenceRow),
306
+ })
307
+ export type AbsenceReport = z.infer<typeof AbsenceReport>
308
+
309
+ // ---------------------------------------------------------------- leave balance
310
+
311
+ export const LeaveBalanceRow = z.object({
312
+ personId: z.uuid(),
313
+ displayName: z.string(),
314
+ leaveTypeId: z.uuid(),
315
+ leaveTypeName: z.string(),
316
+ unit: LeaveUnit,
317
+ /** The authoritative figures. Minutes, because half days and hourly leave divide a day. */
318
+ balanceMinutes: z.number().int(),
319
+ bookedMinutes: z.number().int(),
320
+ pendingMinutes: z.number().int(),
321
+ availableMinutes: z.number().int(),
322
+ /** The same two in the leave type's own unit, for display. Read `dayLengthMinutes` first. */
323
+ balance: z.number(),
324
+ available: z.number(),
325
+ })
326
+ export type LeaveBalanceRow = z.infer<typeof LeaveBalanceRow>
327
+
328
+ export const LeaveBalanceReport = z.object({
329
+ header: ReportHeader,
330
+ periodYear: z.number().int(),
331
+ /**
332
+ * How long a `day` is when a day-unit figure is rendered here.
333
+ *
334
+ * A constant in this module, not a workspace setting — so "12.5 days" is 12.5 eight-hour days
335
+ * whatever the workspace's own day happens to be. Published rather than assumed, because a report
336
+ * that prints days without saying which day is the quiet way this goes wrong.
337
+ */
338
+ dayLengthMinutes: z.number().int(),
339
+ /**
340
+ * One line per leave type, over the whole population.
341
+ *
342
+ * There is no entitlement, allowance-remaining or projected year-end column, here or on a row.
343
+ * Each of those needs an accrual policy, and a company that grants a fixed allowance on 1 January
344
+ * has none — `PolicyService.forPerson` answers `{ policyId: null }` rather than throwing, and a
345
+ * balance relabelled as an entitlement would be this module inventing the number it declined to
346
+ * guess everywhere else.
347
+ */
348
+ totals: z.array(
349
+ z.object({
350
+ leaveTypeId: z.uuid(),
351
+ leaveTypeName: z.string(),
352
+ unit: LeaveUnit,
353
+ /** People holding a non-zero position in this type. */
354
+ people: z.number().int(),
355
+ balanceMinutes: z.number().int(),
356
+ bookedMinutes: z.number().int(),
357
+ pendingMinutes: z.number().int(),
358
+ availableMinutes: z.number().int(),
359
+ }),
360
+ ),
361
+ rows: z.array(LeaveBalanceRow),
362
+ })
363
+ export type LeaveBalanceReport = z.infer<typeof LeaveBalanceReport>
@@ -69,11 +69,34 @@ import {
69
69
  SensitiveAccess,
70
70
  SubjectAccessBundle,
71
71
  } from './privacy.js'
72
+ import {
73
+ AbsenceReport,
74
+ AttendanceSummaryReport,
75
+ LeaveBalanceReport,
76
+ OvertimeReport,
77
+ ReportSliceBy,
78
+ } from './reports.js'
72
79
 
73
80
  const ws = z.object({ workspaceId: WorkspaceId })
74
81
  const t = ['hr'] as const
75
82
  const ok = z.object({ ok: z.literal(true) })
76
83
 
84
+ /**
85
+ * What every report takes: a range, a slice and how many rows to draw.
86
+ *
87
+ * `limit` bounds the rows, never the figures — `totals` and `population` are computed over everyone
88
+ * the slice covers and `truncated` says when the rows are the top of a longer list. A headline that
89
+ * silently described only the first page would be the exact defect these reports exist to avoid.
90
+ */
91
+ const reportInput = ws.extend({
92
+ from: IsoDate,
93
+ to: IsoDate,
94
+ by: ReportSliceBy.default('workspace'),
95
+ /** Required by `office` and `legal_entity`, ignored by `workspace`. */
96
+ sliceId: z.uuid().optional(),
97
+ limit: z.number().int().min(1).max(1000).default(100),
98
+ })
99
+
77
100
  export const hrContract = {
78
101
  // ---------------------------------------------------------------- people
79
102
  people: {
@@ -1273,6 +1296,93 @@ export const hrContract = {
1273
1296
  * nobody by default and ships in the same change as these — see `privacy.ts` for why there is one
1274
1297
  * key rather than four, and why none of this is a capability.
1275
1298
  */
1299
+ // ---------------------------------------------------------------- reports
1300
+ /**
1301
+ * Four aggregates, and one rule that decides all four: **a report may not answer a question its
1302
+ * row-level procedure would refuse, and may not narrow below what that procedure already
1303
+ * returns.**
1304
+ *
1305
+ * So each of these costs `hr.report.view` *and* the key that already guards the rows it sums —
1306
+ * `hr.attendance.view_team`, which is what reading a whole office's day sheets costs on
1307
+ * `attendance.days.list`, or `hr.leave.view_team`, which is what reading somebody else's balance
1308
+ * costs on `leave.balance.get`. A reader holding neither gets nothing: not a one-row self-report,
1309
+ * because a reports menu that quietly collapses to your own attendance is a menu entry that lies
1310
+ * about what it is, and your own attendance is already the attendance page.
1311
+ *
1312
+ * The population is **not** intersected with `HrAccessService.visiblePersonIds`. That service
1313
+ * narrows *fields* rather than rows — it withholds `personalEmail`, `phone`, `hiredOn` and
1314
+ * `terminatedOn`, none of which any report reads — and intersecting on it would produce the worst
1315
+ * outcome available here: two managers reading different totals under the same title, with
1316
+ * nothing on the page to say so.
1317
+ */
1318
+ reports: {
1319
+ /**
1320
+ * Scheduled against worked, per person, over a range.
1321
+ *
1322
+ * Built from `attendance_days` and never from `punches`: punches are raw and append-only, a
1323
+ * voided punch survives beside its correction, and summing them double-counts every fix. The
1324
+ * day sheet is the projection those punches produce.
1325
+ */
1326
+ attendance: baseContract
1327
+ .route({ method: 'GET', path: '/reports/attendance', tags: t })
1328
+ .input(reportInput)
1329
+ .output(AttendanceSummaryReport),
1330
+
1331
+ /**
1332
+ * Overtime, and how much of it an annual ceiling would not take.
1333
+ *
1334
+ * `beyondCapMinutes` is null where no ceiling was in force — summed as a nullable column rather
1335
+ * than coalesced, so "no ceiling applied to these days" and "a ceiling applied and nothing
1336
+ * passed it" stay different answers. No projection: there is no "at this rate you will pass the
1337
+ * ceiling in November", because that needs a policy that may not exist.
1338
+ */
1339
+ overtime: baseContract
1340
+ .route({ method: 'GET', path: '/reports/overtime', tags: t })
1341
+ .input(reportInput)
1342
+ .output(OvertimeReport),
1343
+
1344
+ /**
1345
+ * Expected working days, minus days worked, minus approved leave.
1346
+ *
1347
+ * **Never `status = 'absent'`.** `attendance_days` has a row only where somebody punched — no
1348
+ * writer creates one for a day nobody clocked in on — so counting absent rows reports near-zero
1349
+ * absence everywhere and looks entirely healthy while doing it. The denominator comes from the
1350
+ * calendar instead, and a person the module cannot build one for lands in a named row rather
1351
+ * than being counted as present.
1352
+ *
1353
+ * Held to `MAX_SLICED_REPORT_DAYS` whether it is sliced or not: every person's expectation is
1354
+ * their office's calendar on each day, which is a ladder walk per day.
1355
+ */
1356
+ absence: baseContract
1357
+ .route({ method: 'GET', path: '/reports/absence', tags: t })
1358
+ .input(reportInput)
1359
+ .output(AbsenceReport),
1360
+
1361
+ /**
1362
+ * Every balance in the population, per leave type, for one entitlement year.
1363
+ *
1364
+ * A balance is a position rather than a per-day quantity, so it is attributed as of one date —
1365
+ * `asOf`, defaulting to today — and the response says so. Summed from `leave_ledger`, never
1366
+ * from `leave_balance_cursor`: the cursor exists to be locked, and a cache that is also the
1367
+ * source of truth is one that eventually disagrees with it.
1368
+ */
1369
+ leaveBalance: baseContract
1370
+ .route({ method: 'GET', path: '/reports/leave-balance', tags: t })
1371
+ .input(
1372
+ ws.extend({
1373
+ /** Defaults to the year `asOf` falls in. */
1374
+ periodYear: z.number().int().min(1970).max(2200).optional(),
1375
+ /** Which day decides who is in the slice. Defaults to today. */
1376
+ asOf: IsoDate.optional(),
1377
+ by: ReportSliceBy.default('workspace'),
1378
+ sliceId: z.uuid().optional(),
1379
+ limit: z.number().int().min(1).max(1000).default(100),
1380
+ }),
1381
+ )
1382
+ .output(LeaveBalanceReport),
1383
+ },
1384
+
1385
+ // ---------------------------------------------------------------- privacy
1276
1386
  privacy: {
1277
1387
  /**
1278
1388
  * Everything HR holds about one person, in one response.