import { injectable } from "@codemation/core"; import type { WorkflowActivationRepository, WorkflowActivationRow, } from "../../domain/workflows/WorkflowActivationRepository"; @injectable() export class InMemoryWorkflowActivationRepository implements WorkflowActivationRepository { private readonly rows = new Map(); async loadAll(): Promise> { return [...this.rows.entries()].map(([workflowId, isActive]) => ({ workflowId, isActive })); } async upsert(workflowId: string, active: boolean): Promise { this.rows.set(decodeURIComponent(workflowId), active); } }