krishna_sales/CLAUDE.md
Bhanu Prakash Sai Potteri d5e4ebee5d Build app-434 field-sales console
API layer for sandbox app 434 (three workflows: Order Booking, Store,
Daily Reports) — ZinoClient, per-workflow client singletons, config ids,
types, and the source API docs.

Component library (Tailwind v4 + design tokens): buttons, reusable
(Card/Badge/Input/Select/Pagination/Modal/Spinner/EmptyState), generic +
wired record views (rv) and detail views (dv).

Screens + routing (react-router v7): login gate, auth-guarded console
shell with tab nav, and deep-linkable record/detail routes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 15:16:34 +05:30

33 lines
2.0 KiB
Markdown

# Krishna Sales
Vite + React + TypeScript frontend for **sandbox app 434** on the Zino platform.
- Base URL: `https://sandbox.getzino.in`
- Dev: `npm run dev` · Build: `npm run build` (`tsc -b && vite build`)
## Layout
- `src/api/client.ts``ZinoClient`, the HTTP client for the Zino gateway. Constructor is `new ZinoClient(baseUrl, workflowUuid, onAuthError?)`. Auth (login/logout/currentUser) + view/activity/upload calls. JWT persists in localStorage.
- `src/api/config.ts` — all app-434 ids: `APP_ID`, `BASE_URL`, and per-workflow uuids/activities/fields/views.
- `src/api/types.ts` — shared API response types.
- `src/docs/api/*.md` — the source API docs (one per workflow) these ids come from.
## Workflows (app 434)
The app has **three workflows**, each with its own `workflow_uuid`. `APP_ID` (434) is shared; every route is app-scoped (`/app/434/...`) except `/usr/login`. Instantiate one client per workflow: `new ZinoClient(BASE_URL, WORKFLOWS.<slug>.workflowUuid)`.
| Slug (config) | Name | Init activity | Other activities |
| --- | --- | --- | --- |
| `orderBooking` | Order Booking | Log Visit | Place Order, Productivity of Visit, Potential Mining, Close Order |
| `store` | Store | Init Activity | Edit Store |
| `dailyReports` | Daily Reports | Init Activity | Punch Out |
Field ids differ per activity even for the "same" field (e.g. Store's fields carry a `_2` suffix on init, `_3` on edit). Grid columns are noted in inline comments in `config.ts`. Always source ids from `config.ts`, never hardcode.
## Conventions
- Init activity → `POST /app/434/start`; subsequent activities → `POST /app/434/activity`. Both take `{workflow_uuid, activity_id, data, instance_id?}`.
- File/image fields: `POST /app/434/upload` (multipart) first, then send the returned `blob_path` as the field value.
- In-form option sources vary by field type: `wf-lookup/records`, `dataset-options`, `app-user/records` — see the per-workflow doc.
- When workflows/fields change, update `config.ts` from the docs in `src/docs/api/`.