feat(F-140): completed feature
This commit is contained in:
13
work/artifacts/F-140/architect.md
Normal file
13
work/artifacts/F-140/architect.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# F-140 — Architect
|
||||
|
||||
## Feature
|
||||
Order detail page shows customer, shipping address, billing address, payment method + last 4 + state.
|
||||
|
||||
## Objetivo
|
||||
Enriquecer GET /orders/:id/admin con datos de cliente (nombre, email, teléfono), direcciones de envío/facturación y pago. Renderizar en la página admin.
|
||||
|
||||
## Diseño
|
||||
- Backend: GET /orders/:id/admin JOIN identity_users (phone), users_addresses (type='shipping'/'billing'), payments_transactions (status='succeeded', latest). serializeOrder incluye los nuevos campos.
|
||||
- Admin: página orders/[id] muestra secciones Cliente, Dirección de envío, Dirección de facturación, Pago en el sidebar.
|
||||
- Migration 050: ADD COLUMN type='shipping'|'billing' a users_addresses, ADD COLUMN phone a identity_users, ADD COLUMN customer_name/customer_phone a orders_orders.
|
||||
- Read-only: sin edits desde esta página.
|
||||
4
work/artifacts/F-140/documenter.md
Normal file
4
work/artifacts/F-140/documenter.md
Normal file
@@ -0,0 +1,4 @@
|
||||
# F-140 — Documenter evidence
|
||||
|
||||
## Scope of documentation change
|
||||
F-140 enriquece el endpoint GET /orders/:id/admin con campos adicionales. No hay cambios en la API pública (mismos endpoints). No se requiere update de docs.
|
||||
28
work/artifacts/F-140/implementer.md
Normal file
28
work/artifacts/F-140/implementer.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# F-140 — Implementer evidence
|
||||
|
||||
## What
|
||||
F-140 build evidence: GET /orders/:id/admin enriched with customer/address/payment; admin page shows new sections. tsc 0, verify.sh verde.
|
||||
|
||||
## Files
|
||||
- `project/migrations/050_order_detail_address_type.js` — ADD COLUMN type to users_addresses, ADD COLUMN phone to identity_users, ADD COLUMN customer_name/customer_phone to orders_orders
|
||||
- `project/src/modules/orders/domain/order.ts` — OrderView extended with Address, PaymentInfo interfaces; Order extended with customerName/customerPhone
|
||||
- `project/src/modules/orders/infrastructure/pg-order-repository.ts` — findById JOINs users_addresses (shipping+billing) + payments_transactions; toOrderView maps all new fields
|
||||
- `project/src/modules/orders/api/orders.routes.ts` — serializeOrder includes customerName/customerPhone/phone/shippingAddress/billingAddress/payment
|
||||
- `project/apps/admin/src/types/index.ts` — Order extended with Address, PaymentInfo, customerName, phone, shippingAddress, billingAddress, payment
|
||||
- `project/apps/admin/src/app/(dashboard)/orders/[id]/page.tsx` — new sidebar sections: Cliente, Dirección de envío, Dirección de facturación, Pago
|
||||
|
||||
## 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 customer data | ✅ | customerName/customerPhone/email/phone en OrderView y serialize |
|
||||
| AC2 shipping address | ✅ | users_addresses WHERE user_id AND type='shipping' → serialize |
|
||||
| AC3 billing address | ✅ | users_addresses WHERE user_id AND type='billing' → serialize |
|
||||
| AC4 payment | ✅ | payments_transactions WHERE order_id AND status='succeeded' latest → provider/status/last4 |
|
||||
| AC5 admin sections | ✅ | orders/[id]/page.tsx sidebar: Cliente + Envío + Facturación + Pago |
|
||||
| AC6 read-only | ✅ | Solo renderizado, sin edits |
|
||||
| AC7 tsc/verify | ✅ | tsc 0, verify verde |
|
||||
12
work/artifacts/F-140/leader-close.json
Normal file
12
work/artifacts/F-140/leader-close.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"feature_id": "F-140",
|
||||
"agent": "leader",
|
||||
"stage": "close",
|
||||
"verdict": "APPROVED",
|
||||
"summary": "F-140 closed: order detail enriched with customer/addresses/payment (migration 050 + OrderView + admin page sections). 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": []
|
||||
}
|
||||
12
work/artifacts/F-140/qa.json
Normal file
12
work/artifacts/F-140/qa.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"feature_id": "F-140",
|
||||
"agent": "qa",
|
||||
"stage": "qa_gate",
|
||||
"verdict": "APPROVED",
|
||||
"summary": "tsc 0, verify.sh green. No regressions.",
|
||||
"checks": [
|
||||
{"item": "tsc 0", "ok": true, "evidence": "npm run build 0 errors"},
|
||||
{"item": "verify.sh", "ok": true, "evidence": "exit 0"}
|
||||
],
|
||||
"issues": []
|
||||
}
|
||||
17
work/artifacts/F-140/reviewer.json
Normal file
17
work/artifacts/F-140/reviewer.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"feature_id": "F-140",
|
||||
"agent": "reviewer",
|
||||
"stage": "review_gate",
|
||||
"verdict": "APPROVED",
|
||||
"summary": "Order detail enriched: customer (name/email/phone), shipping address, billing address, payment (provider/status/last4). Admin page shows all in sidebar. tsc 0, verify green.",
|
||||
"checks": [
|
||||
{"item": "AC1 customer data", "ok": true, "evidence": "OrderView includes customerName/customerPhone/email/phone; serializeOrder maps them"},
|
||||
{"item": "AC2 shipping address", "ok": true, "evidence": "pg-order-repository findById JOINs users_addresses WHERE type='shipping'"},
|
||||
{"item": "AC3 billing address", "ok": true, "evidence": "pg-order-repository findById JOINs users_addresses WHERE type='billing'"},
|
||||
{"item": "AC4 payment info", "ok": true, "evidence": "payments_transactions WHERE order_id AND status='succeeded' latest; last4 extracted from provider_payment_id"},
|
||||
{"item": "AC5 admin sections", "ok": true, "evidence": "orders/[id]/page.tsx: Cliente + Envío + Facturación + Pago sections in sidebar"},
|
||||
{"item": "AC6 read-only", "ok": true, "evidence": "New sections are display-only; no edit forms added"},
|
||||
{"item": "tsc/verify", "ok": true, "evidence": "npm run build 0 errors; verify.sh green"}
|
||||
],
|
||||
"issues": []
|
||||
}
|
||||
13
work/artifacts/F-140/security.json
Normal file
13
work/artifacts/F-140/security.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"feature_id": "F-140",
|
||||
"agent": "security",
|
||||
"stage": "security_gate",
|
||||
"verdict": "APPROVED",
|
||||
"summary": "Read-only enrichment of existing admin endpoint. No new auth, no new routes, no new secrets. All data already accessible to admin role. last4 is non-sensitive (partial PAN).",
|
||||
"checks": [
|
||||
{"item": "Authentication", "ok": true, "evidence": "GET /orders/:id/admin already requires admin role; no change"},
|
||||
{"item": "No new secrets", "ok": true, "evidence": "No credentials or secrets added"},
|
||||
{"item": "No PII in logs", "ok": true, "evidence": "Only user data from existing DB rows; no new logging"}
|
||||
],
|
||||
"issues": []
|
||||
}
|
||||
Reference in New Issue
Block a user