mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-09-30 22:03:11 +00:00
Document the backend #66 producer, drop incomplete extras from persist, and show the same required-field errors on POC 2+.
30 lines
1.4 KiB
Markdown
30 lines
1.4 KiB
Markdown
# Work-order `additionalContacts` contract (SH-218)
|
|
|
|
Authoritative frontend contract for additional POC 2+ contacts. Implemented on
|
|
backend PR [shoc-backend#66](https://github.com/Sea-Haven-Industries/shoc-backend/pull/66).
|
|
|
|
## Shape
|
|
|
|
```ts
|
|
{ name: string; phone: string; notes?: string }
|
|
```
|
|
|
|
- Primary POC remains `pocName` / `pocPhone` / `pocNotes`.
|
|
- `additionalContacts` holds ordered POC 2+ only.
|
|
- Notes are optional. An empty list (or omitted field) is valid.
|
|
- Retained entries require **both** `name` and `phone`. Fully blank placeholder
|
|
rows are dropped and must not fail create. Name-only or phone-only entries are
|
|
rejected on POST create and PATCH.
|
|
|
|
## Endpoints
|
|
|
|
| Operation | Where |
|
|
| ------------------ | ------------------------------------------------------------- |
|
|
| POST create | `additionalContacts` array on the board create body |
|
|
| GET board / search | `additionalContacts` on each board row |
|
|
| GET detail | `info.additionalContacts` (same ordered list as board) |
|
|
| PATCH | `field: "additionalContacts"`, `value` is a JSON array string |
|
|
|
|
Until #66 is merged to the deployed API, a missing field is still mapped as `[]`
|
|
on the frontend so the UI does not throw. After merge, create → reload →
|
|
board/slide-over must round-trip the ordered list through GET detail `info`.
|