T012–T016: Phase 3 application + web shell (use case, ports, React hook, UI, README)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lukas
2026-03-03 13:11:33 +01:00
parent 42a07a07ff
commit 4c2e0a47e6
7 changed files with 150 additions and 7 deletions

View File

@@ -0,0 +1,21 @@
import {
advanceTurn,
type DomainError,
type DomainEvent,
isDomainError,
} from "@initiative/domain";
import type { EncounterStore } from "./ports.js";
export function advanceTurnUseCase(
store: EncounterStore,
): DomainEvent[] | DomainError {
const encounter = store.get();
const result = advanceTurn(encounter);
if (isDomainError(result)) {
return result;
}
store.save(result.encounter);
return result.events;
}

View File

@@ -1 +1,2 @@
export {};
export { advanceTurnUseCase } from "./advance-turn-use-case.js";
export type { EncounterStore } from "./ports.js";

View File

@@ -0,0 +1,6 @@
import type { Encounter } from "@initiative/domain";
export interface EncounterStore {
get(): Encounter;
save(encounter: Encounter): void;
}