/** * module: report 的外部所需(编码规范 §10.1)。 * 汇报**不自己记账**:事实全部来自 memory(任务日志)与 task(终态 / 预算 / 纠正信号)。 */ import type { StaffId } from '@contracts'; import type { Report } from './contract.ts'; import type { LogFact, TaskFact } from './internal/domain/aggregate.ts'; export type ReportStore = { list(staffId: StaffId, limit: number): Promise; get(reportId: string): Promise; findOpen(staffId: StaffId, period: string, windowFrom: string): Promise; save(report: Report): Promise; }; /** 事实源 —— app 注入 `memory`(L2)与 `task`(L6);report 在 L8,只读不写 */ export type FactSource = { /** 某人(或全员)在窗口内的归侧日志行 */ logsOf(staffId: StaffId | undefined, from: string, to: string): Promise; tasksOf(staffId: StaffId | undefined): Promise; }; export type ReportDeps = { readonly store: ReportStore; readonly facts: FactSource; readonly ids: { next(): string }; readonly clock: { now(): Date }; };