From 8f05576464ccc14752a8050c8fdda0d806beb485 Mon Sep 17 00:00:00 2001 From: Wira Irawan Date: Mon, 25 May 2026 11:33:35 +0700 Subject: [PATCH] Update handoff notes for onboarding and review flows --- HANDOFF.md | 151 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 140 insertions(+), 11 deletions(-) diff --git a/HANDOFF.md b/HANDOFF.md index 3085c97..d81d0f9 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -2,11 +2,11 @@ Project: `ina-trading-web` Current branch: `main` -Latest verified commit: `b266047` +Latest verified commit: `7e6446b` ## Summary -This codebase has recent updates around product creation, edit, review, detail, admin review, stock/price editing, and backend request logging. +This codebase has recent updates around auth/onboarding, help/privacy pages, dashboard search, product creation/edit/review/detail, admin review/detail, stock/price editing, seller in-review listing, and backend request logging. The latest build was verified successfully with: @@ -16,12 +16,54 @@ npm run build ## Recent Commits +- `7e6446b` `Refine seller onboarding and product review flows` - `e9a0cd0` `Update product review, measurement, and backend logging flows` - `b266047` `Fix TypeScript build errors in product detail and admin review` ## Main Changes -### 1. Backend proxy logging +### 1. Auth, help, and onboarding + +Files: +- `next.config.ts` +- `src/app/(onboarding)/layout.tsx` +- `src/app/(auth)/login/page.tsx` +- `src/app/(auth)/register/verify/page.tsx` +- `src/app/(auth)/forgot-password/page.tsx` +- `src/app/(auth)/account-not-found/page.tsx` +- `src/app/help/page.tsx` +- `src/app/privacy/page.tsx` +- `src/app/terms/page.tsx` + +Behavior: +- Seller onboarding is enabled again +- Seller login redirects incomplete seller profiles to onboarding +- Register verify flow redirects seller to onboarding instead of dashboard +- Forgot password support link opens default mail app to `admin@inatrading.co.id` +- Forgot password `?` button links to public `/help` +- Account-not-found `Bantuan`, `Kebijakan Privasi`, and `Syarat & Ketentuan` link to public pages +- Login `Remember me` now stores email and password in localStorage + +### 2. Onboarding seller final submit flow + +Files: +- `src/app/(onboarding)/onboarding/business/page.tsx` +- `src/app/(onboarding)/onboarding/store-detail/page.tsx` +- `src/app/api/seller/route.ts` +- `src/app/api/seller/store/route.ts` +- `src/app/api/warehouses/route.ts` + +Behavior: +- Plan step was removed from seller onboarding UI flow +- `Warehouse Type` is hidden in UI and forced to `INA` +- Final onboarding submit is not a single endpoint. It calls, in order: + 1. `POST /api/seller` -> host `POST /api/v1.0/seller` + 2. `PUT /api/seller/store` -> host `PUT /api/v1.0/seller/store` + 3. `GET /api/products/warehouses?page=1&size=100` + 4. `PUT /api/warehouses/{id}` or `POST /api/warehouses` +- Frontend tries to reuse backend autogenerated warehouse if found, to avoid duplicate warehouse creation + +### 3. Backend proxy logging Files: - `src/lib/backend-fetch-logger.ts` @@ -36,7 +78,7 @@ Behavior: Use this when tracing frontend-to-backend failures in local dev. -## 2. Product measurement mode on add product +## 4. Product measurement mode on add product Files: - `src/app/(dashboard)/products/new/pricing/page.tsx` @@ -52,7 +94,7 @@ Behavior: - Submit payload uses `model.hasMeasurements` - When measurement mode is active, model-level numeric fields are zeroed and model warehouses are omitted -## 3. Product measurement mode on edit product +## 5. Product measurement mode on edit product File: - `src/app/(dashboard)/products/[productId]/edit/page.tsx` @@ -62,7 +104,7 @@ Behavior: - Uses explicit `hasMeasurements` state instead of guessing from array length - Disables model-level fields when measurement mode is on -## 4. Seller product review page improvements +## 6. Seller product review page improvements File: - `src/app/(dashboard)/products/new/review/page.tsx` @@ -72,10 +114,11 @@ Behavior: - Previously it only showed image indicators, which was confusing - Review also reflects measurement-based pricing correctly -## 5. Product list page improvements +## 7. Product list page improvements File: - `src/app/(dashboard)/products/page.tsx` +- `src/lib/product-variants.ts` Behavior: - Edit stock/price modal supports: @@ -84,18 +127,38 @@ Behavior: - choosing warehouse - Warehouse labels use warehouse names from master warehouse API, not raw UUIDs - Product row status badges now show explicit state like active, draft, review, unpublished, deleted, rejected +- Seller `In Review` listing now uses host endpoint `/api/v1.0/seller/product/review` +- If list API returns `minPrice = 0` and `maxPrice = 0`, frontend hydrates that row by fetching product detail and calculating effective price from model/measurement data -## 6. Product detail page improvements +Important: +- This fallback exists because some list rows from backend do not include valid min/max price for measurement-based products +- Example verified case: product `Pembersih Mobil` returned `0/0` in list but `IDR 50.000` in detail measurement + +## 8. Product detail page improvements File: - `src/app/(dashboard)/products/[productId]/detail/page.tsx` +- `src/components/product-variant-showcase.tsx` +- `src/lib/product-variants.ts` Behavior: - Main category now resolves even when backend omits `subCategory.category.name` - Warehouse display now uses warehouse master names instead of UUID slices - TypeScript nullability issue for category resolution was fixed here +- Seller detail, admin detail, and admin review now share the same variant presentation logic +- Effective price rules: + - no measurement: use model price + - with measurement: use measurement price + - multiple measurements: show min-max from measurements + - multiple models: show min-max from effective model prices +- Variant showcase now supports: + - product-level summary price/weight/dimension + - model selector + - measurement selector + - selected variant detail + - model image thumbnail switching -## 7. Admin review page improvements +## 9. Admin review page improvements File: - `src/app/admin/review/[productId]/page.tsx` @@ -106,8 +169,27 @@ Behavior: - Compare view highlights updated sections using backend compare response and `isUpdate` - Product images are rendered using main image + gallery images - TypeScript issue around `row.field` nullability was fixed here +- Single-product review view now follows admin product detail layout more closely +- Compare view stays separate only for product update review +- Approve/reject action flow: + - UI `POST /api/admin/review/{productId}` + - new create accept -> host `POST /api/v1.0/product/accept/{productId}` with `{ "state": "PUBLISHED" }` + - update accept -> host `PUT /api/v1.0/product/accept/{productId}` with `{ "state": "PUBLISHED" }` + - create reject -> host `POST /api/v1.0/product/reject/{productId}` + - update reject -> host `PUT /api/v1.0/product/reject/{productId}` +- Review approve does not resubmit full product payload. It only submits action and state. -## 8. Sidebar submenu reliability +## 10. Dashboard shell and search + +Files: +- `src/app/(dashboard)/layout.tsx` +- `src/app/(dashboard)/dashboard/page.tsx` + +Behavior: +- Bell and message icons are intentionally grayed/disabled because no backend function exists yet +- Dashboard search now resolves query results across dashboard content instead of behaving like a dead input + +## 11. Sidebar submenu reliability Files: - `src/components/product-submenu-nav.tsx` @@ -126,6 +208,28 @@ These include labels added for statuses and stock/price modal UI. ## Important Findings +### Product image inconsistency on `Pembersih Mobil` + +Verified seller account: +- `Pendopo@Pendopo.com` +- password: `password` + +Product: +- `Pembersih Mobil` +- ID: `92a8fae0-d067-4c90-be24-da31012aeaf9` + +Verified backend behavior: +- list endpoint row returned `minPrice: 0`, `maxPrice: 0` +- detail endpoint returned one measurement priced at `IDR 50.000` +- detail endpoint currently returns: + - `imageId: null` + - `productImages: []` + - `model.imageId: null` + +Implication: +- product images are currently absent in backend detail payload for this product +- if user reports image visible in older browser tab, suspect stale tab state before assuming frontend regression + ### Admin review image issue For at least one reviewed product, backend review payload returned: @@ -142,6 +246,14 @@ In edit product submit flow, empty `imageId` is currently sent as `undefined`, w If backend requires explicit image removal via `null`, this behavior will need to be changed. +### Seller in-review API note + +Postman latest collection contains: +- seller review listing: `/api/v1.0/seller/product/review` +- generic review detail: `/api/v1.0/product/review/{productId}` + +Current app matches this for listing and still uses generic review detail endpoint for product review detail. + ## Local Dev Notes Run local dev: @@ -163,6 +275,8 @@ Based on current deployment notes, dev server update flow is: ```bash sudo -iu inadev cd ~/apps/ina-trading-web +git fetch origin +git checkout main git pull origin main npm ci npm run build @@ -171,6 +285,18 @@ pm2 save sudo -iu inadev pm2 status ``` +Current expected deployed commit after latest push: + +```bash +7e6446b +``` + +Verify on server: + +```bash +git rev-parse HEAD +``` + Optional logs: ```bash @@ -182,6 +308,8 @@ sudo -iu inadev pm2 logs ina-trading-dev --lines 100 - Verify whether backend expects `null` when main image is intentionally removed during edit - Verify seller and admin review payload consistency for image fields - Verify warehouse master API always contains all warehouse IDs referenced in product payloads +- Verify whether seller in-review detail also has a seller-specific detail endpoint in backend/Postman, to align with seller-specific listing endpoint +- Investigate when product images were lost for `Pembersih Mobil` and whether edit/update flow can preserve old image ids more defensively - If submenu click issue still appears, inspect layout overlays with browser tooling - Consider adding field-level compare highlighting, not only section-level highlighting, in admin review compare page @@ -193,6 +321,7 @@ sudo -iu inadev pm2 logs ina-trading-dev --lines 100 - `src/app/(dashboard)/products/[productId]/detail/page.tsx` - `src/app/(dashboard)/products/page.tsx` - `src/app/admin/review/[productId]/page.tsx` +- `src/components/product-variant-showcase.tsx` +- `src/lib/product-variants.ts` - `src/lib/use-product-submit.ts` - `src/lib/backend-fetch-logger.ts` -