phone number + country

This commit is contained in:
Priec
2026-06-17 18:02:46 +02:00
parent cd7a756a54
commit d18bdeaf6e
13 changed files with 96 additions and 6 deletions

View File

@@ -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),