Files
ttrpg_manager/src/lib/schemas/dice.ts
T
NilsBriggen 1a9e5e2c18 Build MVP: campaigns, characters, combat, dice, compendium
- Rules abstraction (5e + pf2e) behind one interface, fully tested
- Pure combat engine: turn-order safe across add/remove/reorder/init-change
- Dexie storage with real cascade deletes + Zod validation on write
- Seedable dice engine with notation parser
- Lazy SRD compendium (code-split), bestiary -> combat
- Strict TS, 54 unit tests, Playwright e2e smoke (all green)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 00:09:42 +02:00

15 lines
353 B
TypeScript

import { z } from 'zod';
import { num } from './common';
export const diceRollSchema = z.object({
id: z.string(),
campaignId: z.string().optional(),
label: z.string().max(120).default(''),
expression: z.string().min(1),
total: num,
breakdown: z.string(),
createdAt: z.string(),
});
export type DiceRoll = z.infer<typeof diceRollSchema>;