Files
vmall/docs/code_index/catalog.md
T
Chengdong ZhangandCursor 3188bf7672 feat(pricing): price configurable products before marketing
Versioned common and linear rules compute the payable price and snapshot it on the order, with the design reference for later strategies such as agreement pricing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-18 14:25:06 +08:00

1.9 KiB

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, fulfillment kind (draft-only change, no freight template on a service), publish/unpublish, SKU upsert, template link validation, component spec check
src/modules/product/repo.rs SKU attach + sold_count aggregation; listing price, strategy, option groups; hides the anchor SKU
src/modules/pricing/ common and linear rules, option groups, quote, listing price, anchor sales cap
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, 0028_fulfillment_kinds.sql, 0029_pricing.sql schema + seeds; products.fulfillment_kind; versioned pricing rules

Shared contract

types.ts: Product, Sku, Category, Brand, ProductStatus, FulfillmentKind, OptionGroup, PricingQuote, PricingRuleVersion. Product.listing_price_minor is the cached linear price; anchor_sku_id is the hidden sales-cap SKU. api.ts: listProducts, getProduct, quoteProduct, listCategories, listBrands, shop.* product/SKU/option-group/pricing-rule methods, admin.replaceBrands.

Frontends

  • Mall: pages/index.vue (floors), pages/search.vue, pages/goods/[id].vue (service products buy now and skip the cart; a linear product configures seats, storage, a component SKU, and term before quoting), components/ui/ProductCard.vue (linear cards show the listing price)
  • Shop-admin: pages/products/{index,new,[id]}.vue, components/ProductForm.vue (kind selector; freight and weight hidden for a service), components/PricingEditor.vue (option groups, linear rule publish, preview, version history, component-only flag)
  • Admin: pages/brands.vue