# Bazaario — Product Requirements (v1.0)

Bazaario is a multi-seller online marketplace. Buyers discover products through an infinite-scroll feed and a timed flash sale, search with live suggestions, choose two-tier variations with per-combination stock, fill a cart grouped by shop, apply shop and platform vouchers and coins, pay by one of three methods and follow each per-shop order through its lifecycle.

**Problem.** Marketplace buyers combine items from several independent shops in one checkout. Discounts, shipping and stock rules differ per shop, so a single wrong rule produces wrong money totals or oversold goods. Buyers need totals, limits and order states that are always correct and explained.

## Users
- **Buyer** — Find the right product among lookalikes, buy from several shops at once and see exactly what is charged.
- **Shop owner** — Have vouchers, flash-sale limits and shipping thresholds honoured so promotions stay within budget.

## Goals
- Every price, discount, shipping fee and total shown to the buyer is correct to the cent.
- Stock and per-buyer limits are enforced by the server, never only by the screen.
- One checkout across several shops produces one order per shop whose totals add up to the amount paid.
- Discovery, search and cart interactions stay reliable under fast typing and long lists.

## Home feed and flash sale (DSC)

The home page shows a flash-sale strip and an infinite-scroll product feed.

- **FR-DSC-01** (Must) The Daily Discover feed loads more products as the buyer scrolls to the bottom, without paging buttons, until every product is shown exactly once.
  - Initially 10 product cards are shown and there is no "Next" or "Show more" button.
  - After the first scroll to the bottom, "Loading…" shows briefly and 20 cards are shown.
  - After the second scroll, 24 cards are shown with the text "You've reached the end · 24 products".
  - No product name appears twice.
- **FR-DSC-02** (Should) The Flash Sale strip lists the current deals with sale price, struck regular price, a stock indicator and a live countdown.
  - Three deals: Wireless Earbuds Pro $14.99 (was $29.99) "Almost sold out"; Ceramic Mug Set (4 pcs) $9.99 (was $18.99) "12 sold"; Snack Box Mix (24 pcs) $11.99 (was $15.99) "Only 3 left".
  - The "Ends in" countdown uses HH:MM:SS, is below 00:20:00 and decreases by about 5 seconds after 5 seconds.

## Search, sort and filters (SRC)

Buyers search with live suggestions, sort the results and narrow them with filters kept in the URL.

- **FR-SRC-01** (Should) Search suggestions always correspond to the latest text typed, even though responses arrive in a different order, and can be chosen by keyboard.
  - After typing "ear" and quickly replacing it with "linen", only Linen suggestions plus "Shop: Linen & Loom" are listed; no earbuds suggestion remains.
  - ArrowDown twice then Enter opens results for "Linen Drawstring Pants" with keyword=Linen%20Drawstring%20Pants in the URL.
  - Choosing "Shop: Linen & Loom" opens that shop page, which states "Free shipping on orders from $50.00 in this shop · otherwise $2.99".
- **FR-SRC-02** (Should) Search results distinguish lookalike products by exact name.
  - Searching "wireless earbuds pro" returns three lookalikes; only the product named exactly "Wireless Earbuds Pro" is the flash-sale item, showing "FLASH SALE", $14.99 with $29.99 struck and "Flash Sale price: limit 2 per buyer."
- **FR-SRC-03** (Should) Results can be ordered by Top Sales and by price using a listbox control.
  - For "linen", Top Sales gives Crew Socks 5-Pack, Canvas Tote Bag, Linen Bedsheet Set, Linen Drawstring Pants, Linen Shirt Relaxed Fit, and the URL has sort=sales.
  - "Price: Low to High" gives $11.99, $12.99, $34.99, $39.99, $59.99 and the button reads "Price: Low to High".
  - "Price: High to Low" starts with Linen Bedsheet Set $59.99 and ends with Crew Socks 5-Pack $11.99.
- **FR-SRC-04** (Should) Price range, Mall and rating filters combine with AND, are kept in the URL and survive a reload; an invalid range is refused.
  - Min 40 with max 20 shows "Please input valid price range" and the result list is unchanged.
  - Min 20 and max 40 on "linen" shows "2 products" (Linen Shirt Relaxed Fit $34.99, Linen Drawstring Pants $39.99) with min=20&max=40 in the URL; a reload keeps both.
  - Searching "home" with Bazaario Mall and rating "4 & Up" returns only Smart Power Strip (4.8); rating 5 returns "No results found. Try different or more general keywords."

## Variations, stock and flash limit (VAR)

Products have two-tier variations with per-combination price and stock; flash prices have a per-buyer limit.

- **FR-VAR-01** (Must) A product with variations cannot be added to the cart until a combination is chosen, sold-out combinations cannot be picked and the price follows the chosen combination.
  - Add To Cart with nothing chosen shows "Please select product variation first" and the cart badge is unchanged.
  - On the keyboard product, Switch "Blue" shows $74.99 and disables Colour "White".
  - Blue with Black shows "26 pieces available"; Red with White shows $69.99 and "27 pieces available".
  - On the earbuds, Colour Mint is disabled (sold out) while Black and White can be chosen.
- **FR-VAR-02** (Must) The server refuses any add that would take the quantity in the cart above available stock, counting what is already in the cart.
  - With 3 Smart Power Strips (all available) in the cart, adding 1 more shows "You have 3 in your cart. Only 3 available." and the cart still holds 3.
- **FR-VAR-03** (Must) A flash-sale price is limited to 2 units per buyer in total across all variations, in the product page and in the cart stepper.
  - Adding 3 Black at once shows "Flash Sale price is limited to 2 per buyer" and adds nothing.
  - Adding 1 Black and 1 White succeeds; one more White shows the same message.
  - In the cart, two lines at $14.99 are tagged "Flash Sale · limit 2"; pressing + keeps the quantity at 1 with the same message; "Total (2 items): $29.98".

## Cart by shop (CRT)

The cart groups lines by shop, with selection controlling what is bought and totalled.

- **FR-CRT-01** (Must) Cart lines are grouped per shop with a shop checkbox, per-line checkboxes and Select All; the total counts only ticked lines, and Check Out requires a selection.
  - Mouse Silent Black, Ceramic Mug Set Sage and Canvas Tote Bag show badge 3 and groups Volt Gadget Hub $14.99, Kitty Corner Home $9.99 (flash price), Linen & Loom $12.99; "Total (3 items): $37.97".
  - Unticking Kitty Corner Home gives "Total (2 items): $27.98" and unticks Select All (3).
  - Unticking everything gives "Total (0 items): $0.00"; Check Out shows "You have not selected any items." and stays on the cart.
- **FR-CRT-02** (Should) Changing a line's variation to one already in the cart merges the two lines and sums their quantities.
  - White/M ×1 and Navy/M ×2: changing White to Navy leaves one line "Variations: Navy, M" ×3 at $104.97 and the badge shows 1.
  - In the picker, size S is disabled while Navy is chosen (sold out).
- **FR-CRT-03** (Should) Removing items always asks for confirmation.
  - Pressing − at quantity 1 asks "Do you want to remove this item?"; "No" keeps the line.
  - Bulk Delete asks "Do you want to remove the 2 selected items?"; "Yes" shows "Your shopping cart is empty" and "Go Shopping Now".

## Shop and platform vouchers (VCH)

Shop vouchers are claimed by following a shop; platform vouchers FREESHIP, BIG10 and NEWUSER5 have their own conditions.

- **FR-VCH-01** (Must) A shop voucher can be claimed only by a logged-in buyer who follows the shop, and only once.
  - A guest pressing Claim is redirected to Log In.
  - A logged-in buyer who has not followed sees "Follow the shop to claim this voucher".
  - After "+ Follow" the button reads "✓ Following" with "48,211 followers"; Claim then shows "Claimed" and cannot be clicked again.
- **FR-VCH-02** (Must) A claimed shop voucher is unusable until the shop subtotal reaches its minimum spend, and the cart tells the buyer how far free shipping is.
  - With one Mouse Silent in the cart the Volt group footer reads "Add $15.01 more to get free shipping".
  - The "$3.00 off · Min. spend $25.00" voucher is disabled with "Spend $10.01 more in this shop".
  - At quantity 2 (subtotal $29.98, under the $30.00 free-shipping line) the voucher applies: Shop Voucher Discount −$3.00 and Standard Delivery $1.99.
- **FR-VCH-03** (Must) Platform vouchers enforce their conditions and explain why they cannot be used; BIG10 needs $40.00 of merchandise; typed codes are validated.
  - With merchandise $39.99, BIG10 is disabled with "Spend $0.01 more" and NEWUSER5 with "For new customers only"; FREESHIP is selectable.
  - Typing SAVE99 shows "Invalid voucher code"; typing NEWUSER5 shows "NEWUSER5: For new customers only".
  - FREESHIP on shipping $2.99 gives Bazaario Voucher Discount −$2.99 and Total Payment $39.99.
  - With merchandise $51.98, BIG10 gives Shipping Total $0.00, discount −$5.19 and Total Payment $46.79.

## Checkout and payment (CHK)

Checkout splits one purchase into one order per shop and supports BazaarPay with PIN, cash on delivery and bank transfer.

- **FR-CHK-01** (Must) A checkout across several shops applies shop vouchers, the platform voucher and coins, charges shipping per shop, and creates one order per shop whose totals add up to the amount paid.
  - Default address shows "Sam Rivera (312) 555-0187", "48 Orchard Lane, Apt 3B, Chicago, IL 60614".
  - Two Mouse Silent, one Ceramic Mug Set and one Canvas Tote Bag with the $3.00 shop voucher, FREESHIP and coins: coins row "Redeem 499 coins [−$4.99]", Merchandise Subtotal $52.96, Shipping Total $7.47, Shop Voucher Discount −$3.00, Bazaario Voucher Discount −$3.00, Coins Redeemed −$4.99, Total Payment $49.44, "Earn 49 coins".
  - Placing the order shows "Order placed" with three order IDs and opens "To Ship (3)".
  - Orders: Volt Gadget Hub $24.46, Kitty Corner Home $10.98, Linen & Loom $14.00, totalling $49.44; the coins balance reads 751; the cart is empty.
- **FR-CHK-02** (Must) Each shop in a checkout charges its own shipping fee, and the Shipping Total is their sum.
  - Mouse Silent Black and Canvas Tote Bag: Volt Gadget Hub "Standard Delivery · $1.99", Linen & Loom "Standard Delivery · $2.99", Shipping Total $4.98, Total Payment $32.96.
- **FR-CHK-03** (Must) An order cannot be placed without a payment method, and Cash on Delivery is unavailable for orders over $100.00.
  - Place Order with no method shows "Choose a payment method" and creates no order.
  - With Merchandise Subtotal $159.98 and Shipping Total $0.00 (both shops reach free shipping) the Cash on Delivery tile is disabled and says it is not available for orders over $100.00.
- **FR-CHK-04** (Must) Paying with BazaarPay requires a 6-digit PIN; wrong PINs count down the remaining tries and the correct PIN pays from the balance.
  - The chosen address can be changed (Office: "900 Lake Shore Dr, Floor 12, Chicago, IL 60611").
  - Place Order opens "Enter your BazaarPay PIN" with 6 boxes.
  - A wrong PIN shows "Incorrect PIN. 2 tries left." and clears the boxes.
  - The correct PIN shows "Order placed", opens To Ship and lowers the balance by the order total.
- **FR-CHK-05** (Must) Three wrong PINs lock BazaarPay for 15 minutes, and a correct PIN is refused while locked.
  - Second and third wrong PINs show "Incorrect PIN. 1 try left." then "BazaarPay is locked for 15 minutes after 3 wrong PINs".
  - Placing again with the correct PIN stays locked and creates no order.
- **FR-CHK-06** (Should) A bank-transfer order waits in To Pay with a virtual account and a pay-within countdown until the buyer marks it transferred.
  - My Purchases opens on "To Pay (1)"; the card shows "TO PAY", "Transfer $X to virtual account 8808 …" and a "Pay within" countdown below 15:00 that keeps ticking.
  - "I've Transferred" shows "Payment confirmed" and the order moves to To Ship.

## Order lifecycle (ORD)

Orders can be cancelled, received, rated, returned and searched.

- **FR-ORD-01** (Should) Cancelling a To Ship order requires a reason, refunds the BazaarPay balance and records the reason.
  - Confirming without a reason shows "Select a cancellation reason".
  - Choosing "Don't want to buy anymore" shows "Order … cancelled" and the balance returns to $150.00.
  - The Cancelled tab shows "Cancellation reason: Don't want to buy anymore" beside seeded order BZ-29990042.
- **FR-ORD-02** (Could) Confirming receipt earns coins; a rating needs stars and at least 15 characters; completed orders can be returned; orders can be searched.
  - Order Received on BZ-29990101 shows "Thanks! +26 coins" and the coins line reads 1,276.
  - Rating without stars or with "Nice mugs" is refused ("Tap the stars to rate" or "Write at least 15 characters to earn coins").
  - 5 stars with "Lovely glaze and sturdy handles" shows "Thanks for your rating! +20 coins" and "You rated ★★★★★".
  - Return/Refund with "Item is damaged" shows "Return requested" and moves the order to the Return Refund tab.
  - Searching orders for "tote" shows only BZ-29990042 (Linen & Loom).

## Non-functional requirements

- **NFR-01** (Must) All money rules (voucher minimums, flash limits, stock, shipping, COD limit, PIN lock) are enforced by the server, not only by the screen.
  - A rule refused on screen is also refused when the request is sent directly.
- **NFR-02** (Should) Every refusal tells the buyer why, with the exact reason and amount still needed.

## Glossary and rules

- **Flash Sale** — A timed discount with a per-buyer unit limit.
- **Shop voucher** — A voucher claimed by following a shop and valid only for that shop subtotal.
- **Platform voucher** — A Bazaario-wide voucher such as FREESHIP, BIG10 or NEWUSER5.
- **BazaarPay** — The in-app wallet protected by a 6-digit PIN.
- **Coins** — Loyalty points redeemable at 1 cent each against an order.

## Out of scope

- Real payments, shipping or chat with sellers
- Product review lists
- Accessibility audit
