# Dashboard CRUD plan — `<Entity>`

> **One file per admin CRUD**, saved at `docs/project/cruds/<entity>.md`. **Self-contained:** any agent builds
> the full CRUD from this file alone. Produced **before the dashboard sprint**. Drives `build-dashboard-crud`.

## 1) Entity & screens
- Model: `<Entity>` (table `<...>`) · translatable? `<yes: fields>` · soft-delete? `<...>` · media? `<collections>`
- Admin screens (Figma if any): list / create / edit / show — `<links>`

## 2) Columns (single source — from the approved schema)
| Column | Type | Form field | Table column | Filter | Validation (ar/en) |
|--------|------|-----------|--------------|--------|--------------------|
| `<...>` | `<...>` | `<input/select/switch>` | `<show?>` | `<yes?>` | `<rules>` |

## 3) Build flags (decide EACH — never infer)
- statistics cards? · diagrams? · exports (Excel/Word/PDF)? · soft-delete + restore UI? · block/active toggle?
  · read-only (submission-only)? · sidebar single vs dropdown? · show-page relations (stats/tables/both)?

## 4) Logic / rules (consolidated from analysis)
- Business rules, status transitions, permissions, side effects (events/jobs/notifications).

## 4b) Show page — full 360° view (list what to display)
- **Related entities:** `<belongsTo/hasMany/morph → what to show>` (e.g. Order → customer, counterparty, address, courier).
- **Related lists + quick counts:** `<child rows in mini-tables + counts>` (e.g. Country → cities & districts + counts).
- **Status visual:** `<progress bar / stepper for staged flows>` + status pill + timeline/log if there's an events table.
- Statistics cards for this section (scientific): `<which KPIs>`.

## 5) Sidebar & translations (mandatory)
- **Sidebar entry:** the CRUD MUST appear in the sidebar — `config/sidebar_routes.php` key `{plural}`, icon `ti ti-*`,
  single link or under a dropdown/group; label: `<ar>` / `<en>`; position: `<...>`.
- **Nothing untranslated:** EVERY user-facing string must exist in **both** `lang/ar` and `lang/en` — sidebar entry,
  page titles, table headers, form labels/placeholders, buttons, validation messages, enum values/labels,
  statistics-card titles, flash messages. **Zero hardcoded Arabic/English** in views/controller.

## 6) Build checklist
- [ ] controller (`AdminBaseController`) + service (`CrudBaseService`) + Form Requests (Store/Update)
- [ ] views (index / table / create / edit / show + statistics) + routes + **sidebar entry** + route translations
- [ ] **all strings translated ar+en** (per §5) — verified nothing hardcoded
- [ ] permissions auto-discovered (`admin.*`) · factory/seeder real data · tests
