@happyvertical/smrt-timesheets 0.0.0-stage → 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 +105 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +242 -2
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +495 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.json +1412 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/json.d.ts +6 -0
- package/dist/models/json.d.ts.map +1 -0
- package/dist/models/service-snapshots.d.ts +66 -0
- package/dist/models/service-snapshots.d.ts.map +1 -0
- package/dist/models/service-time-entry.d.ts +66 -0
- package/dist/models/service-time-entry.d.ts.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/service-evidence-service.d.ts +67 -0
- package/dist/services/service-evidence-service.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +1016 -0
- package/dist/svelte/components/DurationDisplay.svelte +81 -0
- package/dist/svelte/components/DurationDisplay.svelte.d.ts +20 -0
- package/dist/svelte/components/DurationDisplay.svelte.d.ts.map +1 -0
- package/dist/svelte/components/TimeEntryApprovalQueue.svelte +253 -0
- package/dist/svelte/components/TimeEntryApprovalQueue.svelte.d.ts +15 -0
- package/dist/svelte/components/TimeEntryApprovalQueue.svelte.d.ts.map +1 -0
- package/dist/svelte/components/TimeEntryCard.svelte +304 -0
- package/dist/svelte/components/TimeEntryCard.svelte.d.ts +25 -0
- package/dist/svelte/components/TimeEntryCard.svelte.d.ts.map +1 -0
- package/dist/svelte/components/TimeEntryList.svelte +360 -0
- package/dist/svelte/components/TimeEntryList.svelte.d.ts +24 -0
- package/dist/svelte/components/TimeEntryList.svelte.d.ts.map +1 -0
- package/dist/svelte/components/TimeSummary.svelte +176 -0
- package/dist/svelte/components/TimeSummary.svelte.d.ts +30 -0
- package/dist/svelte/components/TimeSummary.svelte.d.ts.map +1 -0
- package/dist/svelte/components/__tests__/DurationDisplay.test.js +57 -0
- package/dist/svelte/components/__tests__/TimeEntryApprovalQueue.test.js +114 -0
- package/dist/svelte/components/__tests__/TimeEntryCard.test.js +45 -0
- package/dist/svelte/components/__tests__/TimeEntryList.test.js +50 -0
- package/dist/svelte/components/__tests__/TimeSummary.test.js +39 -0
- package/dist/svelte/components/utils.d.ts +51 -0
- package/dist/svelte/components/utils.d.ts.map +1 -0
- package/dist/svelte/components/utils.js +58 -0
- package/dist/svelte/i18n.d.ts +31 -0
- package/dist/svelte/i18n.d.ts.map +1 -0
- package/dist/svelte/i18n.js +31 -0
- package/dist/svelte/index.d.ts +25 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +27 -0
- package/dist/svelte/types.d.ts +41 -0
- package/dist/svelte/types.d.ts.map +1 -0
- package/dist/svelte/types.js +28 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +16 -0
- package/dist/types.js.map +1 -0
- package/dist/ui.d.ts +17 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +68 -0
- package/dist/ui.js.map +1 -0
- package/package.json +85 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { ServiceChargeSnapshot, ServiceChargeSnapshotCollection, ServiceCompensationSnapshot, ServiceCompensationSnapshotCollection, } from './service-snapshots.js';
|
|
2
|
+
export { SERVICE_TIME_ENTRY_FROZEN_FIELDS, ServiceTimeEntry, ServiceTimeEntryCollection, } from './service-time-entry.js';
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,+BAA+B,EAC/B,2BAA2B,EAC3B,qCAAqC,GACtC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gCAAgC,EAChC,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a JSON value stored as text, returning `fallback` on malformed input.
|
|
3
|
+
* Stored JSON may predate a schema change, so reads never throw.
|
|
4
|
+
*/
|
|
5
|
+
export declare function parseTimesheetJson<T>(value: string, fallback: T): T;
|
|
6
|
+
//# sourceMappingURL=json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/models/json.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAMnE"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { SmrtCollection, SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
+
/**
|
|
3
|
+
* Refuse an amount that is not a JavaScript-safe integer number of minor
|
|
4
|
+
* units. SQLite stores `19.99` in an INTEGER column without complaint and
|
|
5
|
+
* PostgreSQL rejects it only at the driver, so the model boundary is the one
|
|
6
|
+
* place both engines (and every writer: collections, `ServiceEvidenceService`,
|
|
7
|
+
* resolvers) get the same answer. Sign is not constrained here.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertSnapshotMinorUnits(model: string, amount: unknown): void;
|
|
10
|
+
/**
|
|
11
|
+
* Immutable client-charge snapshot for one approved time entry. Money is
|
|
12
|
+
* integer minor units, consistent with smrt-commerce (#2401).
|
|
13
|
+
*/
|
|
14
|
+
export declare class ServiceChargeSnapshot extends SmrtObject {
|
|
15
|
+
tenantId: string | null;
|
|
16
|
+
timeEntryId: string;
|
|
17
|
+
/**
|
|
18
|
+
* Client charge in **integer minor units** of {@link currency} — `$19.99` is
|
|
19
|
+
* `1999`. The `= 0` initializer is load-bearing: SMRT maps an integer literal
|
|
20
|
+
* to INTEGER and a decimal literal to DECIMAL (#2401).
|
|
21
|
+
*
|
|
22
|
+
* Copied verbatim from the upstream `ClientCharge.amount`, so the two carry
|
|
23
|
+
* the same unit by construction; a split would land cents in a major-units
|
|
24
|
+
* column with no error anywhere.
|
|
25
|
+
*/
|
|
26
|
+
amount: number;
|
|
27
|
+
currency: string;
|
|
28
|
+
pricingVersion: string;
|
|
29
|
+
strategy: string;
|
|
30
|
+
rateSnapshot: string;
|
|
31
|
+
sourceChargeRef: string;
|
|
32
|
+
createdAt: Date;
|
|
33
|
+
initialize(): Promise<this>;
|
|
34
|
+
save(): Promise<this>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Immutable provider-compensation snapshot for one approved time entry,
|
|
38
|
+
* kept separate from the client charge so the margin is `charge - compensation`.
|
|
39
|
+
*/
|
|
40
|
+
export declare class ServiceCompensationSnapshot extends SmrtObject {
|
|
41
|
+
tenantId: string | null;
|
|
42
|
+
timeEntryId: string;
|
|
43
|
+
/**
|
|
44
|
+
* Provider earning in **integer minor units** of {@link currency} (#2401).
|
|
45
|
+
*
|
|
46
|
+
* Converts with {@link ServiceChargeSnapshot.amount}: the delivery margin is
|
|
47
|
+
* `charge - compensation`, so a mixed pair would make that subtraction
|
|
48
|
+
* meaningless.
|
|
49
|
+
*/
|
|
50
|
+
amount: number;
|
|
51
|
+
currency: string;
|
|
52
|
+
termsVersion: string;
|
|
53
|
+
rateSnapshot: string;
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
initialize(): Promise<this>;
|
|
56
|
+
save(): Promise<this>;
|
|
57
|
+
}
|
|
58
|
+
/** Collection over `service_charge_snapshots`. */
|
|
59
|
+
export declare class ServiceChargeSnapshotCollection extends SmrtCollection<ServiceChargeSnapshot> {
|
|
60
|
+
static readonly _itemClass: typeof ServiceChargeSnapshot;
|
|
61
|
+
}
|
|
62
|
+
/** Collection over `service_compensation_snapshots`. */
|
|
63
|
+
export declare class ServiceCompensationSnapshotCollection extends SmrtCollection<ServiceCompensationSnapshot> {
|
|
64
|
+
static readonly _itemClass: typeof ServiceCompensationSnapshot;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=service-snapshots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-snapshots.d.ts","sourceRoot":"","sources":["../../src/models/service-snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EACd,UAAU,EAGX,MAAM,0BAA0B,CAAC;AAGlC;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAa7E;AAoDD;;;GAGG;AACH,qBAYa,qBAAsB,SAAQ,UAAU;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IACT,WAAW,EAAE,MAAM,CAAM;IAC7E;;;;;;;;OAQG;IACH,MAAM,EAAE,MAAM,CAAK;IACM,QAAQ,EAAE,MAAM,CAAS;IACzB,cAAc,EAAE,MAAM,CAAM;IAC5B,QAAQ,EAAE,MAAM,CAAM;IACtB,YAAY,EAAE,MAAM,CAAQ;IAC5B,eAAe,EAAE,MAAM,CAAM;IACtD,SAAS,EAAE,IAAI,CAAc;IAEd,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAa3B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAkBrC;AAED;;;GAGG;AACH,qBAYa,2BAA4B,SAAQ,UAAU;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IACT,WAAW,EAAE,MAAM,CAAM;IAC7E;;;;;;OAMG;IACH,MAAM,EAAE,MAAM,CAAK;IACM,QAAQ,EAAE,MAAM,CAAS;IACzB,YAAY,EAAE,MAAM,CAAM;IAC1B,YAAY,EAAE,MAAM,CAAQ;IACrD,SAAS,EAAE,IAAI,CAAc;IAEd,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAa3B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAkBrC;AAED,kDAAkD;AAClD,qBAAa,+BAAgC,SAAQ,cAAc,CAAC,qBAAqB,CAAC;IACxF,MAAM,CAAC,QAAQ,CAAC,UAAU,+BAAyB;CACpD;AACD,wDAAwD;AACxD,qBAAa,qCAAsC,SAAQ,cAAc,CAAC,2BAA2B,CAAC;IACpG,MAAM,CAAC,QAAQ,CAAC,UAAU,qCAA+B;CAC1D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { SmrtCollection, SmrtObject } from '@happyvertical/smrt-core';
|
|
2
|
+
import { type ServiceEvidence, type ServiceParticipantKind, type ServiceTimeEntrySource, type ServiceTimeEntryStatus } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Fields that may not change once an entry is approved (or corrected). A
|
|
5
|
+
* subtype that adds its own work context extends the list through
|
|
6
|
+
* {@link ServiceTimeEntry.frozenFieldNames}.
|
|
7
|
+
*/
|
|
8
|
+
export declare const SERVICE_TIME_ENTRY_FROZEN_FIELDS: readonly ["tenantId", "workRefType", "workRefId", "participantKind", "participantProfileId", "agentRef", "source", "description", "startedAt", "endedAt", "durationSeconds", "evidence", "correctionOfId"];
|
|
9
|
+
/**
|
|
10
|
+
* A person or agent worked this long on this thing, and someone approved it.
|
|
11
|
+
*
|
|
12
|
+
* The base entry carries a generic work reference (`workRefType` qualified
|
|
13
|
+
* class name + `workRefId`) and no domain-specific foreign key; a domain adds
|
|
14
|
+
* its own context by subclassing over the same `service_time_entries` table
|
|
15
|
+
* (smrt-support's subtype adds `caseId` / `specialistId`). Entries carry no
|
|
16
|
+
* rate: charge and compensation live on the immutable snapshot models.
|
|
17
|
+
*
|
|
18
|
+
* Status moves `draft → submitted → approved | rejected`; an approved entry
|
|
19
|
+
* never changes, and a correction is a new row whose `correctionOfId` points
|
|
20
|
+
* at the entry it corrects, which flips to `corrected`.
|
|
21
|
+
*/
|
|
22
|
+
export declare class ServiceTimeEntry extends SmrtObject {
|
|
23
|
+
tenantId: string | null;
|
|
24
|
+
workRefType: string | null;
|
|
25
|
+
workRefId: string | null;
|
|
26
|
+
participantKind: ServiceParticipantKind;
|
|
27
|
+
participantProfileId: string | null;
|
|
28
|
+
agentRef: string;
|
|
29
|
+
source: ServiceTimeEntrySource;
|
|
30
|
+
description: string;
|
|
31
|
+
startedAt: Date | null;
|
|
32
|
+
endedAt: Date | null;
|
|
33
|
+
durationSeconds: number;
|
|
34
|
+
evidence: string;
|
|
35
|
+
status: ServiceTimeEntryStatus;
|
|
36
|
+
submittedAt: Date | null;
|
|
37
|
+
submittedByProfileId: string | null;
|
|
38
|
+
approvedAt: Date | null;
|
|
39
|
+
approvedByProfileId: string | null;
|
|
40
|
+
approvalPath: string;
|
|
41
|
+
rejectedAt: Date | null;
|
|
42
|
+
rejectedByProfileId: string | null;
|
|
43
|
+
rejectionReason: string;
|
|
44
|
+
correctionOfId: string | null;
|
|
45
|
+
metadata: string;
|
|
46
|
+
getEvidence(): ServiceEvidence[];
|
|
47
|
+
setEvidence(value: ServiceEvidence[]): void;
|
|
48
|
+
getMetadata(): Record<string, unknown>;
|
|
49
|
+
setMetadata(value: Record<string, unknown>): void;
|
|
50
|
+
durationHours(): number;
|
|
51
|
+
/**
|
|
52
|
+
* Fields frozen once the entry is approved. Subtypes that add work context
|
|
53
|
+
* (e.g. a support case) return `[...super.frozenFieldNames(), ...]`.
|
|
54
|
+
*/
|
|
55
|
+
protected frozenFieldNames(): readonly string[];
|
|
56
|
+
initialize(): Promise<this>;
|
|
57
|
+
save(): Promise<this>;
|
|
58
|
+
private readPrior;
|
|
59
|
+
}
|
|
60
|
+
/** Collection over `service_time_entries`. */
|
|
61
|
+
export declare class ServiceTimeEntryCollection extends SmrtCollection<ServiceTimeEntry> {
|
|
62
|
+
static readonly _itemClass: typeof ServiceTimeEntry;
|
|
63
|
+
forWork(workRefType: string, workRefId: string): Promise<ServiceTimeEntry[]>;
|
|
64
|
+
pendingApproval(): Promise<ServiceTimeEntry[]>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=service-time-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-time-entry.d.ts","sourceRoot":"","sources":["../../src/models/service-time-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,cAAc,EACd,UAAU,EAEX,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC5B,MAAM,aAAa,CAAC;AAGrB;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,4MAcnC,CAAC;AAyBX;;;;;;;;;;;;GAYG;AACH,qBASa,gBAAiB,SAAQ,UAAU;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAClC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAChD,eAAe,EAAE,sBAAsB,CAAW;IAE3E,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAClB,QAAQ,EAAE,MAAM,CAAM;IACtB,MAAM,EAAE,sBAAsB,CAAY;IAC1C,WAAW,EAAE,MAAM,CAAM;IAClD,SAAS,EAAE,IAAI,GAAG,IAAI,CAAQ;IAC9B,OAAO,EAAE,IAAI,GAAG,IAAI,CAAQ;IAC5B,eAAe,EAAE,MAAM,CAAK;IACH,QAAQ,EAAE,MAAM,CAAQ;IACxB,MAAM,EAAE,sBAAsB,CAAW;IAClE,WAAW,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC3C,UAAU,EAAE,IAAI,GAAG,IAAI,CAAQ;IAE/B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAQ;IACjB,YAAY,EAAE,MAAM,CAAM;IACnD,UAAU,EAAE,IAAI,GAAG,IAAI,CAAQ;IAE/B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAQ;IACjB,eAAe,EAAE,MAAM,CAAM;IACtB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAQ;IAC5C,QAAQ,EAAE,MAAM,CAAQ;IAEjD,WAAW,IAAI,eAAe,EAAE;IAGhC,WAAW,CAAC,KAAK,EAAE,eAAe,EAAE,GAAG,IAAI;IAG3C,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAGtC,WAAW,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAGjD,aAAa,IAAI,MAAM;IAIvB;;;OAGG;IACH,SAAS,CAAC,gBAAgB,IAAI,SAAS,MAAM,EAAE;IAIhC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAM3B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;YA8BtB,SAAS;CA8BxB;AAED,8CAA8C;AAC9C,qBAAa,0BAA2B,SAAQ,cAAc,CAAC,gBAAgB,CAAC;IAC9E,MAAM,CAAC,QAAQ,CAAC,UAAU,0BAAoB;IACxC,OAAO,CACX,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAMxB,eAAe,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;CAMrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { SmrtClassOptions } from '@happyvertical/smrt-core';
|
|
2
|
+
import { ServiceChargeSnapshotCollection, ServiceCompensationSnapshotCollection } from '../models/service-snapshots.js';
|
|
3
|
+
import type { ServiceTimeEntry } from '../models/service-time-entry.js';
|
|
4
|
+
import { ServiceTimeEntryCollection } from '../models/service-time-entry.js';
|
|
5
|
+
import type { ServiceEvidence, ServiceParticipantKind, ServiceTimeEntrySource } from '../types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Input for {@link ServiceEvidenceService.record}. The work reference is the
|
|
8
|
+
* qualified class name and id of whatever the time was spent on.
|
|
9
|
+
*/
|
|
10
|
+
export interface RecordServiceTimeInput {
|
|
11
|
+
tenantId?: string | null;
|
|
12
|
+
workRefType?: string | null;
|
|
13
|
+
workRefId?: string | null;
|
|
14
|
+
participantKind: ServiceParticipantKind;
|
|
15
|
+
participantProfileId?: string | null;
|
|
16
|
+
agentRef?: string;
|
|
17
|
+
source: ServiceTimeEntrySource;
|
|
18
|
+
description: string;
|
|
19
|
+
startedAt?: Date | null;
|
|
20
|
+
endedAt?: Date | null;
|
|
21
|
+
durationSeconds?: number;
|
|
22
|
+
evidence?: ServiceEvidence[];
|
|
23
|
+
metadata?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface CommercialSnapshot {
|
|
26
|
+
/**
|
|
27
|
+
* Integer minor units of `currency` — `$19.99` is `1999` (#2401).
|
|
28
|
+
*
|
|
29
|
+
* Written straight into `ServiceChargeSnapshot.amount` /
|
|
30
|
+
* `ServiceCompensationSnapshot.amount`, INTEGER columns whose `save()`
|
|
31
|
+
* refuses anything but a safe integer on every engine. A fractional
|
|
32
|
+
* major-unit value (`19.99`) is rejected; a whole one (`150` for $150.00)
|
|
33
|
+
* is not detectable and is stored 100× too small, so return minor units.
|
|
34
|
+
*/
|
|
35
|
+
amount: number;
|
|
36
|
+
currency?: string;
|
|
37
|
+
version: string;
|
|
38
|
+
strategy?: string;
|
|
39
|
+
terms: Record<string, unknown>;
|
|
40
|
+
sourceRef?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ServiceCommercialResolver {
|
|
43
|
+
priceClient(entry: ServiceTimeEntry): Promise<CommercialSnapshot>;
|
|
44
|
+
compensateProvider(entry: ServiceTimeEntry): Promise<CommercialSnapshot>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Records, submits, approves, and corrects time entries. Approval writes one
|
|
48
|
+
* immutable client-charge and one provider-compensation snapshot per entry;
|
|
49
|
+
* a correction is a new entry pointing at the approved one, which flips to
|
|
50
|
+
* `corrected` with its snapshots intact.
|
|
51
|
+
*/
|
|
52
|
+
export declare class ServiceEvidenceService {
|
|
53
|
+
private readonly entries;
|
|
54
|
+
private readonly charges;
|
|
55
|
+
private readonly compensation;
|
|
56
|
+
private readonly commercial?;
|
|
57
|
+
constructor(entries: ServiceTimeEntryCollection, charges: ServiceChargeSnapshotCollection, compensation: ServiceCompensationSnapshotCollection, commercial?: ServiceCommercialResolver | undefined);
|
|
58
|
+
static create(options?: SmrtClassOptions, commercial?: ServiceCommercialResolver): Promise<ServiceEvidenceService>;
|
|
59
|
+
record(input: RecordServiceTimeInput): Promise<ServiceTimeEntry>;
|
|
60
|
+
submit(entry: ServiceTimeEntry, profileId?: string): Promise<ServiceTimeEntry>;
|
|
61
|
+
approve(entry: ServiceTimeEntry, options: {
|
|
62
|
+
actorProfileId?: string;
|
|
63
|
+
approvalPath: string;
|
|
64
|
+
}): Promise<ServiceTimeEntry>;
|
|
65
|
+
correct(entry: ServiceTimeEntry, input: RecordServiceTimeInput): Promise<ServiceTimeEntry>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=service-evidence-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-evidence-service.d.ts","sourceRoot":"","sources":["../../src/services/service-evidence-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EACL,+BAA+B,EAC/B,qCAAqC,EACtC,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAA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