@kernhq/module-hr 0.14.1 → 0.16.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 (35) hide show
  1. package/dist/contract/router.d.ts +14 -2
  2. package/dist/contract/router.d.ts.map +1 -1
  3. package/dist/contract/router.js +11 -2
  4. package/dist/contract/router.js.map +1 -1
  5. package/dist/server/index.d.ts.map +1 -1
  6. package/dist/server/index.js +51 -0
  7. package/dist/server/index.js.map +1 -1
  8. package/dist/server/jobs.d.ts +5 -2
  9. package/dist/server/jobs.d.ts.map +1 -1
  10. package/dist/server/jobs.js +109 -2
  11. package/dist/server/jobs.js.map +1 -1
  12. package/dist/server/router.d.ts +122 -2
  13. package/dist/server/router.d.ts.map +1 -1
  14. package/dist/server/router.js +448 -274
  15. package/dist/server/router.js.map +1 -1
  16. package/dist/server/schema.d.ts +85 -0
  17. package/dist/server/schema.d.ts.map +1 -1
  18. package/dist/server/schema.js +32 -0
  19. package/dist/server/schema.js.map +1 -1
  20. package/dist/server/services/approvals.d.ts +150 -6
  21. package/dist/server/services/approvals.d.ts.map +1 -1
  22. package/dist/server/services/approvals.js +428 -26
  23. package/dist/server/services/approvals.js.map +1 -1
  24. package/migrations/0010_approval_timeouts.sql +28 -0
  25. package/migrations/meta/0010_snapshot.json +4263 -0
  26. package/migrations/meta/_journal.json +8 -1
  27. package/package.json +1 -1
  28. package/src/client/components/DecisionDialog.svelte +99 -7
  29. package/src/client/messages.ts +85 -0
  30. package/src/client/mock.ts +256 -15
  31. package/src/client/pages/ApprovalsPage.svelte +256 -27
  32. package/src/client/pages/DirectoryPage.svelte +1 -1
  33. package/src/client/query.ts +2 -2
  34. package/src/client/widgets/ApprovalsWidget.svelte +120 -9
  35. package/src/contract/router.ts +11 -2
@@ -0,0 +1,28 @@
1
+ -- A step's deadline, and what happens when it passes.
2
+ --
3
+ -- `slaHours` and `onTimeout` have been in the chain editor since the day it shipped and nothing has
4
+ -- ever read them, so a step with a 24-hour SLA waited exactly as long as a step with none. The
5
+ -- `approval-timeouts` job reads them now, and it needs three things this table could not say:
6
+ --
7
+ -- * `on_timeout` and `sla_hours` on the step itself. They cannot be read back out of the snapshot in
8
+ -- `approval_requests.chain`, because a step whose approvers resolve to nobody is dropped rather
9
+ -- than stored — so `step_index` counts the steps that were written and the spec's array counts the
10
+ -- steps that were asked for, and the two stop agreeing the moment one is dropped.
11
+ -- * `timeout_handled_at` with `timeout_action`. The sweep runs hourly against a deadline that stays
12
+ -- passed, so this is the whole of what stops one step being reminded every hour for ever. The pair
13
+ -- is also readable beside `on_timeout` without a log: `on_timeout = 'escalate'` with
14
+ -- `timeout_action = 'remind'` is an escalation that had nobody above to go to.
15
+ -- * `source` on the decision. An auto-approval is a decision and is recorded as one, but it is not a
16
+ -- person's, and a row that cannot say so is one somebody eventually reads as "her manager approved
17
+ -- it". `approver_id` carries the nil UUID, which `uuidv7()` cannot produce; this column says why.
18
+ --
19
+ -- Additive and defaulted, so the image before this one reads both tables unchanged: `on_timeout`
20
+ -- defaults to the mildest of the three actions and every step raised before today therefore only
21
+ -- ever gets reminded. Generated by drizzle-kit and then given `if not exists`, because a migration
22
+ -- re-run after an edit must be a no-op — drizzle keys applied migrations by content hash, so editing
23
+ -- any file in this folder replays every file in it.
24
+ ALTER TABLE "mod_hr"."approval_decisions" ADD COLUMN IF NOT EXISTS "source" text DEFAULT 'human' NOT NULL;--> statement-breakpoint
25
+ ALTER TABLE "mod_hr"."approval_steps" ADD COLUMN IF NOT EXISTS "on_timeout" text DEFAULT 'remind' NOT NULL;--> statement-breakpoint
26
+ ALTER TABLE "mod_hr"."approval_steps" ADD COLUMN IF NOT EXISTS "sla_hours" integer;--> statement-breakpoint
27
+ ALTER TABLE "mod_hr"."approval_steps" ADD COLUMN IF NOT EXISTS "timeout_handled_at" timestamp with time zone;--> statement-breakpoint
28
+ ALTER TABLE "mod_hr"."approval_steps" ADD COLUMN IF NOT EXISTS "timeout_action" text;