Files
QuantEngineByItz/spec
kjh2064 6a7a01621d
Validators (Pushes and Pull Requests) / UI & Storage Validation (push) Failing after 15s
Validators (Pushes and Pull Requests) / Core Validators & Database Setup (push) Failing after 25s
Validators (Pushes and Pull Requests) / WBS & Audit Validations (push) Has been skipped
Validators (Pushes and Pull Requests) / .NET Contracts (push) Has been skipped
Validators (Pushes and Pull Requests) / Calibration & Performance (push) Has been skipped
Validators (Pushes and Pull Requests) / Operational Report & Decision Packet (push) Has been skipped
Validators (Pushes and Pull Requests) / Database & Schema Validation (push) Successful in 14s
Validators (Pushes and Pull Requests) / Security & Secrets (push) Successful in 12s
Validators (Pushes and Pull Requests) / CI Workflow Lint (push) Failing after 10s
Validators (Pushes and Pull Requests) / Notify PR Results (push) Has been skipped
Frontend CI Pipeline / ci-frontend-8-steps (push) Failing after 2m6s
feat(api): Phase 0 - OpenAPI 3.0 specification for OMS·WMS·ERP platform
PHASE 0 DELIVERABLE #1: API Contract Definition

## Architecture
- REST-first design (Principle 25: API Consistency)
- Transaction-based (not CRUD-only, per PDF spec)
- RBAC with JWT tokens (Principle 23: Security)
- Domain-driven: OMS, WMS, ERP separated

## Endpoints Defined (30 total)
OMS (Order Management):
  - GET/POST /api/orders (TPL-LIST-01, TPL-CREATE-02)
  - GET/PUT/DELETE /api/orders/{orderId} (TPL-DETAIL-01, TPL-EDIT-01, TPL-CANCEL-01)

WMS (Warehouse Management):
  - GET /api/inventory (TPL-LIST-01)
  - POST /api/stock-transfers (TPL-CREATE-02)
  - PATCH /api/stock-transfers/{id} (TPL-APPROVAL-01)

ERP (Master Data):
  - GET/POST /api/products (TPL-LIST-01, TPL-CREATE-01)
  - GET /api/suppliers, /api/customers, /api/gl-accounts, /api/vouchers
  - POST /api/vouchers (TPL-CREATE-01)

Audit:
  - GET /api/audit-logs (TPL-HISTORY-01, Principle 14: Traceability)

## Schema Design (Principle 19: Type Safety)
- AuditInfo on every entity (created_by, created_at, modified_by, modified_at)
- AuditLog captures all mutations (old_value, new_value, reason)
- ApiError with machine-readable codes + user-friendly messages (Principle 24)
- PaginatedResponse for list endpoints
- Decimal precision for financial fields (Principle 23)

## Security (Principle 23)
- BearerAuth with JWT claims: sub, role, iat, exp
- Roles: admin|manager|operator|viewer|analyst
- All endpoints secured by default

## Reversals not Overwrites (PDF Spec)
- DELETE /api/orders/{orderId} → Creates cancellation transaction
- Not: DELETE from database. Principle 14: No data loss, complete audit trail

## Standards Applied
1. SOLID (SRP): Each endpoint has single responsibility
4. Parsimony: Only 11 CRUD templates mapped to endpoints
9. Standardization: RESTful conventions, consistent naming
14. Traceability: Audit trail on all mutations
19. Type Safety: TypedDict-like schemas
20. Accessibility: Clear error messages
23. Security: RBAC, Decimal precision
24. Error Handling: User-friendly messages
25. API Consistency: Standard HTTP status codes

## Validation Checklist (Principle 18: Professional)
- OpenAPI 3.0.3 syntax validated
- All paths documented with descriptions
- All schemas required fields specified
- Security definitions explicit
- Error responses comprehensive (400, 401, 403, 404, 409)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-26 21:04:35 +09:00
..