Files
sar/.claude/skills/wds-4-ux-design/templates/instructions/data-api.instructions.md
julian 17c08e6392 chore: initial monorepo scaffold + WDS Phase 1+2 artifacts
- Nx 22.7 monorepo (pnpm 11.1, TypeScript 5.9, Node 24)
- apps/api: NestJS 11 (CJS conforme CODING-RULES.md PGD-DB-004)
- apps/web: React 19 + Vite 8 (ESM)
- libs/shared/api-interface: Zod contract base
- Docker Compose dev: Postgres 18, Valkey 8, MinIO, Mailpit
- WDS artifacts:
  - design-artifacts/A-Product-Brief/ (5 docs canônicos + 16 dialogs)
  - design-artifacts/B-Trigger-Map/ (hub + 4 personas + feature impact)
- Stack canon: STACK.md v2.2 + CODING-RULES.md v2.0 + brand.md
- AGENTS.md + README.md como entrada para devs/agentes

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 14:34:20 +00:00

70 lines
1.3 KiB
Markdown

# Data & API Requirements
**Include when:** Page requires data from APIs or external sources
---
## Data Sources
| Data Element | Source | Type | Required | Notes |
|--------------|--------|------|----------|-------|
| `{data-field}` | {API / static / localStorage} | {string / number / array} | {yes/no} | {notes} |
---
## API Endpoints
### {Endpoint Name}
| Property | Value |
|----------|-------|
| Method | {GET / POST / PUT / DELETE} |
| Path | `/api/{path}` |
| Purpose | {What this endpoint does} |
| Auth | {Required / Optional / None} |
**Request:**
```json
{
"field": "value"
}
```
**Response (Success):**
```json
{
"data": {}
}
```
**Response (Error):**
```json
{
"error": "message",
"code": "ERR_XXX"
}
```
**Error Codes:**
| Code | Meaning | User Message |
|------|---------|--------------|
| `{code}` | {technical meaning} | {user-friendly message} |
---
## Loading States
| State | Duration | UI |
|-------|----------|-----|
| Initial load | {expected ms} | {skeleton / spinner / etc.} |
| Refresh | {expected ms} | {indicator type} |
| Background | {expected ms} | {silent / toast} |
---
## Caching Strategy
| Data | Cache Duration | Invalidation |
|------|----------------|--------------|
| {data type} | {duration} | {when to refresh} |