Shop It Docs
Developer ResourcescatalogProduct

Catalog Product Feature List

Product module feature contract across admin, customer, and mobile surfaces.

Catalog Product - Feature List

1. Feature Overview

The product submodule owns sellable catalog items used by cart and order flows for physical products. It supports admin CRUD, public/customer discovery, featured storefront listing, and historical slug resolution.

2. Route Ownership and Surfaces

  • Admin controller: apps/api/src/modules/catalog/admin/product/product-admin.controller.ts
    • Base path: /api/admin/products
  • Customer controller: apps/api/src/modules/catalog/customer/product/product-customer.controller.ts
    • Base path: /api/products
  • Mobile composition: apps/api/src/modules/mobile/mobile.module.ts
    • Same customer controller additionally exposed as /api/mobile/products

3. Admin Feature Matrix

FeatureBehavior
List productsFilter/search/sort/paginate with permission Products_READ
Get product by idNumeric :id (ParseIntPipe)
Create productValidates pricing/category/tags and writes product + product_tag
Update productSupports partial updates, status transition validation, slug-history capture
Delete productHard delete by id with cache invalidation
Audit activityCreate/update/delete activity records when actor context is present

4. Customer/Mobile Feature Matrix

FeatureBehavior
Product listPublished + sellable products only
Featured products listReturns products linked through featured rows that are active and in date window
Product by slugResolves current slug first, then product_slug_history fallback
SearchTitle/description/category/tag ILIKE + title similarity threshold
PaginationSupported for list and featured list

5. Key Business Rules

  • Pricing rule: sp <= mrp.
  • Status transitions are constrained: draft -> published -> unlisted -> archived.
  • Customer reads always enforce status = published and isSellable = true.
  • Slug changes persist previous slug in product_slug_history.
  • Tag IDs are de-duplicated before persistence and must all exist.

6. State Models

Product lifecycle

Product type enum

  • thangka
  • singing_bowl
  • statue
  • jewellery

Physical detail fields

  • delivery: shipping/delivery information text.
  • materials: non-empty array of materials used in the product.
  • certificate: certificate identifier string.
  • isMasterGrade: master-grade marker for premium artifacts.
  • isBestSeller: bestseller marker for storefront merchandising.
  • size: physical size object; shape depends on productType.

Size shape contract by product type

productTypeshapeStructure
thangkarectangularinch: { width, height }, cm: { width, height }
singing_bowlradiusinch: number, cm: number
statueradiusinch: number, cm: number
jewellerycircumferenceinch: number, cm: number

7. Caching Strategy

Key PrefixUsed For
catalog:products:list:Customer list responses
catalog:product:slug:Product detail-by-slug responses
catalog:products:featured:Customer featured product list

TTL resolution in customer service:

  • CATALOG_PRODUCT_CACHE_TTL_SECONDS
  • fallback CATALOG_CACHE_TTL_SECONDS
  • fallback REDIS_CACHE_TTL_SECONDS

Admin write invalidation covers:

  • catalog:products:list:*
  • catalog:product:slug:*
  • catalog:products:featured:*

8. Rate Limiting

Search/list endpoints apply Redis sliding-window throttling in controllers:

  • Admin: CATALOG_ADMIN_PRODUCT_SEARCH_RATE_LIMIT, CATALOG_ADMIN_PRODUCT_SEARCH_RATE_WINDOW_SECONDS
  • Customer/mobile: CATALOG_CUSTOMER_PRODUCT_SEARCH_RATE_LIMIT, CATALOG_CUSTOMER_PRODUCT_SEARCH_RATE_WINDOW_SECONDS
  • Exceeded requests throw RateLimitExceededException (RATE_LIMIT_EXCEEDED).

9. Queue/Worker Features

No BullMQ queue or worker is implemented inside catalog product flows for this subphase.

10. Error UX Mapping

errorCodeTypical UX Handling
PRODUCT_NOT_FOUNDShow not-found page/toast and stop detail flow
PRODUCT_CATEGORY_NOT_FOUNDPrompt admin to choose valid category
PRODUCT_TAG_NOT_FOUNDPrompt admin to fix tag selection
PRODUCT_SP_EXCEEDS_MRPInline pricing validation error
PRODUCT_INVALID_STATUS_TRANSITIONBlock invalid status update with guidance
PRODUCT_INVALID_SORTFallback UI to default sort option
PRODUCT_CREATE_FAILEDGeneric admin retry/error banner
RATE_LIMIT_EXCEEDEDBackoff + retry after delay

11. Integration Flows

11.1 Product Creation Flow

An admin creates a product with category and tag associations.

  1. Admin calls POST /api/admin/products with title, description, pricing (sp, mrp), category, and tag IDs.
  2. System validates sp <= mrp and all category/tags exist.
  3. System creates product and associates tags via product_tag table.
  4. System captures product slug in product_slug_history on creation.
  5. Admin calls PATCH /api/admin/products/:id to transition status to published.

11.2 Customer Discovery Flow

A customer discovers and searches products via storefront.

  1. Customer calls GET /api/products to browse published + sellable products.
  2. Customer applies search query via GET /api/products?search=....
  3. System performs ILIKE on title/description and similarity scoring.
  4. Customer calls GET /api/products/featured to see featured products.
  5. Customer calls GET /api/products/:slug to view product detail.
  6. System resolves current slug first, then falls back to product_slug_history for legacy URLs.

11.3 Product Lifecycle Flow

An admin manages product status transitions with slug history.

  1. Product starts as draft status.
  2. Admin publishes product: draft -> published.
  3. Admin unlists product: published -> unlisted.
  4. Admin archives product: unlisted -> archived.
  5. On any slug change, system writes previous slug to product_slug_history for backward compatibility.

12. Release/QA Checklist

  • Verify admin CRUD permissions (Products_*) and swagger endpoints.
  • Verify list search against title/description/category/tag and similarity behavior.
  • Verify slug-history resolution for old product URLs.
  • Verify cache invalidation after create/update/delete.
  • Verify admin and customer rate-limit behavior in Redis-backed environments.

See Also