Skip to content

Chain Module ​

Public Summary ​

Manages supermarket chain entities (e.g. Vero, Ramstore) with image association and cascading relationships to markets and products.

Internal Details ​

Files ​

Standard CRUD layer: controller, service, routes, schema, model, repository (7 files).

Endpoints ​

MethodPathAuthDescription
GET/chainsPublicList chains (paginated, searchable)
GET/chains/:idJWTGet chain detail
POST/chainsJWTCreate chain
PUT/chains/:idJWTUpdate chain
DELETE/chains/:idJWTDelete chain + cascade
GET/chains/reportJWTCSV report

Data Model — Chain ​

name  : String (unique, required)
image : ObjectId → Image (optional)

Virtual: markets — populated via Market.chain back-reference.

Cascade Delete ​

Deleting a chain removes:

  1. All associated Markets linked to the chain.
  2. All MarketProduct junction records for those markets.

Source Anchors ​

PathRelevance
apps/server/src/modules/chain/Controller, service, routes, schema, model, repository

Obrok engineering documentation.