Files
vmall/docs/code_index/order.md
T

1.6 KiB

Index: Order & Freight

Domain design: docs/domains/orders.md. Specs: openspec/specs/order/, shipment/, shipping/.

Backend (apps/api)

File Holds
src/modules/order/service.rs checkout transaction, pay/cancel, shipping quote
src/modules/order/repo.rs ORDER_COLS/ORDER_ITEM_COLS, insert_order/insert_item, locks, status transitions
src/modules/order/handlers.rs /orders* customer routes, /shop/orders*, /admin/orders
src/modules/order/dto.rs OrderView, AddressBody, ShippingQuoteView
src/modules/fulfillment/ shipments: create (company-validated), ship, confirm-delivered
src/modules/freight/service.rs template CRUD, region rules, shop_fee() calculation, company dictionary
src/modules/freight/handlers.rs /shop/freight-templates*, /shipping/companies
migrations/0004_orders.sql orders/order_items/shipments base schema
migrations/0017_freight_templates.sql freight tables, orders.shipping_fee_minor, item snapshots, skus.weight_grams
tests/orders.rs, tests/freight.rs integration coverage

Shared contract (packages/shared/src)

types.ts: Order, OrderItem, Shipment, FreightTemplate*, ShippingCompany, ShippingQuote. api.ts: checkout, quoteShipping, listShippingCompanies, shop freight CRUD, createShipment.

Frontends

  • Mall: pages/checkout/{index,pay,success}.vue, pages/user/orders/, pages/user/addresses.vue
  • Shop-admin: pages/orders/, pages/shipments.vue, pages/freight-templates.vue, components/ProductForm.vue (freight template + SKU weight)
  • Admin: pages/orders.vue (read-only)