Open History to see the last commit
1/**
2 * ProjectionSnapshotQuery - Read-model snapshot query service interface.
3 *
4 * Exposes the current orchestration projection snapshot for read-only API
5 * access.
6 *
7 * @module ProjectionSnapshotQuery
8 */
9import type { OrchestrationReadModel } from "@t3tools/contracts";
10import { ServiceMap } from "effect";
11import type { Effect } from "effect";
12
13import type { ProjectionRepositoryError } from "../../persistence/Errors.ts";
14
15/**
16 * ProjectionSnapshotQueryShape - Service API for read-model snapshots.
17 */
18export interface ProjectionSnapshotQueryShape {
19 /**
20 * Read the latest orchestration projection snapshot.
21 *
22 * Rehydrates from projection tables and derives snapshot sequence from
23 * projector cursor state.
24 */
25 readonly getSnapshot: () => Effect.Effect<OrchestrationReadModel, ProjectionRepositoryError>;
26}
27
28/**
29 * ProjectionSnapshotQuery - Service tag for projection snapshot queries.
30 */
31export class ProjectionSnapshotQuery extends ServiceMap.Service<
32 ProjectionSnapshotQuery,
33 ProjectionSnapshotQueryShape
34>()("t3/orchestration/Services/ProjectionSnapshotQuery") {}