Skip to content

BE Endpoint request #28

@orangejacob

Description

@orangejacob

Please provide the necessary end-point and response interface.

The typings can be found in typings folder.

The types are not final, just change as you like as long as it works.

As of current, these are the mock data interface used in FE.

1. Merchanise Detail

  • Purpose: Get Merchanise Detail
  • Request: {slug: merchanise-slug}
  • Response: {slug: string, images: string[], name: string, sizes: string[], description: string}

Note:

  1. Sizes are passed back in form of ["S', "M"]. In the case that BE doesn't pass in certain sizes, FE will disable the checkbox.
  2. Description are parsed in FE, separated by /n for
    and * for

2. Global Context - Shopping Cart

  • Purpose: Validate existence of cart items, because some items maybe out-of-date after e.g. 100 days.
  • Request: {
  • items:{
  • id: string,
  • size: string,
  • quantity: number}[],
  • appliedVoucher: string
  • }
  • Response: {items: {id:string, imgUrl: string, size: string, price: number, quantity: number, itemName: string}[] , voucherDetail:{id: string, isPercentage: boolean, discount: number, description: string}

Logic Flow

  1. User add to cart, FE stores (id, size, quantity) in local-storage, and additional (img, price) in Context.
  2. On shopping-cart, trigger Fetch, BE filter out what's already non-existence (including Voucher).

*3. Order History

  • Purpose: User checkback their purchased history.
  • Request: Incognito stuff
  • Response: {
  • orders: {
  • orderNo: string,
  • status: enum of status,
  • items: {id: string, imgUrl: string, size: string, price: number, quantity: number, itemName: string}
  • }[],
  • billing: {total:number, subtotal:number, appliedVoucher: {id: string, isPercentage: boolean, discount: number, description: string}
  • orderDate: string;
  • lastUpdate: string
  • }

*4. Order Summary
Same as point 3, but return only 1 order item

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions