Julius Marmingelook over effect services9fae3ee8 months agoHistory
34 lines · 1.1 KB · TypeScript
RawDownload
/** * ProjectionSnapshotQuery - Read-model snapshot query service interface. * * Exposes the current orchestration projection snapshot for read-only API * access. * * @module ProjectionSnapshotQuery */import type { OrchestrationReadModel } from "@t3tools/contracts";import { ServiceMap } from "effect";import type { Effect } from "effect"; import type { ProjectionRepositoryError } from "../../persistence/Errors.ts"; /** * ProjectionSnapshotQueryShape - Service API for read-model snapshots. */export interface ProjectionSnapshotQueryShape {  /**   * Read the latest orchestration projection snapshot.   *   * Rehydrates from projection tables and derives snapshot sequence from   * projector cursor state.   */  readonly getSnapshot: () => Effect.Effect<OrchestrationReadModel, ProjectionRepositoryError>;} /** * ProjectionSnapshotQuery - Service tag for projection snapshot queries. */export class ProjectionSnapshotQuery extends ServiceMap.Service<  ProjectionSnapshotQuery,  ProjectionSnapshotQueryShape>()("orchestration/ProjectionSnapshotQuery") {}