phone number + country
This commit is contained in:
@@ -12,6 +12,7 @@ pub type Orders = Entity;
|
||||
/// database inside [`place`] so the customer cannot influence what they pay.
|
||||
pub struct Checkout {
|
||||
pub email: String,
|
||||
pub phone: String,
|
||||
pub customer_name: Option<String>,
|
||||
pub address: Option<String>,
|
||||
pub city: Option<String>,
|
||||
@@ -64,6 +65,7 @@ pub async fn place(ctx: &AppContext, items: &[(i32, i32)], details: Checkout) ->
|
||||
let order = ActiveModel {
|
||||
order_number: Set(generate_order_number()),
|
||||
email: Set(details.email),
|
||||
phone: Set(Some(details.phone)),
|
||||
customer_name: Set(details.customer_name),
|
||||
status: Set("pending".to_string()),
|
||||
total_cents: Set(subtotal + details.method.price_cents),
|
||||
|
||||
Reference in New Issue
Block a user