Files
vmall/docs/code_index/catalog.md
T

29 lines
1.0 KiB
Markdown

# Index: Catalog
Domain design: `docs/domains/catalog.md`. Specs: `openspec/specs/product/`,
`category/`, `brand/`.
## Backend (`apps/api`)
| File | Holds |
|---|---|
| `src/modules/product/service.rs` | public list/detail, merchant CRUD, publish/unpublish, SKU upsert, template link validation |
| `src/modules/product/repo.rs` | SKU attach + sold_count aggregation |
| `src/modules/category/` | public category tree |
| `src/modules/brand/` | public list; admin whole-list replacement |
| `migrations/0003_catalog.sql`, `0005_seed_category_tree.sql`, `0008_brands.sql` | schema + seeds |
## Shared contract
`types.ts`: `Product`, `Sku`, `Category`, `Brand`, `ProductStatus`.
`api.ts`: `listProducts`, `getProduct`, `listCategories`, `listBrands`,
`shop.*` product/SKU methods, `admin.replaceBrands`.
## Frontends
- Mall: `pages/index.vue` (floors), `pages/search.vue`, `pages/goods/[id].vue`,
`components/ui/ProductCard.vue`
- Shop-admin: `pages/products/{index,new,[id]}.vue`,
`components/ProductForm.vue`
- Admin: `pages/brands.vue`