@happyvertical/smrt-projects 0.52.0 → 0.53.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.
- package/AGENTS.md +20 -9
- package/README.md +13 -1
- package/SERVICE_TIME_MIGRATION.md +45 -3
- package/dist/index.js +123 -586
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +3 -1484
- package/dist/models/service-evidence.d.ts +13 -92
- package/dist/models/service-evidence.d.ts.map +1 -1
- package/dist/playground.js +2 -2
- package/dist/playground.js.map +1 -1
- package/dist/services/service-evidence-service.d.ts +6 -55
- package/dist/services/service-evidence-service.d.ts.map +1 -1
- package/dist/services/subscription-commercial-resolver.d.ts +1 -1
- package/dist/services/subscription-commercial-resolver.d.ts.map +1 -1
- package/dist/smrt-knowledge.json +10 -1068
- package/dist/svelte/components/ApprovalActions.svelte +1 -1
- package/dist/svelte/components/ApprovalActions.svelte.d.ts +1 -1
- package/dist/svelte/components/ApprovalActions.svelte.d.ts.map +1 -1
- package/dist/svelte/components/__tests__/TimesheetsReexports.test.js +18 -0
- package/dist/svelte/i18n.d.ts +0 -9
- package/dist/svelte/i18n.d.ts.map +1 -1
- package/dist/svelte/i18n.js +0 -9
- package/dist/svelte/index.d.ts +2 -8
- package/dist/svelte/index.d.ts.map +1 -1
- package/dist/svelte/index.js +3 -4
- package/dist/svelte/playground.d.ts +7 -2
- package/dist/svelte/playground.d.ts.map +1 -1
- package/dist/svelte/playground.js +7 -2
- package/dist/svelte/utils.d.ts +4 -48
- package/dist/svelte/utils.d.ts.map +1 -1
- package/dist/svelte/utils.js +4 -56
- package/dist/svelte/utils.test.js +1 -1
- package/dist/types.d.ts +1 -10
- package/dist/types.d.ts.map +1 -1
- package/package.json +18 -18
- package/dist/svelte/components/DurationDisplay.svelte +0 -81
- package/dist/svelte/components/DurationDisplay.svelte.d.ts +0 -20
- package/dist/svelte/components/DurationDisplay.svelte.d.ts.map +0 -1
- package/dist/svelte/components/TimeEntryCard.svelte +0 -304
- package/dist/svelte/components/TimeEntryCard.svelte.d.ts +0 -25
- package/dist/svelte/components/TimeEntryCard.svelte.d.ts.map +0 -1
- package/dist/svelte/components/TimeEntryList.svelte +0 -360
- package/dist/svelte/components/TimeEntryList.svelte.d.ts +0 -24
- package/dist/svelte/components/TimeEntryList.svelte.d.ts.map +0 -1
- package/dist/svelte/components/TimeSummary.svelte +0 -176
- package/dist/svelte/components/TimeSummary.svelte.d.ts +0 -30
- package/dist/svelte/components/TimeSummary.svelte.d.ts.map +0 -1
- package/dist/svelte/components/__tests__/DurationDisplay.test.js +0 -57
- package/dist/svelte/components/__tests__/TimeEntryCard.test.js +0 -45
- package/dist/svelte/components/__tests__/TimeEntryList.test.js +0 -50
- package/dist/svelte/components/__tests__/TimeSummary.test.js +0 -39
- package/dist/svelte/components/utils.d.ts +0 -51
- package/dist/svelte/components/utils.d.ts.map +0 -1
- package/dist/svelte/components/utils.js +0 -58
package/AGENTS.md
CHANGED
|
@@ -29,13 +29,20 @@ request/delivery projections.
|
|
|
29
29
|
- `ManagedProjectClient` deliberately exposes no repository or board client;
|
|
30
30
|
delivery and assistance use separate capability-gated service facades.
|
|
31
31
|
|
|
32
|
-
## Shared Professional Service evidence (#1955)
|
|
32
|
+
## Shared Professional Service evidence (#1955, #3288)
|
|
33
33
|
|
|
34
|
-
`ServiceTimeEntry`
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
`ServiceTimeEntry`, `ServiceChargeSnapshot`, `ServiceCompensationSnapshot`,
|
|
35
|
+
their collections, and `ServiceEvidenceService` are owned by
|
|
36
|
+
`@happyvertical/smrt-timesheets` (#3288) and **re-exported** here unchanged,
|
|
37
|
+
on the unchanged `service_time_entries` / snapshot tables. Do not reintroduce
|
|
38
|
+
a projects subclass: a third same-named class on the table breaks the
|
|
39
|
+
single-table-family resolution (see `packages/timesheets/AGENTS.md`).
|
|
40
|
+
`caseId` / `specialistId` exist only on smrt-support's subtype;
|
|
41
|
+
`SubscriptionServiceCommercialResolver` reads them duck-typed when a support
|
|
42
|
+
entry is priced. It prices client work through `smrt-subscriptions` (#1925);
|
|
43
|
+
provider compensation remains a separate resolver and snapshot. The
|
|
44
|
+
time-entry Svelte components are re-exported from smrt-timesheets too. See
|
|
45
|
+
`SERVICE_TIME_MIGRATION.md`.
|
|
39
46
|
|
|
40
47
|
## Models
|
|
41
48
|
|
|
@@ -63,13 +70,17 @@ All collections provide: `discover({ repository, filters })`, `findByRepository(
|
|
|
63
70
|
|
|
64
71
|
- **Money is integer minor units** (cents) — `$19.99` is `1999`.
|
|
65
72
|
`ServiceChargeSnapshot.amount` and `ServiceCompensationSnapshot.amount`
|
|
73
|
+
(declared in smrt-timesheets)
|
|
66
74
|
initialize `= 0`, never `= 0.0`: the integer literal is what maps them to
|
|
67
75
|
INTEGER columns (BIGINT on fresh PostgreSQL/DuckDB databases; #2401, #2373). The two convert as a pair — the delivery margin is
|
|
68
76
|
`charge - compensation`, an exact integer subtraction with no tolerance —
|
|
69
77
|
and both are fed verbatim by `CommercialSnapshot.amount`, so a resolver that
|
|
70
|
-
returns major units
|
|
71
|
-
`
|
|
72
|
-
|
|
78
|
+
returns major units is wrong on every engine: snapshot `save()` refuses a
|
|
79
|
+
fractional value (`19.99`) on SQLite and PostgreSQL alike, but a whole
|
|
80
|
+
major-unit value (`150` for $150.00) is a valid integer and is stored
|
|
81
|
+
100× too small. `pnpm --filter @happyvertical/smrt-timesheets
|
|
82
|
+
test:postgres` is the lane that holds the line (moved with the snapshots in
|
|
83
|
+
#3288).
|
|
73
84
|
- **UI formats by dividing, never by `toFixed`**: `formatCurrency()` and
|
|
74
85
|
`ServiceEvidenceList`'s `money()` scale back to major units using the
|
|
75
86
|
currency's own minor-unit exponent, so zero-decimal currencies (JPY, KRW) are
|
package/README.md
CHANGED
|
@@ -5,9 +5,21 @@ Provider-agnostic project management models for the s-m-r-t framework. Manages r
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
pnpm add @happyvertical/smrt-projects
|
|
8
|
+
pnpm add @happyvertical/smrt-projects @happyvertical/smrt-timesheets
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
Time entries and their commercial snapshots live in
|
|
12
|
+
[`smrt-timesheets`](../timesheets/README.md) (#3288); smrt-projects re-exports
|
|
13
|
+
them. Under pnpm, declare `@happyvertical/smrt-timesheets` directly: the CLI's
|
|
14
|
+
manifest discovery reads only top-level packages, so without it `smrt
|
|
15
|
+
db:migrate` / `db:status` stop planning `service_time_entries`,
|
|
16
|
+
`service_charge_snapshots`, and `service_compensation_snapshots`. Their old
|
|
17
|
+
`@happyvertical/smrt-projects:*` class names keep resolving as deprecated
|
|
18
|
+
aliases; move source references to `@happyvertical/smrt-timesheets:*` (for
|
|
19
|
+
`ServiceTimeEntry` in an app with smrt-support installed, to
|
|
20
|
+
`@happyvertical/smrt-support:ServiceTimeEntry`). See
|
|
21
|
+
[SERVICE_TIME_MIGRATION.md](./SERVICE_TIME_MIGRATION.md).
|
|
22
|
+
|
|
11
23
|
## Usage
|
|
12
24
|
|
|
13
25
|
```typescript
|
|
@@ -1,7 +1,46 @@
|
|
|
1
1
|
# Service Time Entry migration
|
|
2
2
|
|
|
3
3
|
`ServiceTimeEntry` moved from `@happyvertical/smrt-support` to
|
|
4
|
-
`@happyvertical/smrt-projects` in issue #1955
|
|
4
|
+
`@happyvertical/smrt-projects` in issue #1955, and from there to
|
|
5
|
+
`@happyvertical/smrt-timesheets` in issue #3288. smrt-projects re-exports the
|
|
6
|
+
entry, its snapshots, their collections, and `ServiceEvidenceService`
|
|
7
|
+
unchanged; `caseId` / `specialistId` now exist only on smrt-support's subtype.
|
|
8
|
+
Consumers holding `service_time_entries` rows need no schema change — see the
|
|
9
|
+
smrt-timesheets README ("Migrating from smrt-projects / smrt-support").
|
|
10
|
+
|
|
11
|
+
**pnpm consumers must add a direct `@happyvertical/smrt-timesheets`
|
|
12
|
+
dependency.** The CLI's manifest discovery (`smrt db:migrate`, `db:status`,
|
|
13
|
+
`db:diff`) reads only top-level `node_modules` packages, and smrt-projects'
|
|
14
|
+
own manifest no longer declares the moved models. Without the direct
|
|
15
|
+
dependency, `service_time_entries`, `service_charge_snapshots`, and
|
|
16
|
+
`service_compensation_snapshots` drop out of the planned schema: a fresh
|
|
17
|
+
database never gets them (so `ServiceEvidenceService` fails the runtime table
|
|
18
|
+
check), and an existing database reports them as orphan tables. npm and Yarn
|
|
19
|
+
hoist the package and are unaffected.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add @happyvertical/smrt-timesheets
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Old class names keep resolving as deprecated aliases.** The moved classes
|
|
26
|
+
declare `previousQualifiedNames` (#3338), so stored or declared
|
|
27
|
+
`@happyvertical/smrt-projects:ServiceTimeEntry`, `:ServiceChargeSnapshot`, and
|
|
28
|
+
`:ServiceCompensationSnapshot` references — polymorphic `meta_type` rows,
|
|
29
|
+
`@crossPackageRef` and relationship targets, playbook `model:` names — resolve
|
|
30
|
+
to the `@happyvertical/smrt-timesheets:*` classes with a one-time deprecation
|
|
31
|
+
warning, and new association writes store the current name. `smrt doctor --db`
|
|
32
|
+
counts remaining stored references; `smrt db:migrate-qualified-names` is the
|
|
33
|
+
opt-in backfill. Move source references to the name of the class your
|
|
34
|
+
application registers before the aliases are removed in a later breaking
|
|
35
|
+
release: `@happyvertical/smrt-timesheets:*`, except
|
|
36
|
+
`@happyvertical/smrt-support:ServiceTimeEntry` when smrt-support is installed
|
|
37
|
+
(its subtype replaces the timesheets entry, whose name then does not resolve)
|
|
38
|
+
or your own closing subclass's name. A same-named subtype that replaces a
|
|
39
|
+
moved class also drops its alias for now — with smrt-support installed the
|
|
40
|
+
`ServiceTimeEntry` alias does not resolve; see the smrt-timesheets README for
|
|
41
|
+
the workaround.
|
|
42
|
+
|
|
43
|
+
The #1955 notes below still describe the support side.
|
|
5
44
|
|
|
6
45
|
There is no data migration and no duplicate table. The support import is a
|
|
7
46
|
compatibility subtype over the shared class; it restates the schema so an
|
|
@@ -9,10 +48,13 @@ isolated support manifest remains self-contained, while both paths map to the
|
|
|
9
48
|
existing `service_time_entries` table:
|
|
10
49
|
|
|
11
50
|
```ts
|
|
12
|
-
// Preferred shared import
|
|
51
|
+
// Preferred shared import (#3288)
|
|
52
|
+
import { ServiceTimeEntry, ServiceEvidenceService } from '@happyvertical/smrt-timesheets';
|
|
53
|
+
|
|
54
|
+
// Still supported: the same classes, re-exported
|
|
13
55
|
import { ServiceTimeEntry, ServiceEvidenceService } from '@happyvertical/smrt-projects';
|
|
14
56
|
|
|
15
|
-
//
|
|
57
|
+
// Support subtype with caseId / specialistId
|
|
16
58
|
import { ServiceTimeEntry } from '@happyvertical/smrt-support';
|
|
17
59
|
```
|
|
18
60
|
|