feat(POS-006): completed feature

This commit is contained in:
chattie
2026-08-22 13:39:11 +02:00
parent 915fbe0ba9
commit 25e4e5b622
24 changed files with 448 additions and 62 deletions

View File

@@ -0,0 +1,13 @@
# POS-006 — Architect
## Feature
POS Phase 1 ticket 006: `apps/pos` Next.js application skeleton.
## Objetivo
Create the `apps/pos` Next.js app with: package.json, next.config.ts, tsconfig.json, Tailwind, root layout, auth login page, API proxy route, middleware, POS API client, permissions, money utils, idempotency utils, terminal page shell.
## Diseño
- Next.js 15 App Router; route groups (auth) and (terminal)
- Middleware enforces session cookie; redirects to /login if absent
- API proxy: `/api/[...path]` proxies to backend preserving cookies + terminal header
- No server-side DB; all data via API

View File

@@ -0,0 +1,4 @@
# POS-006 — Documenter evidence
## Scope
POS-006 is a foundation feature — creates the apps/pos Next.js app. No external docs update required at this stage.

View File

@@ -0,0 +1,25 @@
# POS-006 — Implementer evidence
## What
Created apps/pos Next.js app skeleton. tsc 0, verify.sh verde.
## Files created
- `apps/pos/package.json` — next 15 + react 19 + tailwind
- `apps/pos/next.config.ts`
- `apps/pos/tsconfig.json`
- `apps/pos/tailwind.config.ts`
- `apps/pos/src/app/globals.css`
- `apps/pos/src/app/layout.tsx` — root layout
- `apps/pos/src/app/(auth)/login/page.tsx` — login form
- `apps/pos/src/app/(terminal)/layout.tsx`
- `apps/pos/src/app/(terminal)/page.tsx` — terminal shell
- `apps/pos/src/app/api/[...path]/route.ts` — API proxy
- `apps/pos/src/lib/api-client.ts` — posApi + authApi clients
- `apps/pos/src/lib/permissions.ts` — POS_ROLE_PERMISSIONS
- `apps/pos/src/lib/money.ts` — formatPrice
- `apps/pos/src/lib/idempotency.ts` — generateIdempotencyKey
- `apps/pos/src/middleware.ts` — session guard
## Verification
- `npm run build` → 0 TypeScript errors.
- `./scripts/verify.sh` → green.

View File

@@ -0,0 +1,12 @@
{
"feature_id": "POS-006",
"agent": "leader",
"stage": "close",
"verdict": "APPROVED",
"summary": "POS-006 closed: apps/pos Next.js skeleton. 15 files, tsc 0, 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": []
}

View File

@@ -0,0 +1,12 @@
{
"feature_id": "POS-006",
"agent": "qa",
"stage": "qa_gate",
"verdict": "APPROVED",
"summary": "tsc 0, verify.sh green.",
"checks": [
{"item": "tsc 0", "ok": true, "evidence": "npm run build 0 errors"},
{"item": "verify.sh", "ok": true, "evidence": "exit 0"}
],
"issues": []
}

View File

@@ -0,0 +1,17 @@
{
"feature_id": "POS-006",
"agent": "reviewer",
"stage": "review_gate",
"verdict": "APPROVED",
"summary": "apps/pos skeleton complete. 15 files, TypeScript-clean.",
"checks": [
{"item": "package.json + configs", "ok": true, "evidence": "next.config.ts, tsconfig.json, tailwind.config.ts"},
{"item": "root layout + globals.css", "ok": true, "evidence": "layout.tsx + globals.css"},
{"item": "login page", "ok": true, "evidence": "(auth)/login/page.tsx with form"},
{"item": "API proxy route", "ok": true, "evidence": "/api/[...path]/route.ts"},
{"item": "middleware", "ok": true, "evidence": "session cookie guard"},
{"item": "api-client + utils", "ok": true, "evidence": "posApi, authApi, permissions, money, idempotency"},
{"item": "tsc/verify", "ok": true, "evidence": "tsc 0, verify green"}
],
"issues": []
}

View File

@@ -0,0 +1,12 @@
{
"feature_id": "POS-006",
"agent": "security",
"stage": "security_gate",
"verdict": "APPROVED",
"summary": "No sensitive data. Middleware guards unauthenticated access.",
"checks": [
{"item": "No secrets in source", "ok": true, "evidence": "API URL from env var; credentials: include only at runtime"},
{"item": "Middleware access control", "ok": true, "evidence": "redirects to /login when no session cookie"}
],
"issues": []
}