wip(freight): migration 0017 + model/column-list groundwork for add-freight-templates
This commit is contained in:
@@ -110,6 +110,8 @@ pub struct Sku {
|
||||
pub price_minor: i64,
|
||||
pub currency: String,
|
||||
pub stock: i32,
|
||||
/// Grams per unit for by-weight freight; null lines contribute zero weight.
|
||||
pub weight_grams: Option<i32>,
|
||||
pub active: bool,
|
||||
}
|
||||
|
||||
@@ -175,6 +177,8 @@ pub struct Order {
|
||||
pub discount_minor: i64,
|
||||
/// Authoritative sum of completed after-sale refunds.
|
||||
pub refund_total_minor: i64,
|
||||
/// Server-computed per-shop-order shipping fee.
|
||||
pub shipping_fee_minor: i64,
|
||||
/// The coupon this order redeemed, if any.
|
||||
pub coupon_id: Option<Uuid>,
|
||||
/// Group-buying activity this order joined, if any.
|
||||
@@ -198,6 +202,9 @@ pub struct OrderItem {
|
||||
pub qty: i32,
|
||||
/// Set when this line received flash-sale pricing.
|
||||
pub flash_sale_item_id: Option<Uuid>,
|
||||
/// Freight template + pricing method snapshotted at checkout.
|
||||
pub freight_template_id: Option<Uuid>,
|
||||
pub freight_pricing_method: Option<FreightPricingMethod>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Type)]
|
||||
@@ -230,6 +237,14 @@ impl AftersaleStatus {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Type)]
|
||||
#[sqlx(type_name = "freight_pricing_method", rename_all = "snake_case")]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum FreightPricingMethod {
|
||||
ByPiece,
|
||||
ByWeight,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, sqlx::FromRow)]
|
||||
pub struct Shipment {
|
||||
pub id: Uuid,
|
||||
|
||||
Reference in New Issue
Block a user