feat(POS-003): completed feature
This commit is contained in:
11
work/artifacts/POS-003/architect.md
Normal file
11
work/artifacts/POS-003/architect.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# POS-003 — Architect
|
||||
|
||||
## Feature
|
||||
POS module skeleton: domain + repos + application use cases.
|
||||
|
||||
## Design
|
||||
Domain layer: PosStore, PosTerminal, PosCashSession types + all errors. Ports: PosStoreRepository, PosTerminalRepository, PosCashSessionRepository interfaces.
|
||||
Infrastructure: PgStoreRepository, PgTerminalRepository, PgPaymentMethodRepository, PgCashSessionRepository.
|
||||
Application: ListStores, ListTerminals, GetPosConfig, OpenCashSession, CloseCashSession use cases.
|
||||
Tests: unit tests for store listing + cash session open/close.
|
||||
Wired into build-app.ts (repos in deps, no routes yet — covered by POS-004).
|
||||
4
work/artifacts/POS-003/documenter.md
Normal file
4
work/artifacts/POS-003/documenter.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# POS-003 — Documenter evidence
|
||||
|
||||
## Scope of documentation change
|
||||
POS-003 creates the POS module skeleton. No documentation changes needed — POS-004 (routes) and subsequent tickets will document the API.
|
||||
39
work/artifacts/POS-003/implementer.md
Normal file
39
work/artifacts/POS-003/implementer.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# POS-003 — Implementer evidence
|
||||
|
||||
## What
|
||||
POS module skeleton: domain + repos + application use cases. No routes (POS-004 covers that).
|
||||
|
||||
## Files
|
||||
- `src/modules/pos/domain/errors.ts` — PosError, StoreNotFound, TerminalNotFound, CashSessionNotFound, CashSessionAlreadyOpen, CashSessionNotOpen, TerminalNotBound, TerminalDisabled
|
||||
- `src/modules/pos/domain/store.ts` — PosStore, ListStoresOptions
|
||||
- `src/modules/pos/domain/terminal.ts` — PosTerminal, TerminalStatus, InterfaceMode, ListTerminalsOptions
|
||||
- `src/modules/pos/domain/cash-session.ts` — PosCashSession, CashSessionStatus, OpenCashSessionInput, CloseCashSessionInput
|
||||
- `src/modules/pos/domain/ports.ts` — PosStoreRepository, PosTerminalRepository, PosCashSessionRepository interfaces
|
||||
- `src/modules/pos/infrastructure/pg-store-repository.ts` — PgStoreRepository (findById, list)
|
||||
- `src/modules/pos/infrastructure/pg-terminal-repository.ts` — PgTerminalRepository (findById, findByBindingCode, list, updateLastSeen, bind)
|
||||
- `src/modules/pos/infrastructure/pg-payment-method-repository.ts` — PgPaymentMethodRepository (listByStore)
|
||||
- `src/modules/pos/infrastructure/pg-cash-session-repository.ts` — PgCashSessionRepository (findById, findOpenByTerminal, open, close, listByStore)
|
||||
- `src/modules/pos/application/list-stores.ts` — ListStoresUseCase
|
||||
- `src/modules/pos/application/list-terminals.ts` — ListTerminalsUseCase
|
||||
- `src/modules/pos/application/get-pos-config.ts` — GetPosConfigUseCase
|
||||
- `src/modules/pos/application/open-cash-session.ts` — OpenCashSessionUseCase (validates terminal bound+active, rejects duplicate sessions)
|
||||
- `src/modules/pos/application/close-cash-session.ts` — CloseCashSessionUseCase
|
||||
- `src/modules/pos/tests/store-repository.test.ts` — 2 tests
|
||||
- `src/modules/pos/tests/cash-session.test.ts` — 6 tests
|
||||
- `src/app/build-app.ts` — wired POS repos
|
||||
|
||||
## Verification
|
||||
- `npm run build` → 0 TypeScript errors.
|
||||
- `npm test -- --run src/modules/pos/tests/` → 8 passed.
|
||||
- `check-module-boundaries.mjs src` → 0 NEW violations.
|
||||
- `./scripts/verify.sh` → green.
|
||||
|
||||
## AC traceability
|
||||
| AC | Estado | Evidencia |
|
||||
|----|--------|-----------|
|
||||
| AC1 domain types | ✅ | PosStore, PosTerminal, PosCashSession + errors |
|
||||
| AC2 repos | ✅ | 4 Pg*Repository implementations |
|
||||
| AC3 use cases | ✅ | 5 use cases (list-stores, list-terminals, get-pos-config, open, close) |
|
||||
| AC4 tests | ✅ | 8 unit tests covering core scenarios |
|
||||
| AC5 build-app wired | ✅ | POS repos added to build-app.ts |
|
||||
| AC6 scope out | ✅ | No routes (POS-004) |
|
||||
12
work/artifacts/POS-003/leader-close.json
Normal file
12
work/artifacts/POS-003/leader-close.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"feature_id": "POS-003",
|
||||
"agent": "leader",
|
||||
"stage": "close",
|
||||
"verdict": "APPROVED",
|
||||
"summary": "POS-003 closed: POS module skeleton (domain + 4 repos + 5 use cases + 8 tests + build-app wired). tsc 0, tests 8/8, verify.sh green.",
|
||||
"checks": [
|
||||
{"item": "Gates approved", "ok": true, "evidence": "reviewer.json, security.json, qa.json -> APPROVED"},
|
||||
{"item": "verify.sh", "ok": true, "evidence": "exit 0"}
|
||||
],
|
||||
"issues": []
|
||||
}
|
||||
13
work/artifacts/POS-003/qa.json
Normal file
13
work/artifacts/POS-003/qa.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"feature_id": "POS-003",
|
||||
"agent": "qa",
|
||||
"stage": "qa_gate",
|
||||
"verdict": "APPROVED",
|
||||
"summary": "tsc 0, 8 unit tests green, verify.sh green.",
|
||||
"checks": [
|
||||
{"item": "tsc 0", "ok": true, "evidence": "npm run build 0 errors"},
|
||||
{"item": "tests 8/8", "ok": true, "evidence": "vitest run src/modules/pos/tests/ 8 passed"},
|
||||
{"item": "verify.sh", "ok": true, "evidence": "exit 0"}
|
||||
],
|
||||
"issues": []
|
||||
}
|
||||
18
work/artifacts/POS-003/reviewer.json
Normal file
18
work/artifacts/POS-003/reviewer.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"feature_id": "POS-003",
|
||||
"agent": "reviewer",
|
||||
"stage": "review_gate",
|
||||
"verdict": "APPROVED",
|
||||
"summary": "POS module skeleton complete: domain types + 4 repos + 5 use cases + 8 unit tests + build-app wired. Scope out respected (no routes). tsc 0, tests 8/8.",
|
||||
"checks": [
|
||||
{"item": "Domain types", "ok": true, "evidence": "PosStore, PosTerminal, PosCashSession + all error classes"},
|
||||
{"item": "Repository interfaces", "ok": true, "evidence": "PosStoreRepository, PosTerminalRepository, PosCashSessionRepository in ports.ts"},
|
||||
{"item": "Pg implementations", "ok": true, "evidence": "4 Pg*Repository classes using @databases/pg"},
|
||||
{"item": "Use cases", "ok": true, "evidence": "ListStores, ListTerminals, GetPosConfig, OpenCashSession, CloseCashSession"},
|
||||
{"item": "Unit tests", "ok": true, "evidence": "8 tests: store repo + cash session open/close scenarios"},
|
||||
{"item": "build-app wired", "ok": true, "evidence": "POS repos added to build-app.ts"},
|
||||
{"item": "Scope out (no routes)", "ok": true, "evidence": "No routes added — POS-004 covers routes"},
|
||||
{"item": "tsc/tests/verify", "ok": true, "evidence": "npm run build 0, tests 8/8, verify.sh green"}
|
||||
],
|
||||
"issues": []
|
||||
}
|
||||
13
work/artifacts/POS-003/security.json
Normal file
13
work/artifacts/POS-003/security.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"feature_id": "POS-003",
|
||||
"agent": "security",
|
||||
"stage": "security_gate",
|
||||
"verdict": "APPROVED",
|
||||
"summary": "No new routes, no new auth, no secrets. All DB queries parameterized. POS module isolated in its own directory.",
|
||||
"checks": [
|
||||
{"item": "No new auth", "ok": true, "evidence": "No routes added; POS-004 will add auth"},
|
||||
{"item": "No new secrets", "ok": true, "evidence": "No env vars or credentials added"},
|
||||
{"item": "Parameterized queries", "ok": true, "evidence": "All DB queries use $1, $2 placeholders"}
|
||||
],
|
||||
"issues": []
|
||||
}
|
||||
Reference in New Issue
Block a user