@happyvertical/smrt-support 0.51.32 → 0.51.33

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 (31) hide show
  1. package/dist/index.d.ts +17 -0
  2. package/dist/index.js +1 -1
  3. package/dist/manifest.json +1 -1
  4. package/dist/migrations/moneyMinorUnits.d.ts +30 -1
  5. package/dist/models/service-time-entry.d.ts +2 -1
  6. package/dist/models/support-ai-run.d.ts +11 -1
  7. package/dist/models/support-case-event.d.ts +11 -1
  8. package/dist/models/support-case.d.ts +13 -2
  9. package/dist/models/support-channel-binding.d.ts +11 -1
  10. package/dist/models/support-compensation-plan.d.ts +11 -0
  11. package/dist/models/support-interaction.d.ts +12 -1
  12. package/dist/models/support-plan.d.ts +19 -1
  13. package/dist/models/support-policy.d.ts +11 -0
  14. package/dist/models/support-service-target.d.ts +15 -1
  15. package/dist/models/support-settlement.d.ts +20 -1
  16. package/dist/models/support-specialist.d.ts +15 -1
  17. package/dist/models/support-work-link.d.ts +13 -1
  18. package/dist/permissions.d.ts +12 -1
  19. package/dist/services/coverage-calendar.d.ts +22 -1
  20. package/dist/services/human-handoff-service.d.ts +18 -3
  21. package/dist/services/project-assistance-adapter.d.ts +2 -2
  22. package/dist/services/service-target-engine.d.ts +33 -6
  23. package/dist/services/service-time-entry-service.d.ts +15 -3
  24. package/dist/services/support-ai-workflow.d.ts +22 -5
  25. package/dist/services/support-case-service.d.ts +15 -7
  26. package/dist/services/support-intake-service.d.ts +25 -4
  27. package/dist/services/support-plan-admin-service.d.ts +17 -4
  28. package/dist/services/support-routing-service.d.ts +19 -4
  29. package/dist/services/time-entry-approval-service.d.ts +33 -6
  30. package/dist/smrt-knowledge.json +4 -4
  31. package/package.json +11 -11
@@ -1,10 +1,37 @@
1
- import { SmrtObjectOptions } from '@happyvertical/smrt-core';
2
- import { ServiceTimeEntry, ServiceTimeEntryCollection } from '../models/service-time-entry.js';
3
- import { SupportCase } from '../models/support-case.js';
1
+ /**
2
+ * TimeEntryApprovalService — the approval gate for Service Time Entries and
3
+ * the ONLY writer of their commercial snapshots (FR-36/FR-32/FR-35, issue
4
+ * #1930).
5
+ *
6
+ * Approval paths come from the governing Managed Support Plan's
7
+ * `timeApprovalPolicy`: `automatic` (no principal needed under the
8
+ * thresholds), `threshold` (an over-threshold automatic entry needs an
9
+ * operator), `operator` (the `support.approve-time-entry` split), and
10
+ * `client` (the case's Client, with the operator split as override).
11
+ *
12
+ * On approval two deliberately separate rows derive per entry:
13
+ *
14
+ * - **SupportCharge** — client side, from the Managed Support Plan only:
15
+ * included time consumes first (per case; period windows arrive with usage
16
+ * pricing #1925), the remainder meters at the overage (or on-call) rate.
17
+ * Rate math uses the CASE's `planSnapshot` when present so later plan edits
18
+ * never change history.
19
+ * - **SupportCompensation** — provider side, from the effective-dated Support
20
+ * Compensation Plan only.
21
+ *
22
+ * Margin (charge − compensation) stays computable by readers and is NEVER
23
+ * stored; case-visible audit events carry the charge amount only, never the
24
+ * compensation. Approved entries freeze (model-enforced); disputes flow
25
+ * through {@link TimeEntryApprovalService.correct}, which supersedes the
26
+ * original and re-derives fresh snapshots from the correcting entry.
27
+ */
28
+ import type { SmrtObjectOptions } from '@happyvertical/smrt-core';
29
+ import { type ServiceTimeEntry, ServiceTimeEntryCollection } from '../models/service-time-entry.js';
30
+ import type { SupportCase } from '../models/support-case.js';
4
31
  import { SupportCompensationPlanCollection } from '../models/support-compensation-plan.js';
5
- import { SupportCharge, SupportChargeCollection, SupportCompensation, SupportCompensationCollection } from '../models/support-settlement.js';
6
- import { SupportPrincipal } from '../permissions.js';
7
- import { TimeApprovalPolicy, TimeEntryApprovalPath, TimeEntryEvidence } from '../types.js';
32
+ import { type SupportCharge, SupportChargeCollection, type SupportCompensation, SupportCompensationCollection } from '../models/support-settlement.js';
33
+ import { type SupportPrincipal } from '../permissions.js';
34
+ import type { TimeApprovalPolicy, TimeEntryApprovalPath, TimeEntryEvidence } from '../types.js';
8
35
  import { SupportCaseService } from './support-case-service.js';
9
36
  /** Thrown when an approval-path or tenant gate refuses the acting principal. */
10
37
  export declare class TimeEntryApprovalDeniedError extends Error {
@@ -3,12 +3,12 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-support",
6
- "packageVersion": "0.51.32",
6
+ "packageVersion": "0.51.33",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "bbc42c6222cbbc34e6cc8a0fd73502d03323c1182a4701d25b51001441fbb2e8",
11
- "packageJson": "d589b22822a4acd3e9e09c8149965cad594969c0a6c393c1d3f90a68caec413c",
10
+ "manifest": "1af0eeaf5864a26df69b0d66be551e513e1b4f3cd508c03359b3a15db329446e",
11
+ "packageJson": "9a6b9a7d8aa643c1b2f073eab710d37a761a47e465f23fd672f804ef3a8e4445",
12
12
  "agents": "57d75c4e48c549de0e7e50bfc16d739384cd37f4a0c66f0375d1985b24e6cbdd"
13
13
  },
14
14
  "exports": [
@@ -34,7 +34,7 @@
34
34
  "@types/node": "24.13.6",
35
35
  "svelte": "^5.57.1",
36
36
  "svelte-check": "^4.7.6",
37
- "typescript": "5.9.3",
37
+ "typescript": "6.0.3",
38
38
  "vite": "8.1.4",
39
39
  "vitest": "4.1.10"
40
40
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-support",
3
- "version": "0.51.32",
3
+ "version": "0.51.33",
4
4
  "smrtJsdoc": "strict",
5
5
  "description": "AI-first Support Cases: channel-neutral intake, lifecycle, routing, service targets, and service time for the SMRT framework",
6
6
  "type": "module",
@@ -27,14 +27,14 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@happyvertical/logger": "^0.94.1",
30
- "@happyvertical/smrt-chat": "0.51.32",
31
- "@happyvertical/smrt-core": "0.51.32",
32
- "@happyvertical/smrt-jobs": "0.51.32",
33
- "@happyvertical/smrt-messages": "0.51.32",
34
- "@happyvertical/smrt-projects": "0.51.32",
35
- "@happyvertical/smrt-tenancy": "0.51.32",
36
- "@happyvertical/smrt-ui": "0.51.32",
37
- "@happyvertical/smrt-users": "0.51.32",
30
+ "@happyvertical/smrt-chat": "0.51.33",
31
+ "@happyvertical/smrt-core": "0.51.33",
32
+ "@happyvertical/smrt-jobs": "0.51.33",
33
+ "@happyvertical/smrt-messages": "0.51.33",
34
+ "@happyvertical/smrt-projects": "0.51.33",
35
+ "@happyvertical/smrt-tenancy": "0.51.33",
36
+ "@happyvertical/smrt-ui": "0.51.33",
37
+ "@happyvertical/smrt-users": "0.51.33",
38
38
  "@happyvertical/sql": "^0.94.1"
39
39
  },
40
40
  "peerDependencies": {
@@ -46,13 +46,13 @@
46
46
  }
47
47
  },
48
48
  "devDependencies": {
49
- "@happyvertical/smrt-vitest": "0.51.32",
49
+ "@happyvertical/smrt-vitest": "0.51.33",
50
50
  "@sveltejs/package": "^2.5.8",
51
51
  "@sveltejs/vite-plugin-svelte": "^7.3.0",
52
52
  "@types/node": "24.13.6",
53
53
  "svelte": "^5.57.1",
54
54
  "svelte-check": "^4.7.6",
55
- "typescript": "5.9.3",
55
+ "typescript": "6.0.3",
56
56
  "vite": "8.1.4",
57
57
  "vitest": "4.1.10"
58
58
  },