@happyvertical/smrt-projects 0.52.0 → 0.53.1
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
|
@@ -1,95 +1,16 @@
|
|
|
1
|
-
import { SmrtCollection, SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
-
import type { ServiceEvidence, ServiceParticipantKind, ServiceTimeEntrySource, ServiceTimeEntryStatus } from '../types.js';
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Professional Service evidence (time entries and their commercial
|
|
3
|
+
* snapshots) is owned by `@happyvertical/smrt-timesheets` (#3288; it was
|
|
4
|
+
* canonical here per #1955). The same classes are re-exported under their
|
|
5
|
+
* existing names so `@happyvertical/smrt-projects` imports keep working, and
|
|
6
|
+
* they still map to the existing `service_time_entries`,
|
|
7
|
+
* `service_charge_snapshots`, and `service_compensation_snapshots` tables, so
|
|
8
|
+
* stored rows load with no schema change.
|
|
9
|
+
*
|
|
10
|
+
* These are re-exports, not subclasses: classes on one table must form a
|
|
11
|
+
* single inheritance chain, and smrt-support's subtype (which adds `caseId` /
|
|
12
|
+
* `specialistId`) is the one link a chain of same-named classes can carry.
|
|
13
|
+
* See `packages/timesheets/AGENTS.md`.
|
|
6
14
|
*/
|
|
7
|
-
export
|
|
8
|
-
tenantId: string | null;
|
|
9
|
-
caseId: string | null;
|
|
10
|
-
workRefType: string | null;
|
|
11
|
-
workRefId: string | null;
|
|
12
|
-
specialistId: string | null;
|
|
13
|
-
participantKind: ServiceParticipantKind;
|
|
14
|
-
participantProfileId: string | null;
|
|
15
|
-
agentRef: string;
|
|
16
|
-
source: ServiceTimeEntrySource;
|
|
17
|
-
description: string;
|
|
18
|
-
startedAt: Date | null;
|
|
19
|
-
endedAt: Date | null;
|
|
20
|
-
durationSeconds: number;
|
|
21
|
-
evidence: string;
|
|
22
|
-
status: ServiceTimeEntryStatus;
|
|
23
|
-
submittedAt: Date | null;
|
|
24
|
-
submittedByProfileId: string | null;
|
|
25
|
-
approvedAt: Date | null;
|
|
26
|
-
approvedByProfileId: string | null;
|
|
27
|
-
approvalPath: string;
|
|
28
|
-
rejectedAt: Date | null;
|
|
29
|
-
rejectedByProfileId: string | null;
|
|
30
|
-
rejectionReason: string;
|
|
31
|
-
correctionOfId: string | null;
|
|
32
|
-
metadata: string;
|
|
33
|
-
getEvidence(): ServiceEvidence[];
|
|
34
|
-
setEvidence(value: ServiceEvidence[]): void;
|
|
35
|
-
getMetadata(): Record<string, unknown>;
|
|
36
|
-
setMetadata(value: Record<string, unknown>): void;
|
|
37
|
-
durationHours(): number;
|
|
38
|
-
initialize(): Promise<this>;
|
|
39
|
-
save(): Promise<this>;
|
|
40
|
-
private readPrior;
|
|
41
|
-
}
|
|
42
|
-
export declare class ServiceChargeSnapshot extends SmrtObject {
|
|
43
|
-
tenantId: string | null;
|
|
44
|
-
timeEntryId: string;
|
|
45
|
-
/**
|
|
46
|
-
* Client charge in **integer minor units** of {@link currency} — `$19.99` is
|
|
47
|
-
* `1999`. The `= 0` initializer is load-bearing: SMRT maps an integer literal
|
|
48
|
-
* to INTEGER and a decimal literal to DECIMAL (#2401).
|
|
49
|
-
*
|
|
50
|
-
* Copied verbatim from the upstream `ClientCharge.amount`, so the two carry
|
|
51
|
-
* the same unit by construction; a split would land cents in a major-units
|
|
52
|
-
* column with no error anywhere.
|
|
53
|
-
*/
|
|
54
|
-
amount: number;
|
|
55
|
-
currency: string;
|
|
56
|
-
pricingVersion: string;
|
|
57
|
-
strategy: string;
|
|
58
|
-
rateSnapshot: string;
|
|
59
|
-
sourceChargeRef: string;
|
|
60
|
-
createdAt: Date;
|
|
61
|
-
initialize(): Promise<this>;
|
|
62
|
-
save(): Promise<this>;
|
|
63
|
-
}
|
|
64
|
-
export declare class ServiceCompensationSnapshot extends SmrtObject {
|
|
65
|
-
tenantId: string | null;
|
|
66
|
-
timeEntryId: string;
|
|
67
|
-
/**
|
|
68
|
-
* Provider earning in **integer minor units** of {@link currency} (#2401).
|
|
69
|
-
*
|
|
70
|
-
* Converts with {@link ServiceChargeSnapshot.amount}: the delivery margin is
|
|
71
|
-
* `charge - compensation`, so a mixed pair would make that subtraction
|
|
72
|
-
* meaningless.
|
|
73
|
-
*/
|
|
74
|
-
amount: number;
|
|
75
|
-
currency: string;
|
|
76
|
-
termsVersion: string;
|
|
77
|
-
rateSnapshot: string;
|
|
78
|
-
createdAt: Date;
|
|
79
|
-
initialize(): Promise<this>;
|
|
80
|
-
save(): Promise<this>;
|
|
81
|
-
}
|
|
82
|
-
export declare class ServiceTimeEntryCollection extends SmrtCollection<ServiceTimeEntry> {
|
|
83
|
-
static readonly _itemClass: typeof ServiceTimeEntry;
|
|
84
|
-
forWork(workRefType: string, workRefId: string): Promise<ServiceTimeEntry[]>;
|
|
85
|
-
forCase(caseId: string): Promise<ServiceTimeEntry[]>;
|
|
86
|
-
forSpecialist(specialistId: string): Promise<ServiceTimeEntry[]>;
|
|
87
|
-
pendingApproval(): Promise<ServiceTimeEntry[]>;
|
|
88
|
-
}
|
|
89
|
-
export declare class ServiceChargeSnapshotCollection extends SmrtCollection<ServiceChargeSnapshot> {
|
|
90
|
-
static readonly _itemClass: typeof ServiceChargeSnapshot;
|
|
91
|
-
}
|
|
92
|
-
export declare class ServiceCompensationSnapshotCollection extends SmrtCollection<ServiceCompensationSnapshot> {
|
|
93
|
-
static readonly _itemClass: typeof ServiceCompensationSnapshot;
|
|
94
|
-
}
|
|
15
|
+
export { ServiceChargeSnapshot, ServiceChargeSnapshotCollection, ServiceCompensationSnapshot, ServiceCompensationSnapshotCollection, ServiceTimeEntry, ServiceTimeEntryCollection, } from '@happyvertical/smrt-timesheets';
|
|
95
16
|
//# sourceMappingURL=service-evidence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-evidence.d.ts","sourceRoot":"","sources":["../../src/models/service-evidence.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"service-evidence.d.ts","sourceRoot":"","sources":["../../src/models/service-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,2BAA2B,EAC3B,qCAAqC,EACrC,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC"}
|
package/dist/playground.js
CHANGED
|
@@ -38,8 +38,8 @@ var totalHours = sampleTimeEntries.reduce((sum, entry) => sum + entry.hours, 0);
|
|
|
38
38
|
var totalAmount = sampleTimeEntries.reduce((sum, entry) => sum + (entry.amount ?? 0), 0);
|
|
39
39
|
var pendingEntries = sampleTimeEntries.filter((entry) => entry.status === "submitted");
|
|
40
40
|
var loadApprovalActions = () => import("./svelte/components/ApprovalActions.svelte");
|
|
41
|
-
var loadTimeEntryList = () => import("
|
|
42
|
-
var loadTimeSummary = () => import("
|
|
41
|
+
var loadTimeEntryList = () => import("@happyvertical/smrt-timesheets/svelte").then((module) => ({ default: module.TimeEntryList }));
|
|
42
|
+
var loadTimeSummary = () => import("@happyvertical/smrt-timesheets/svelte").then((module) => ({ default: module.TimeSummary }));
|
|
43
43
|
var loadDevelopmentBoard = () => import("./svelte/DevelopmentBoard.svelte");
|
|
44
44
|
var loadProjectBoard = () => import("./svelte/ProjectBoard.svelte");
|
|
45
45
|
var playground_default = {
|
package/dist/playground.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.js","names":[],"sources":["../src/svelte/playground.ts"],"sourcesContent":["import { PROJECTS_MODULE_META } from '../ui.js';\n\nconst noop = () => {};\n\n// Money is integer minor units (#2401): 6.5 h x 12000 (=$120.00/h) = 78000.\nconst sampleTimeEntries = [\n {\n id: 'time-entry-1',\n date: '2026-03-18T16:00:00.000Z',\n hours: 6.5,\n description: 'Editorial governance review and fact-linking pass',\n status: 'submitted',\n amount: 78000,\n workerName: 'Taylor Rowan',\n hourlyRate: 12000,\n mileage: 18,\n },\n {\n id: 'time-entry-2',\n date: '2026-03-19T16:00:00.000Z',\n hours: 4.25,\n description: 'Content workflow instrumentation and approval QA',\n status: 'approved',\n amount: 51000,\n workerName: 'Jordan Lee',\n hourlyRate: 12000,\n },\n {\n id: 'time-entry-3',\n date: '2026-03-20T16:00:00.000Z',\n hours: 2,\n description: 'Follow-up revisions for contributor feedback',\n status: 'draft',\n amount: 24000,\n workerName: 'Casey Tran',\n hourlyRate: 12000,\n },\n];\n\nconst totalHours = sampleTimeEntries.reduce(\n (sum, entry) => sum + entry.hours,\n 0,\n);\nconst totalAmount = sampleTimeEntries.reduce(\n (sum, entry) => sum + (entry.amount ?? 0),\n 0,\n);\nconst pendingEntries = sampleTimeEntries.filter(\n (entry) => entry.status === 'submitted',\n);\n\nconst loadApprovalActions = () => import('./components/ApprovalActions.svelte');\nconst loadTimeEntryList = ()
|
|
1
|
+
{"version":3,"file":"playground.js","names":[],"sources":["../src/svelte/playground.ts"],"sourcesContent":["import type {\n TimeEntryList,\n TimeSummary,\n} from '@happyvertical/smrt-timesheets/svelte';\nimport { PROJECTS_MODULE_META } from '../ui.js';\n\nconst noop = () => {};\n\n// Money is integer minor units (#2401): 6.5 h x 12000 (=$120.00/h) = 78000.\nconst sampleTimeEntries = [\n {\n id: 'time-entry-1',\n date: '2026-03-18T16:00:00.000Z',\n hours: 6.5,\n description: 'Editorial governance review and fact-linking pass',\n status: 'submitted',\n amount: 78000,\n workerName: 'Taylor Rowan',\n hourlyRate: 12000,\n mileage: 18,\n },\n {\n id: 'time-entry-2',\n date: '2026-03-19T16:00:00.000Z',\n hours: 4.25,\n description: 'Content workflow instrumentation and approval QA',\n status: 'approved',\n amount: 51000,\n workerName: 'Jordan Lee',\n hourlyRate: 12000,\n },\n {\n id: 'time-entry-3',\n date: '2026-03-20T16:00:00.000Z',\n hours: 2,\n description: 'Follow-up revisions for contributor feedback',\n status: 'draft',\n amount: 24000,\n workerName: 'Casey Tran',\n hourlyRate: 12000,\n },\n];\n\nconst totalHours = sampleTimeEntries.reduce(\n (sum, entry) => sum + entry.hours,\n 0,\n);\nconst totalAmount = sampleTimeEntries.reduce(\n (sum, entry) => sum + (entry.amount ?? 0),\n 0,\n);\nconst pendingEntries = sampleTimeEntries.filter(\n (entry) => entry.status === 'submitted',\n);\n\nconst loadApprovalActions = () => import('./components/ApprovalActions.svelte');\n// The time-entry components live in smrt-timesheets (#3288).\nconst loadTimeEntryList = (): Promise<{ default: typeof TimeEntryList }> =>\n import('@happyvertical/smrt-timesheets/svelte').then((module) => ({\n default: module.TimeEntryList,\n }));\nconst loadTimeSummary = (): Promise<{ default: typeof TimeSummary }> =>\n import('@happyvertical/smrt-timesheets/svelte').then((module) => ({\n default: module.TimeSummary,\n }));\nconst loadDevelopmentBoard = () => import('./DevelopmentBoard.svelte');\nconst loadProjectBoard = () => import('./ProjectBoard.svelte');\n\nexport default {\n packageName: '@happyvertical/smrt-projects',\n displayName: PROJECTS_MODULE_META.displayName,\n description: PROJECTS_MODULE_META.description,\n moduleMeta: PROJECTS_MODULE_META,\n entries: [\n {\n id: 'project-board',\n title: 'Project Board',\n description: 'Controlled provider project board with canonical statuses.',\n loadComponent: loadProjectBoard,\n order: 0,\n props: {\n projectId: 'project-demo',\n statuses: [\n { id: 'todo', name: 'Todo', order: 0 },\n { id: 'done', name: 'Done', order: 1 },\n ],\n items: [\n {\n id: 'item-demo',\n contentId: 'content-demo',\n title: 'Publish project board',\n status: 'Todo',\n fields: {},\n type: 'Issue',\n },\n ],\n },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'development-board',\n title: 'Development Board',\n description: 'Read-only delivery-status projection.',\n loadComponent: loadDevelopmentBoard,\n order: 1,\n props: {\n requests: [\n {\n id: 'request-demo',\n description: 'Publish project board',\n type: 'feature',\n status: 'planned',\n requesterLabel: 'Project owner',\n },\n ],\n },\n modes: { mock: { label: 'Mock' } },\n },\n {\n id: 'time-entry-list',\n title: 'Time Entry List',\n description:\n 'Selectable list view for recent time entries with billing context.',\n loadComponent: loadTimeEntryList,\n order: 2,\n props: {\n entries: sampleTimeEntries,\n selectable: true,\n selectedIds: ['time-entry-1'],\n currency: 'CAD',\n onselectionchange: noop,\n baseHref: '/projects/time-entries',\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'time-summary',\n title: 'Time Summary',\n description: 'Hours and value summary cards for a project review period.',\n loadComponent: loadTimeSummary,\n order: 3,\n props: {\n totalHours,\n totalAmount,\n pendingHours: pendingEntries.reduce(\n (sum, entry) => sum + entry.hours,\n 0,\n ),\n pendingAmount: pendingEntries.reduce(\n (sum, entry) => sum + (entry.amount ?? 0),\n 0,\n ),\n approvedHours: sampleTimeEntries\n .filter((entry) => entry.status === 'approved')\n .reduce((sum, entry) => sum + entry.hours, 0),\n approvedAmount: sampleTimeEntries\n .filter((entry) => entry.status === 'approved')\n .reduce((sum, entry) => sum + (entry.amount ?? 0), 0),\n entryCount: sampleTimeEntries.length,\n currency: 'CAD',\n showApproved: true,\n },\n modes: {\n mock: {\n label: 'Mock',\n },\n },\n },\n {\n id: 'approval-actions',\n title: 'Approval Actions',\n description:\n 'Status-sensitive action row for approving or returning submitted work.',\n loadComponent: loadApprovalActions,\n order: 4,\n props: {\n status: 'submitted',\n onapprove: noop,\n on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;AACF"}
|
|
@@ -1,56 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
workRefType?: string | null;
|
|
8
|
-
workRefId?: string | null;
|
|
9
|
-
specialistId?: string | null;
|
|
10
|
-
participantKind: ServiceParticipantKind;
|
|
11
|
-
participantProfileId?: string | null;
|
|
12
|
-
agentRef?: string;
|
|
13
|
-
source: ServiceTimeEntrySource;
|
|
14
|
-
description: string;
|
|
15
|
-
startedAt?: Date | null;
|
|
16
|
-
endedAt?: Date | null;
|
|
17
|
-
durationSeconds?: number;
|
|
18
|
-
evidence?: ServiceEvidence[];
|
|
19
|
-
metadata?: Record<string, unknown>;
|
|
20
|
-
}
|
|
21
|
-
export interface CommercialSnapshot {
|
|
22
|
-
/**
|
|
23
|
-
* Integer minor units of `currency` — `$19.99` is `1999` (#2401).
|
|
24
|
-
*
|
|
25
|
-
* Written straight into `ServiceChargeSnapshot.amount` /
|
|
26
|
-
* `ServiceCompensationSnapshot.amount`, which are INTEGER columns, so a
|
|
27
|
-
* resolver that returns major units corrupts the snapshot silently on SQLite
|
|
28
|
-
* and fails with `22P02` on PostgreSQL.
|
|
29
|
-
*/
|
|
30
|
-
amount: number;
|
|
31
|
-
currency?: string;
|
|
32
|
-
version: string;
|
|
33
|
-
strategy?: string;
|
|
34
|
-
terms: Record<string, unknown>;
|
|
35
|
-
sourceRef?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface ServiceCommercialResolver {
|
|
38
|
-
priceClient(entry: ServiceTimeEntry): Promise<CommercialSnapshot>;
|
|
39
|
-
compensateProvider(entry: ServiceTimeEntry): Promise<CommercialSnapshot>;
|
|
40
|
-
}
|
|
41
|
-
export declare class ServiceEvidenceService {
|
|
42
|
-
private readonly entries;
|
|
43
|
-
private readonly charges;
|
|
44
|
-
private readonly compensation;
|
|
45
|
-
private readonly commercial?;
|
|
46
|
-
constructor(entries: ServiceTimeEntryCollection, charges: ServiceChargeSnapshotCollection, compensation: ServiceCompensationSnapshotCollection, commercial?: ServiceCommercialResolver | undefined);
|
|
47
|
-
static create(options?: SmrtClassOptions, commercial?: ServiceCommercialResolver): Promise<ServiceEvidenceService>;
|
|
48
|
-
record(input: RecordServiceTimeInput): Promise<ServiceTimeEntry>;
|
|
49
|
-
submit(entry: ServiceTimeEntry, profileId?: string): Promise<ServiceTimeEntry>;
|
|
50
|
-
approve(entry: ServiceTimeEntry, options: {
|
|
51
|
-
actorProfileId?: string;
|
|
52
|
-
approvalPath: string;
|
|
53
|
-
}): Promise<ServiceTimeEntry>;
|
|
54
|
-
correct(entry: ServiceTimeEntry, input: RecordServiceTimeInput): Promise<ServiceTimeEntry>;
|
|
55
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* The Professional Service evidence lifecycle (record, submit, approve,
|
|
3
|
+
* correct) is owned by `@happyvertical/smrt-timesheets` (#3288) and
|
|
4
|
+
* re-exported here unchanged.
|
|
5
|
+
*/
|
|
6
|
+
export { type CommercialSnapshot, type RecordServiceTimeInput, type ServiceCommercialResolver, ServiceEvidenceService, } from '@happyvertical/smrt-timesheets';
|
|
56
7
|
//# sourceMappingURL=service-evidence-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-evidence-service.d.ts","sourceRoot":"","sources":["../../src/services/service-evidence-service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"service-evidence-service.d.ts","sourceRoot":"","sources":["../../src/services/service-evidence-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,sBAAsB,GACvB,MAAM,gCAAgC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CommercialUsageService, type CommercialUsageServiceOptions } from '@happyvertical/smrt-subscriptions';
|
|
2
|
-
import type { ServiceTimeEntry } from '
|
|
2
|
+
import type { ServiceTimeEntry } from '@happyvertical/smrt-timesheets';
|
|
3
3
|
import type { CommercialSnapshot, ServiceCommercialResolver } from './service-evidence-service.js';
|
|
4
4
|
export interface ProviderCompensationResolver {
|
|
5
5
|
compensate(entry: ServiceTimeEntry): Promise<CommercialSnapshot>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-commercial-resolver.d.ts","sourceRoot":"","sources":["../../src/services/subscription-commercial-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,EACnC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"subscription-commercial-resolver.d.ts","sourceRoot":"","sources":["../../src/services/subscription-commercial-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,EACnC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM,+BAA+B,CAAC;AAEvC,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAClE;AAmBD,iFAAiF;AACjF,qBAAa,qCACX,YAAW,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADR,KAAK,EAAE,sBAAsB,EAC7B,QAAQ,EAAE,4BAA4B;WAG5C,MAAM,CACjB,OAAO,EAAE,6BAA6B,EACtC,QAAQ,EAAE,4BAA4B,GACrC,OAAO,CAAC,qCAAqC,CAAC;IAO3C,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgDvE,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAGzE"}
|