Supplier
Products, orders, wallet, statement, reports
Supplier Auth
Login page renders with supplier role indicator when role=supplier in URL
Supplier login submits to correct endpoint and stores tokens
Error toast displayed on failed supplier login
Supplier registration redirects to payment link
Toast shown when supplier registration succeeds without payment link
Logout clears all auth state and React Query cache
Login as new supplier clears previous user's cached data
Supplier Dashboard
Supplier product aggregation data loaded correctly
Chart time-filter labels render correctly
Product List & Status
Product list loads from SUPPLIER_PRODUCTS_LIST
Empty product list shows empty state
Product status labels and colours correct for all statuses (0, 1, 2, 3, 5)
Product status resolved from string synonyms (e.g. "deleted" → 3)
Unrecognised status string defaults to 0
Product filter: starts with empty defaults, no active filters
Applying filters sets applied state and marks hasActive=true
Clear all resets both local and applied filter state
Add / Edit Product
Add product POSTs to /supplier/add-product, returns productId
isDisplay normalised to 1 (truthy) and 0 (falsy) correctly
Edit product PUTs to /supplier/edit-product
Change product status (active/inactive) updates both productStatus and status fields
Soft-delete product sets status=3
Variants & Images
Add variant wraps in array and normalises isDisplay
Edit variant merges fields with variantId
Delete variant sends productId + variantId
Save images POSTs FormData with productImages[] to product endpoint
Delete image DELETEs by productImageIds
Stock Management
Edit Stock modal opens with variant names, original stock, totals
Modal does not render when isOpen=false
Modal does not render when product is null
Review & Save disabled when no stock changed
Review & Save enabled + Modified badge shown after stock change
+10 quick-adjust increases stock by 10
+50 stacks on top of previous adjustments
"Out of Stock" resets that variant to 0
Cancel / Close (×) button closes the modal
Review & Save opens confirmation showing only changed variants
Confirm saves only modified variants via API
Submitting with no changes short-circuits to close without confirm modal
Stock confirm modal shows +diff for increases, negative diff for decreases
Both action buttons disabled while saving
CTA button copy changes to loading state while saving
Batch stock save writes all variants in parallel
Singular/plural toast shown for 1 vs multiple variant updates
No API call or toast when update list is empty
Error toast shown with server message on save failure
isSaving reset to false after failure
Supplier Order List & Actions
Supplier delivery orders tagged OrderType=Online Order
Supplier store pickup orders tagged OrderType=Store Pickup
"All" mode merges Online + Store Pickup orders with correct tags
Supplier can dispatch an order
Dispatch falls back to default success message when server returns none
Supplier can cancel an order
Supplier can approve a return
Supplier can mark return as received
Store pickup completed with orderId + OTP
Order detail disabled when orderId not provided
Profile
Supplier profile loads with correct role
Supplier role accepts any gender value in profile schema
Invalid email / Aadhaar / PAN rejected
Profile update invalidates cache
Profile photo upload updates user record
Change Password
Supplier password changed via supplier endpoint
New password matching old password rejected
Server message displayed on success
Supplier Wallet
Supplier wallet logs load from supplier endpoint
Supplier wallet balance loaded
Balance returns 0 when walletAmt missing
Transfer button hidden for supplier on wallet page
Wallet stats show credited (settlement) + withdrawals (debited)
Supplier Wallet Table
Supplier columns: Commission, TDS, TCS, Shipping, Net Amount, Balance
Net Amount column labelled "Net Amount" for supplier
TDS cell shows percentage when TDSPercentage set
TCS cell shows percentage when TCSPercentage set
Commission/TDS/TCS/Shipping default to ₹0 when fields null
Expanded Row & Mobile Card
Expanded row shows parsed description + TDS/TCS percentages
Description row hidden when description reduces to "---"
TDS/TCS shown without % suffix when percentage fields null
GST defaults to 0% when GSTPercentage absent
Mobile card shows Commission label (not Txn Charges)
Commission breakdown info button shown when hasBreakdown is true
Commission defaults to ₹0 on mobile card when field null
Amount Breakdown modal shows all components + TDS + net
Supplier Withdrawals
Supplier withdrawal list loads from /supplier/withdrawals
Supplier withdrawal request submitted to /supplier/withdrawal-request
"Not found" / "no data" errors return empty list
Auth/server errors are rethrown
Withdrawal amount within balance and > 0 accepted
Amount of 0 or negative rejected
Amount exceeding available balance rejected
Amount over 8 characters rejected
Empty amount field rejected
Net credited amount is null for non-dealer (supplier gets full amount)
Account Statement
Account statement loads for selected date range
Numeric fields normalised correctly from API response
String numeric values coerced to numbers
Zero-filled response returned on API error (no crash)
Empty statement shown while no date range selected
TDS Reports Page
TDS rows render with formatted withdrawal ID and amount
Stat cards show total / paid / unpaid TDS correctly
Wallet Transfer and Withdrawal type badges visible
PAID / UNPAID status badges render correctly
Search by "paid" filters out unpaid rows
Empty state shown with API message when no records
Error state shown when fetch fails
TDS % defaults to 5% when field absent
Dash fallback when withdrawal_id and id both missing
Supplier Pending Orders
Supplier pending orders loaded with total amount
Orders normalised from PascalCase and snake_case field variants
Total falls back to sum of items when TotalPendingAmount is missing/zero
Synthetic orderUUID generated when missing from API
Default values applied: VariantName="N/A", StoreType="Online Order", status="Pending"
Non-numeric keys ignored when extracting orders
Empty response returned on API error (no crash)
Stable empty array returned while loading
Supplier Bank Accounts
Supplier bank accounts loaded from supplier endpoint
Public bank list cached locally
IFSC uppercased, primary flag coerced
Corrupt cache ignored and data refetched
Contact & Site Info
Valid contact form submission accepted
Name too short rejected
Message under 10 characters rejected
Site info fetched and cached
Site info not re-fetched when already cached