Platform-owned points products and a redemption order lifecycle kept separate from cash orders. Redeeming locks the published product, reserves stock, creates the order, debits points through the archived customer-accounts ledger with the order as reference, and snapshots the line in one transaction; a failure leaves no order, no stock change, and no ledger entry. Fulfilment moves only from pending_fulfillment, and customers see only their own redemptions. Demo seeding credits the demo customer through the same guarded credit path with reason seed, once, so no balance is ever written absolutely. Surfaces (admin console, mall points page) and product seeding follow.
37 lines
815 B
Rust
37 lines
815 B
Rust
pub mod account;
|
|
pub mod address;
|
|
pub mod billing;
|
|
pub mod cart;
|
|
pub mod catalog;
|
|
pub mod content;
|
|
pub mod coupon;
|
|
pub mod currency;
|
|
pub mod fulfillment;
|
|
pub mod health;
|
|
pub mod identity;
|
|
pub mod order;
|
|
pub mod points;
|
|
pub mod shop;
|
|
|
|
use axum::Router;
|
|
|
|
use crate::state::AppState;
|
|
|
|
pub fn api_router() -> Router<AppState> {
|
|
Router::new()
|
|
.merge(health::router())
|
|
.merge(account::router())
|
|
.merge(address::router())
|
|
.merge(identity::router())
|
|
.merge(currency::router())
|
|
.merge(catalog::router())
|
|
.merge(content::router())
|
|
.merge(cart::router())
|
|
.merge(coupon::router())
|
|
.merge(order::router())
|
|
.merge(points::router())
|
|
.merge(shop::router())
|
|
.merge(fulfillment::router())
|
|
.merge(billing::router())
|
|
}
|