Set order account id as optional

This commit is contained in:
Adrian Woźniak 2022-06-10 15:15:12 +02:00
parent 9b1e95fe81
commit fd2afc6ae9
No known key found for this signature in database
GPG Key ID: 0012845A89C7352B
3 changed files with 11 additions and 3 deletions

View File

@ -239,7 +239,9 @@ WHERE id = $1
#[derive(actix::Message)]
#[rtype(result = "Result<Order>")]
pub struct SetOrderServiceId {
/// Internal order id
pub id: OrderId,
/// Payment external service id
pub service_order_id: String,
}

View File

@ -167,7 +167,7 @@ impl From<(crate::Order, Vec<crate::OrderItem>)> for Order {
#[derive(Serialize, Deserialize, Debug)]
pub struct Order {
pub id: crate::OrderId,
pub buyer_id: crate::AccountId,
pub buyer_id: Option<crate::AccountId>,
pub status: crate::OrderStatus,
pub items: Vec<crate::OrderItem>,
pub checkout_notes: Option<String>,

View File

@ -934,11 +934,17 @@ impl ExtOrderId {
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct Order {
pub id: OrderId,
pub buyer_id: AccountId,
/// Optional customer account id
pub buyer_id: Option<AccountId>,
/// Order status
pub status: OrderStatus,
/// ID send to external payment service as an identifier
pub order_ext_id: uuid::Uuid,
/// ID received from external payment service as an identifier
pub service_order_id: Option<String>,
/// Optional notes given by customer
pub checkout_notes: Option<String>,
/// Delivery address
pub address_id: OrderAddressId,
}
@ -947,7 +953,7 @@ pub struct Order {
#[derive(Serialize, Deserialize)]
pub struct PublicOrder {
pub id: OrderId,
pub buyer_id: AccountId,
pub buyer_id: Option<AccountId>,
pub status: OrderStatus,
pub checkout_notes: String,
pub address_id: OrderAddressId,