Implement the 003-remove-combatant feature that adds the possibility to remove a combatant from an encounter

This commit is contained in:
Lukas
2026-03-03 23:46:47 +01:00
parent 9d7b174867
commit aed234de7b
16 changed files with 763 additions and 6 deletions

View File

@@ -0,0 +1,39 @@
# Quickstart: Remove Combatant
**Feature**: 003-remove-combatant
## Prerequisites
- Node.js 18+, pnpm
- Repository cloned, `pnpm install` run
## Development
```bash
git checkout 003-remove-combatant
pnpm test:watch # Run tests in watch mode during development
pnpm --filter web dev # Dev server at localhost:5173
```
## Verification
```bash
pnpm check # Must pass before commit (format + lint + typecheck + test)
```
## Implementation Order
1. **Domain**: Add `CombatantRemoved` event type → implement `removeCombatant` pure function → tests
2. **Application**: Add `removeCombatantUseCase` → re-export
3. **Web**: Add `removeCombatant` to `useEncounter` hook → add remove button in `App.tsx`
## Key Files
| Layer | File | Purpose |
|-------|------|---------|
| Domain | `packages/domain/src/remove-combatant.ts` | Pure removal function |
| Domain | `packages/domain/src/events.ts` | CombatantRemoved event type |
| Domain | `packages/domain/src/__tests__/remove-combatant.test.ts` | Acceptance tests |
| Application | `packages/application/src/remove-combatant-use-case.ts` | Use case orchestration |
| Web | `apps/web/src/hooks/use-encounter.ts` | Hook integration |
| Web | `apps/web/src/App.tsx` | UI remove button |