feat(POS-005): completed feature

This commit is contained in:
chattie
2026-08-22 13:36:26 +02:00
parent 955c25d77b
commit 915fbe0ba9
12 changed files with 294 additions and 22 deletions

View File

@@ -0,0 +1,12 @@
# POS-005 — Architect
## Feature
POS API Phase 1: product search + payment methods.
## Objetivo
Endpoints: GET /pos/products/search, /pos/products/by-ean/:ean, /pos/products/by-sku/:sku. Admin: GET/POST/PATCH /pos/admin/payment-methods.
## Diseño
- Product search: JOIN catalog_product_variants + catalog_products + inventory_stock + pricing_variant_prices + categories + brands
- Payment methods: direct CRUD on pos_payment_methods table
- Auth: requireAnyRole for product routes; requireRole admin for payment method admin

View File

@@ -0,0 +1,4 @@
# POS-005 — Documenter evidence
## Scope of documentation change
POS-005 adds product search and payment methods API routes. Swagger summaries inline in schemas. No external docs update needed.

View File

@@ -0,0 +1,21 @@
# POS-005 — Implementer evidence
## What
POS-005 build: product search + payment methods CRUD endpoints. tsc 0, verify.sh verde.
## Files
- `src/modules/pos/api/pos.routes.ts` — new routes added: GET /pos/products/search, /pos/products/by-ean/:ean, /pos/products/by-sku/:sku, GET/POST/PATCH /pos/admin/payment-methods
## Verification
- `npm run build` → 0 TypeScript errors.
- `check-module-boundaries.mjs src` → 0 NEW violations.
- `./scripts/verify.sh` → green.
## AC traceability
| AC | Estado | Evidencia |
|----|--------|-----------|
| AC1 product search | ✅ | GET /pos/products/search with ILIKE + SKU + EAN lookup |
| AC2 EAN lookup | ✅ | GET /pos/products/by-ean/:ean |
| AC3 SKU lookup | ✅ | GET /pos/products/by-sku/:sku |
| AC4 payment methods admin | ✅ | GET/POST/PATCH /pos/admin/payment-methods |
| AC5 tsc/verify | ✅ | tsc 0, verify verde |

View File

@@ -0,0 +1,12 @@
{
"feature_id": "POS-005",
"agent": "leader",
"stage": "close",
"verdict": "APPROVED",
"summary": "POS-005 closed: product search + payment methods API. 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-005",
"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,14 @@
{
"feature_id": "POS-005",
"agent": "reviewer",
"stage": "review_gate",
"verdict": "APPROVED",
"summary": "Product search + payment methods API complete. tsc 0, verify green.",
"checks": [
{"item": "Product search endpoint", "ok": true, "evidence": "GET /pos/products/search with ILIKE + JOIN inventory/pricing/categories/brands"},
{"item": "EAN/SKU lookup", "ok": true, "evidence": "GET /pos/products/by-ean/:ean and /by-sku/:sku"},
{"item": "Payment methods admin", "ok": true, "evidence": "GET/POST/PATCH /pos/admin/payment-methods"},
{"item": "tsc/verify", "ok": true, "evidence": "npm run build 0; verify.sh green"}
],
"issues": []
}

View File

@@ -0,0 +1,12 @@
{
"feature_id": "POS-005",
"agent": "security",
"stage": "security_gate",
"verdict": "APPROVED",
"summary": "All queries parameterized. Admin routes require admin role. Product routes require pos role.",
"checks": [
{"item": "SQL injection prevention", "ok": true, "evidence": "All DB queries use $1, $2... placeholders; q trimmed before use"},
{"item": "Authentication", "ok": true, "evidence": "requireRole admin for admin routes; requireAnyRole for product routes"}
],
"issues": []
}