Fix product preorder and warranty submit flow
This commit is contained in:
35
HANDOFF.md
35
HANDOFF.md
@ -22,6 +22,41 @@ npx tsc --noEmit
|
||||
|
||||
## Latest Codex Changes After `76fb4f3`
|
||||
|
||||
### Product create preorder and warranty submit rules
|
||||
|
||||
Files:
|
||||
- `src/app/(dashboard)/products/new/details/page.tsx`
|
||||
- `src/app/(dashboard)/products/new/specifications/page.tsx`
|
||||
- `src/app/(dashboard)/products/new/review/page.tsx`
|
||||
- `src/lib/product-draft.tsx`
|
||||
- `src/lib/use-product-submit.ts`
|
||||
- `src/lib/product-request-validation.ts`
|
||||
|
||||
Behavior:
|
||||
- Pre-order day placeholder is now `0`, not `14`, so an empty/unfilled value is visually obvious.
|
||||
- If pre-order is checked, the Details step blocks Next unless `preOrderDay` is a valid number greater than or equal to 1.
|
||||
- Warranty now has an On/Off switch in the Specifications step.
|
||||
- When warranty is On:
|
||||
- warranty type is required
|
||||
- warranty duration must be greater than or equal to 1
|
||||
- the review page shows warranty information
|
||||
- submit payload sends the filled `warrantyInformation` object
|
||||
- When warranty is Off:
|
||||
- warranty inputs are disabled and dimmed
|
||||
- the review page hides warranty information
|
||||
- submit payload still sends `warrantyInformation` as an object required by the backend, with:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": null,
|
||||
"duration": null,
|
||||
"durationType": "MONTH"
|
||||
}
|
||||
```
|
||||
|
||||
- Frontend payload validation treats the above null-valued warranty object as warranty Off, so it does not block submit with warranty type/duration errors.
|
||||
- Local test server was rebuilt and restarted against `https://api-dev.inatrading.co.id` in `.env.local`; `.env.local` is not committed.
|
||||
|
||||
### AddProductRequest validation
|
||||
|
||||
Files:
|
||||
|
||||
Reference in New Issue
Block a user