import { SmrtObjectOptions } from '@happyvertical/smrt-core'; import { ServiceTimeEntry, ServiceTimeEntryCollection } from '../models/service-time-entry.js'; import { ServiceTimeEntrySource, SupportParticipantKind, TimeEntryEvidence } from '../types.js'; import { SupportCaseService } from './support-case-service.js'; /** Options for {@link ServiceTimeEntryService.create}. */ export interface ServiceTimeEntryServiceOptions extends SmrtObjectOptions { /** Share an existing case facade (otherwise one is created internally). */ caseService?: SupportCaseService; } /** Input for {@link ServiceTimeEntryService.record} — all four sources. */ export interface RecordServiceTimeEntryInput { tenantId?: string | null; /** Support Case context (either this or the work ref pair is required). */ caseId?: string | null; /** Polymorphic work context: qualified class name + id, together. */ workRefType?: string | null; workRefId?: string | null; /** Specialist role record, when the deliverer is a Support Specialist. */ specialistId?: string | null; participantKind: SupportParticipantKind; /** Delivering human Participant — required when `participantKind: 'human'`. */ participantProfileId?: string | null; /** Delivering agent identity — required when `participantKind: 'agent'`. */ agentRef?: string; source: ServiceTimeEntrySource; description?: string; startedAt?: Date; endedAt?: Date; /** Explicit duration; derived from `endedAt − startedAt` when omitted. */ durationSeconds?: number; evidence?: TimeEntryEvidence[]; metadata?: Record; } /** Input for {@link ServiceTimeEntryService.submit}. */ export interface SubmitServiceTimeEntryInput { byProfileId?: string | null; } /** * The write facade for recording and submitting Service Time Entries. * Construct with {@link ServiceTimeEntryService.create}. */ export declare class ServiceTimeEntryService { readonly entries: ServiceTimeEntryCollection; readonly caseService: SupportCaseService; protected constructor(collections: { entries: ServiceTimeEntryCollection; caseService: SupportCaseService; }); static create(options: ServiceTimeEntryServiceOptions): Promise; /** Load an entry or throw a descriptive error. */ getEntry(entryRef: ServiceTimeEntry | string): Promise; /** * Record one Service Time Entry as a `draft`. One validation contract for * all four sources (FR-40): * * - a work context is required: `caseId` and/or the `workRefType`/`workRefId` * pair (a case-attached entry copies the case's tenant unless given); * - the participant must be coherent: `human` needs `participantProfileId`, * `agent` needs `agentRef`; * - `timer` entries need both period bounds; every entry needs a positive * duration — explicit `durationSeconds` or derived `endedAt − startedAt`. * * Case-attached entries append a `time_recorded` audit event. */ record(input: RecordServiceTimeEntryInput): Promise; /** * Submit a `draft` (or resubmit a `rejected`) entry for approval, stamping * the submitter. Approval itself is `TimeEntryApprovalService`'s job. */ submit(entryRef: ServiceTimeEntry | string, input?: SubmitServiceTimeEntryInput): Promise; } export default ServiceTimeEntryService; //# sourceMappingURL=service-time-entry-service.d.ts.map