// This file is @generated by prost-build.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Order {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub user_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub currency_code: ::prost::alloc::string::String,
    /// All price fields in cents
    #[prost(uint64, tag = "4")]
    pub subtotal_cents: u64,
    #[prost(uint64, tag = "5")]
    pub shipping_cents: u64,
    #[prost(uint64, tag = "6")]
    pub tax_cents: u64,
    #[prost(uint64, tag = "7")]
    pub discount_cents: u64,
    #[prost(uint64, tag = "8")]
    pub total_cents: u64,
    /// Payment information
    #[prost(string, tag = "9")]
    pub payment_provider: ::prost::alloc::string::String,
    #[prost(string, tag = "10")]
    pub payment_transaction_id: ::prost::alloc::string::String,
    #[prost(string, tag = "11")]
    pub payment_status: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "12")]
    pub payment_provider_response: ::core::option::Option<
        super::super::shared::v1::Struct,
    >,
    #[prost(uint64, tag = "13")]
    pub payment_fee_cents: u64,
    /// Inventory status
    #[prost(string, tag = "14")]
    pub inventory_reservation_status: ::prost::alloc::string::String,
    /// Product information
    #[prost(string, tag = "15")]
    pub product_source: ::prost::alloc::string::String,
    /// Address snapshots
    #[prost(message, optional, tag = "16")]
    pub shipping_address: ::core::option::Option<super::super::shared::v1::Struct>,
    #[prost(message, optional, tag = "17")]
    pub billing_address: ::core::option::Option<super::super::shared::v1::Struct>,
    /// Metadata
    #[prost(message, optional, tag = "18")]
    pub metadata: ::core::option::Option<super::super::shared::v1::Struct>,
    #[prost(string, tag = "19")]
    pub status: ::prost::alloc::string::String,
    /// Timestamps
    #[prost(uint64, tag = "20")]
    pub created_at: u64,
    #[prost(uint64, optional, tag = "21")]
    pub updated_at: ::core::option::Option<u64>,
    #[prost(uint64, optional, tag = "22")]
    pub deleted_at: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum PaymentStatus {
    PaymentUnknown = 0,
    PaymentAuthorized = 1,
    PaymentCaptured = 2,
    PaymentFailed = 3,
}
impl PaymentStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::PaymentUnknown => "PAYMENT_UNKNOWN",
            Self::PaymentAuthorized => "PAYMENT_AUTHORIZED",
            Self::PaymentCaptured => "PAYMENT_CAPTURED",
            Self::PaymentFailed => "PAYMENT_FAILED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "PAYMENT_UNKNOWN" => Some(Self::PaymentUnknown),
            "PAYMENT_AUTHORIZED" => Some(Self::PaymentAuthorized),
            "PAYMENT_CAPTURED" => Some(Self::PaymentCaptured),
            "PAYMENT_FAILED" => Some(Self::PaymentFailed),
            _ => None,
        }
    }
}
/// Order status
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderStatus {
    Created = 0,
    Confirmed = 1,
    Shipped = 2,
    Delivered = 3,
    Cancelled = 4,
    Refunded = 5,
    RefundRequested = 6,
    PaymentSucceeded = 7,
    PaymentFailed = 8,
}
impl OrderStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Created => "ORDER_STATUS_CREATED",
            Self::Confirmed => "ORDER_STATUS_CONFIRMED",
            Self::Shipped => "ORDER_STATUS_SHIPPED",
            Self::Delivered => "ORDER_STATUS_DELIVERED",
            Self::Cancelled => "ORDER_STATUS_CANCELLED",
            Self::Refunded => "ORDER_STATUS_REFUNDED",
            Self::RefundRequested => "ORDER_STATUS_REFUND_REQUESTED",
            Self::PaymentSucceeded => "ORDER_STATUS_PAYMENT_SUCCEEDED",
            Self::PaymentFailed => "ORDER_STATUS_PAYMENT_FAILED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_STATUS_CREATED" => Some(Self::Created),
            "ORDER_STATUS_CONFIRMED" => Some(Self::Confirmed),
            "ORDER_STATUS_SHIPPED" => Some(Self::Shipped),
            "ORDER_STATUS_DELIVERED" => Some(Self::Delivered),
            "ORDER_STATUS_CANCELLED" => Some(Self::Cancelled),
            "ORDER_STATUS_REFUNDED" => Some(Self::Refunded),
            "ORDER_STATUS_REFUND_REQUESTED" => Some(Self::RefundRequested),
            "ORDER_STATUS_PAYMENT_SUCCEEDED" => Some(Self::PaymentSucceeded),
            "ORDER_STATUS_PAYMENT_FAILED" => Some(Self::PaymentFailed),
            _ => None,
        }
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderCancelRequest {
    #[prost(string, tag = "1")]
    pub order_id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub reason: ::prost::alloc::string::String,
    /// whether to attempt an immediate refund (if payment captured)
    #[prost(bool, tag = "3")]
    pub refund: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderCancelResponse {
    #[prost(oneof = "order_cancel_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<order_cancel_response::Response>,
}
/// Nested message and enum types in `OrderCancelResponse`.
pub mod order_cancel_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::super::super::shared::v1::SuccessResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
/// CreateOrder: synchronous payment capture
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderCreateRequest {
    /// idempotency key provided by client to avoid duplicate orders
    #[prost(string, tag = "1")]
    pub idempotency_key: ::prost::alloc::string::String,
    /// currency code (ISO 4217)
    #[prost(string, tag = "3")]
    pub currency_code: ::prost::alloc::string::String,
    /// order-level metadata (free-form, e.g., channel, campaign utm)
    #[prost(map = "string, string", tag = "4")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// shipping and billing addresses: use shared.v1.Struct
    /// provide existing address type (keeps proto flexible)
    #[prost(message, optional, tag = "5")]
    pub shipping_address: ::core::option::Option<super::super::shared::v1::Struct>,
    #[prost(message, optional, tag = "6")]
    pub billing_address: ::core::option::Option<super::super::shared::v1::Struct>,
    /// list of items to order
    #[prost(message, repeated, tag = "7")]
    pub items: ::prost::alloc::vec::Vec<OrderLineItemRequest>,
    /// shipping method id or chosen shipping service
    #[prost(string, tag = "8")]
    pub shipping_method: ::prost::alloc::string::String,
    /// coupon / promotion codes
    #[prost(string, repeated, tag = "9")]
    pub promotion_codes: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// payment information token (card token, stripe payment method id, etc.)
    /// For PCI, clients should use tokenization and not send raw card numbers.
    #[prost(string, tag = "10")]
    pub payment_method_token: ::prost::alloc::string::String,
    /// optional client-provided note
    #[prost(string, tag = "11")]
    pub customer_note: ::prost::alloc::string::String,
}
/// Line item in create request. Qty + source product reference.
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderLineItemRequest {
    #[prost(string, tag = "1")]
    pub product_id: ::prost::alloc::string::String,
    /// optional SKU/variant id
    #[prost(string, tag = "2")]
    pub variant_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub sku: ::prost::alloc::string::String,
    #[prost(uint32, tag = "4")]
    pub quantity: u32,
    /// Optionally client can pass a desired price verification to aid checks:
    /// e.g., unit_price_cents_client = 1000 (means client expected price = 10.00)
    /// This helps detect mismatches (promotions or stale inventory).
    #[prost(uint64, optional, tag = "5")]
    pub unit_price_cents_client: ::core::option::Option<u64>,
    /// metadata for line (gift wrap, special options)
    #[prost(map = "string, string", tag = "6")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderCreateResponse {
    #[prost(oneof = "order_create_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<order_create_response::Response>,
}
/// Nested message and enum types in `OrderCreateResponse`.
pub mod order_create_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::super::super::shared::v1::SuccessResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderEvent {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub order_id: ::prost::alloc::string::String,
    /// e.g., ORDER_CREATED, PAYMENT_CAPTURED
    #[prost(string, tag = "3")]
    pub event_type: ::prost::alloc::string::String,
    /// arbitrary payload with details
    #[prost(message, optional, tag = "4")]
    pub event_payload: ::core::option::Option<super::super::shared::v1::Struct>,
    /// UNIX timestamp
    #[prost(uint64, tag = "5")]
    pub created_at: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderEventType {
    OrderEventUnknown = 0,
    OrderEventOrderCreated = 1,
    OrderEventPaymentCaptured = 2,
    OrderEventPaymentFailed = 3,
    OrderEventOrderShipped = 4,
    OrderEventOrderDelivered = 5,
    OrderEventOrderCancelled = 6,
    OrderEventOrderItemRefunded = 7,
    OrderEventOrderItemRefundRequested = 8,
    OrderEventInventoryReserved = 9,
    OrderEventInventoryReleased = 10,
}
impl OrderEventType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::OrderEventUnknown => "ORDER_EVENT_UNKNOWN",
            Self::OrderEventOrderCreated => "ORDER_EVENT_ORDER_CREATED",
            Self::OrderEventPaymentCaptured => "ORDER_EVENT_PAYMENT_CAPTURED",
            Self::OrderEventPaymentFailed => "ORDER_EVENT_PAYMENT_FAILED",
            Self::OrderEventOrderShipped => "ORDER_EVENT_ORDER_SHIPPED",
            Self::OrderEventOrderDelivered => "ORDER_EVENT_ORDER_DELIVERED",
            Self::OrderEventOrderCancelled => "ORDER_EVENT_ORDER_CANCELLED",
            Self::OrderEventOrderItemRefunded => "ORDER_EVENT_ORDER_ITEM_REFUNDED",
            Self::OrderEventOrderItemRefundRequested => {
                "ORDER_EVENT_ORDER_ITEM_REFUND_REQUESTED"
            }
            Self::OrderEventInventoryReserved => "ORDER_EVENT_INVENTORY_RESERVED",
            Self::OrderEventInventoryReleased => "ORDER_EVENT_INVENTORY_RELEASED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_EVENT_UNKNOWN" => Some(Self::OrderEventUnknown),
            "ORDER_EVENT_ORDER_CREATED" => Some(Self::OrderEventOrderCreated),
            "ORDER_EVENT_PAYMENT_CAPTURED" => Some(Self::OrderEventPaymentCaptured),
            "ORDER_EVENT_PAYMENT_FAILED" => Some(Self::OrderEventPaymentFailed),
            "ORDER_EVENT_ORDER_SHIPPED" => Some(Self::OrderEventOrderShipped),
            "ORDER_EVENT_ORDER_DELIVERED" => Some(Self::OrderEventOrderDelivered),
            "ORDER_EVENT_ORDER_CANCELLED" => Some(Self::OrderEventOrderCancelled),
            "ORDER_EVENT_ORDER_ITEM_REFUNDED" => Some(Self::OrderEventOrderItemRefunded),
            "ORDER_EVENT_ORDER_ITEM_REFUND_REQUESTED" => {
                Some(Self::OrderEventOrderItemRefundRequested)
            }
            "ORDER_EVENT_INVENTORY_RESERVED" => Some(Self::OrderEventInventoryReserved),
            "ORDER_EVENT_INVENTORY_RELEASED" => Some(Self::OrderEventInventoryReleased),
            _ => None,
        }
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderLineItem {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub order_id: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub product_id: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub variant_id: ::prost::alloc::string::String,
    #[prost(string, tag = "5")]
    pub sku: ::prost::alloc::string::String,
    /// product title snapshot
    #[prost(string, tag = "6")]
    pub title: ::prost::alloc::string::String,
    /// snapshot attributes map
    #[prost(map = "string, string", tag = "7")]
    pub attributes: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// CHECK (quantity > 0)
    #[prost(int32, tag = "8")]
    pub quantity: i32,
    /// Price fields in cents
    ///
    /// charged price per unit at order time
    #[prost(uint64, tag = "9")]
    pub unit_price_cents: u64,
    /// optional
    #[prost(uint64, optional, tag = "10")]
    pub list_price_cents: ::core::option::Option<u64>,
    /// optional
    #[prost(uint64, optional, tag = "11")]
    pub sale_price_cents: ::core::option::Option<u64>,
    /// total discount applied to this line (all units)
    #[prost(uint64, optional, tag = "12")]
    pub discount_cents: ::core::option::Option<u64>,
    /// tax for this line (total)
    #[prost(uint64, tag = "13")]
    pub tax_cents: u64,
    /// (quantity * unit_price) - discount + tax
    #[prost(uint64, tag = "14")]
    pub total_cents: u64,
    /// array of applied offer/promotion ids
    #[prost(string, repeated, tag = "15")]
    pub applied_offer_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// full product snapshot for audit/debug
    #[prost(message, optional, tag = "16")]
    pub product_snapshot: ::core::option::Option<super::super::shared::v1::Struct>,
    #[prost(string, tag = "17")]
    pub status: ::prost::alloc::string::String,
    #[prost(uint64, tag = "18")]
    pub shipping_cents: u64,
    /// Timestamps
    ///
    /// UNIX timestamp
    #[prost(uint64, tag = "19")]
    pub created_at: u64,
    /// optional UNIX timestamp
    #[prost(uint64, optional, tag = "20")]
    pub updated_at: ::core::option::Option<u64>,
}
/// Order status
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderLineItemStatus {
    Created = 0,
    Confirmed = 1,
    Shipped = 2,
    Delivered = 3,
    Cancelled = 4,
    Refunded = 5,
    RefundRequested = 6,
}
impl OrderLineItemStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Created => "ORDER_LINE_ITEM_STATUS_CREATED",
            Self::Confirmed => "ORDER_LINE_ITEM_STATUS_CONFIRMED",
            Self::Shipped => "ORDER_LINE_ITEM_STATUS_SHIPPED",
            Self::Delivered => "ORDER_LINE_ITEM_STATUS_DELIVERED",
            Self::Cancelled => "ORDER_LINE_ITEM_STATUS_CANCELLED",
            Self::Refunded => "ORDER_LINE_ITEM_STATUS_REFUNDED",
            Self::RefundRequested => "ORDER_LINE_ITEM_STATUS_REFUND_REQUESTED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_LINE_ITEM_STATUS_CREATED" => Some(Self::Created),
            "ORDER_LINE_ITEM_STATUS_CONFIRMED" => Some(Self::Confirmed),
            "ORDER_LINE_ITEM_STATUS_SHIPPED" => Some(Self::Shipped),
            "ORDER_LINE_ITEM_STATUS_DELIVERED" => Some(Self::Delivered),
            "ORDER_LINE_ITEM_STATUS_CANCELLED" => Some(Self::Cancelled),
            "ORDER_LINE_ITEM_STATUS_REFUNDED" => Some(Self::Refunded),
            "ORDER_LINE_ITEM_STATUS_REFUND_REQUESTED" => Some(Self::RefundRequested),
            _ => None,
        }
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderItem {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    /// monetary amounts are stored in minor units (cents) to avoid float errors
    #[prost(uint64, tag = "3")]
    pub subtotal_cents: u64,
    #[prost(uint64, tag = "4")]
    pub shipping_cents: u64,
    #[prost(uint64, tag = "5")]
    pub tax_cents: u64,
    #[prost(uint64, tag = "6")]
    pub discount_cents: u64,
    #[prost(uint64, tag = "7")]
    pub total_cents: u64,
    #[prost(string, tag = "8")]
    pub currency_code: ::prost::alloc::string::String,
    /// line items snapshot
    #[prost(message, repeated, tag = "9")]
    pub line_items: ::prost::alloc::vec::Vec<OrderLineItem>,
    /// shipping & billing addresses (snapshot)
    #[prost(message, optional, tag = "10")]
    pub shipping_address: ::core::option::Option<super::super::shared::v1::Struct>,
    #[prost(message, optional, tag = "11")]
    pub billing_address: ::core::option::Option<super::super::shared::v1::Struct>,
    /// Payment snapshot (synchronous capture info)
    #[prost(message, optional, tag = "12")]
    pub payment: ::core::option::Option<PaymentSnapshot>,
    /// Inventory reservation status - since inventory service is separate,
    /// we include reservation status in order so UI shows what's reserved.
    #[prost(
        enumeration = "super::super::inventory::v1::InventoryReservationStatus",
        tag = "13"
    )]
    pub inventory_reservation_status: i32,
    /// order lifecycle
    ///
    /// e.g., CREATED, CONFIRMED, SHIPPED, CANCELLED, REFUNDED
    #[prost(string, tag = "14")]
    pub status: ::prost::alloc::string::String,
    #[prost(uint64, tag = "15")]
    pub created_at: u64,
    #[prost(uint64, optional, tag = "16")]
    pub updated_at: ::core::option::Option<u64>,
    /// product/service traceability
    ///
    /// e.g., product service name/version
    #[prost(string, tag = "17")]
    pub product_source: ::prost::alloc::string::String,
    /// product_version that was used for snapshot
    #[prost(string, tag = "18")]
    pub product_version: ::prost::alloc::string::String,
    /// free-form metadata
    #[prost(map = "string, string", tag = "19")]
    pub metadata: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// //////////////////////////////////////////////////////////////////////////////
/// Payment snapshot (synchronous capture)
/// //////////////////////////////////////////////////////////////////////////////
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PaymentSnapshot {
    /// provider e.g., "stripe"
    #[prost(string, tag = "1")]
    pub provider: ::prost::alloc::string::String,
    /// provider transaction id (gateway charge id)
    #[prost(string, tag = "2")]
    pub transaction_id: ::prost::alloc::string::String,
    /// capture status: AUTHORIZED/CAPTURED/FAILED
    #[prost(string, tag = "3")]
    pub status: ::prost::alloc::string::String,
    /// card token or payment method id (tokenized)
    #[prost(string, tag = "4")]
    pub payment_method: ::prost::alloc::string::String,
    /// provider raw response for auditing (tokenized, avoid PII)
    #[prost(message, optional, tag = "5")]
    pub provider_response: ::core::option::Option<super::super::shared::v1::Struct>,
    /// payment fees (in cents) charged by gateway, optional
    #[prost(uint64, optional, tag = "6")]
    pub fee_cents: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderGetRequest {
    #[prost(string, tag = "1")]
    pub order_id: ::prost::alloc::string::String,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderGetResponse {
    #[prost(oneof = "order_get_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<order_get_response::Response>,
}
/// Nested message and enum types in `OrderGetResponse`.
pub mod order_get_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::OrderItem),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderIdempotencyKey {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub idempotency_key: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub user_id: ::prost::alloc::string::String,
    #[prost(string, optional, tag = "4")]
    pub order_id: ::core::option::Option<::prost::alloc::string::String>,
    /// "IN_PROGRESS", "COMPLETED", "FAILED"
    #[prost(string, tag = "5")]
    pub status: ::prost::alloc::string::String,
    #[prost(uint64, tag = "6")]
    pub created_at: u64,
    #[prost(uint64, optional, tag = "7")]
    pub updated_at: ::core::option::Option<u64>,
    #[prost(uint64, tag = "8")]
    pub expires_at: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderIdempotencyKeyStatus {
    Unspecified = 0,
    InProgress = 1,
    Completed = 2,
    Failed = 3,
}
impl OrderIdempotencyKeyStatus {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "ORDER_IDEMPOTENCY_KEY_STATUS_UNSPECIFIED",
            Self::InProgress => "ORDER_IDEMPOTENCY_KEY_STATUS_IN_PROGRESS",
            Self::Completed => "ORDER_IDEMPOTENCY_KEY_STATUS_COMPLETED",
            Self::Failed => "ORDER_IDEMPOTENCY_KEY_STATUS_FAILED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_IDEMPOTENCY_KEY_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
            "ORDER_IDEMPOTENCY_KEY_STATUS_IN_PROGRESS" => Some(Self::InProgress),
            "ORDER_IDEMPOTENCY_KEY_STATUS_COMPLETED" => Some(Self::Completed),
            "ORDER_IDEMPOTENCY_KEY_STATUS_FAILED" => Some(Self::Failed),
            _ => None,
        }
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderRefundResponse {
    #[prost(oneof = "order_refund_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<order_refund_response::Response>,
}
/// Nested message and enum types in `OrderRefundResponse`.
pub mod order_refund_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::super::super::shared::v1::SuccessResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderRefundRequest {
    #[prost(string, tag = "1")]
    pub order_id: ::prost::alloc::string::String,
    /// the item to be refunded
    #[prost(message, optional, tag = "2")]
    pub item: ::core::option::Option<RefundLineItemRefund>,
    /// reason code, external refund id, etc.
    #[prost(string, tag = "3")]
    pub reason: ::prost::alloc::string::String,
    #[prost(bool, tag = "4")]
    pub refund_shipping: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RefundLineItemRefund {
    /// link to OrderLineItem.id
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(uint32, tag = "2")]
    pub quantity: u32,
    /// amount to refund in minor units (cents). If zero, compute pro-rata.
    ///
    /// **Pro-rata refund** = Refund proportional to the original price distribution.
    ///
    /// **Example:**
    /// - Order total: $100 ($60 Item A + $40 Item B)
    /// - Shipping: $10
    /// - You refund Item B ($40)
    /// - Pro-rata calculation: Item B was 40% of product total ($40/$100)
    /// - Refund: $40 (item) + $4 (40% of shipping) = **$44 total refund**
    ///
    /// **Without pro-rata:** You'd only refund $40 (lose shipping cost)
    ///
    /// **Used when:** Partial refunds where shipping/taxes/fees need to be fairly distributed.
    #[prost(uint64, optional, tag = "3")]
    pub amount_cents: ::core::option::Option<u64>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrdersListRequest {
    #[prost(message, optional, tag = "1")]
    pub pagination: ::core::option::Option<super::super::shared::v1::PaginationRequest>,
    #[prost(string, repeated, tag = "2")]
    pub status: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrdersListResponse {
    #[prost(oneof = "orders_list_response::Response", tags = "1, 2")]
    pub response: ::core::option::Option<orders_list_response::Response>,
}
/// Nested message and enum types in `OrdersListResponse`.
pub mod orders_list_response {
    #[derive(serde::Serialize, serde::Deserialize)]
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Response {
        #[prost(message, tag = "1")]
        Data(super::OrdersListResponseData),
        #[prost(message, tag = "2")]
        Error(super::super::super::shared::v1::AppError),
    }
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrdersListResponseData {
    #[prost(message, repeated, tag = "1")]
    pub orders: ::prost::alloc::vec::Vec<OrderListItem>,
    #[prost(message, optional, tag = "2")]
    pub pagination: ::core::option::Option<super::super::shared::v1::PaginationResponse>,
}
/// OrderListItem for minimal listing
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderListItem {
    #[prost(string, tag = "1")]
    pub id: ::prost::alloc::string::String,
    #[prost(int64, tag = "2")]
    pub shipping_cents: i64,
    #[prost(int64, tag = "3")]
    pub total_cents: i64,
    #[prost(string, tag = "4")]
    pub currency_code: ::prost::alloc::string::String,
    /// Inventory reservation status - since inventory service is separate,
    /// we include reservation status in order so UI shows what's reserved.
    #[prost(
        enumeration = "super::super::inventory::v1::InventoryReservationStatus",
        tag = "5"
    )]
    pub inventory_reservation_status: i32,
    /// order lifecycle
    ///
    /// e.g., CREATED, CONFIRMED, SHIPPED, CANCELLED, REFUNDED
    #[prost(string, tag = "6")]
    pub status: ::prost::alloc::string::String,
    #[prost(uint64, tag = "7")]
    pub created_at: u64,
}
/// Generated client implementations.
pub mod orders_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct OrdersServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl OrdersServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> OrdersServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> OrdersServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            OrdersServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Create order: synchronous payment capture. Returns order snapshot if success.
        pub async fn order_create(
            &mut self,
            request: impl tonic::IntoRequest<super::OrderCreateRequest>,
        ) -> std::result::Result<
            tonic::Response<super::OrderCreateResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/orders.v1.OrdersService/OrderCreate",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("orders.v1.OrdersService", "OrderCreate"));
            self.inner.unary(req, path, codec).await
        }
        /// Get order by id
        pub async fn order_get(
            &mut self,
            request: impl tonic::IntoRequest<super::OrderGetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::OrderGetResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/orders.v1.OrdersService/OrderGet",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("orders.v1.OrdersService", "OrderGet"));
            self.inner.unary(req, path, codec).await
        }
        /// List orders for user (with simple pagination)
        pub async fn orders_list(
            &mut self,
            request: impl tonic::IntoRequest<super::OrdersListRequest>,
        ) -> std::result::Result<
            tonic::Response<super::OrdersListResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/orders.v1.OrdersService/OrdersList",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("orders.v1.OrdersService", "OrdersList"));
            self.inner.unary(req, path, codec).await
        }
        /// Cancel order (subject to business rules). Refunds handled separately.
        pub async fn order_cancel(
            &mut self,
            request: impl tonic::IntoRequest<super::OrderCancelRequest>,
        ) -> std::result::Result<
            tonic::Response<super::OrderCancelResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/orders.v1.OrdersService/OrderCancel",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("orders.v1.OrdersService", "OrderCancel"));
            self.inner.unary(req, path, codec).await
        }
        /// Refund an order or order line(s)
        pub async fn order_refund(
            &mut self,
            request: impl tonic::IntoRequest<super::OrderRefundRequest>,
        ) -> std::result::Result<
            tonic::Response<super::OrderRefundResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/orders.v1.OrdersService/OrderRefund",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("orders.v1.OrdersService", "OrderRefund"));
            self.inner.unary(req, path, codec).await
        }
    }
}
/// Generated server implementations.
pub mod orders_service_server {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    /// Generated trait containing gRPC methods that should be implemented for use with OrdersServiceServer.
    #[async_trait]
    pub trait OrdersService: std::marker::Send + std::marker::Sync + 'static {
        /// Create order: synchronous payment capture. Returns order snapshot if success.
        async fn order_create(
            &self,
            request: tonic::Request<super::OrderCreateRequest>,
        ) -> std::result::Result<
            tonic::Response<super::OrderCreateResponse>,
            tonic::Status,
        >;
        /// Get order by id
        async fn order_get(
            &self,
            request: tonic::Request<super::OrderGetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::OrderGetResponse>,
            tonic::Status,
        >;
        /// List orders for user (with simple pagination)
        async fn orders_list(
            &self,
            request: tonic::Request<super::OrdersListRequest>,
        ) -> std::result::Result<
            tonic::Response<super::OrdersListResponse>,
            tonic::Status,
        >;
        /// Cancel order (subject to business rules). Refunds handled separately.
        async fn order_cancel(
            &self,
            request: tonic::Request<super::OrderCancelRequest>,
        ) -> std::result::Result<
            tonic::Response<super::OrderCancelResponse>,
            tonic::Status,
        >;
        /// Refund an order or order line(s)
        async fn order_refund(
            &self,
            request: tonic::Request<super::OrderRefundRequest>,
        ) -> std::result::Result<
            tonic::Response<super::OrderRefundResponse>,
            tonic::Status,
        >;
    }
    #[derive(Debug)]
    pub struct OrdersServiceServer<T> {
        inner: Arc<T>,
        accept_compression_encodings: EnabledCompressionEncodings,
        send_compression_encodings: EnabledCompressionEncodings,
        max_decoding_message_size: Option<usize>,
        max_encoding_message_size: Option<usize>,
    }
    impl<T> OrdersServiceServer<T> {
        pub fn new(inner: T) -> Self {
            Self::from_arc(Arc::new(inner))
        }
        pub fn from_arc(inner: Arc<T>) -> Self {
            Self {
                inner,
                accept_compression_encodings: Default::default(),
                send_compression_encodings: Default::default(),
                max_decoding_message_size: None,
                max_encoding_message_size: None,
            }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> InterceptedService<Self, F>
        where
            F: tonic::service::Interceptor,
        {
            InterceptedService::new(Self::new(inner), interceptor)
        }
        /// Enable decompressing requests with the given encoding.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.accept_compression_encodings.enable(encoding);
            self
        }
        /// Compress responses with the given encoding, if the client supports it.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.send_compression_encodings.enable(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.max_decoding_message_size = Some(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.max_encoding_message_size = Some(limit);
            self
        }
    }
    impl<T, B> tonic::codegen::Service<http::Request<B>> for OrdersServiceServer<T>
    where
        T: OrdersService,
        B: Body + std::marker::Send + 'static,
        B::Error: Into<StdError> + std::marker::Send + 'static,
    {
        type Response = http::Response<tonic::body::Body>;
        type Error = std::convert::Infallible;
        type Future = BoxFuture<Self::Response, Self::Error>;
        fn poll_ready(
            &mut self,
            _cx: &mut Context<'_>,
        ) -> Poll<std::result::Result<(), Self::Error>> {
            Poll::Ready(Ok(()))
        }
        fn call(&mut self, req: http::Request<B>) -> Self::Future {
            match req.uri().path() {
                "/orders.v1.OrdersService/OrderCreate" => {
                    #[allow(non_camel_case_types)]
                    struct OrderCreateSvc<T: OrdersService>(pub Arc<T>);
                    impl<
                        T: OrdersService,
                    > tonic::server::UnaryService<super::OrderCreateRequest>
                    for OrderCreateSvc<T> {
                        type Response = super::OrderCreateResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::OrderCreateRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as OrdersService>::order_create(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = OrderCreateSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/orders.v1.OrdersService/OrderGet" => {
                    #[allow(non_camel_case_types)]
                    struct OrderGetSvc<T: OrdersService>(pub Arc<T>);
                    impl<
                        T: OrdersService,
                    > tonic::server::UnaryService<super::OrderGetRequest>
                    for OrderGetSvc<T> {
                        type Response = super::OrderGetResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::OrderGetRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as OrdersService>::order_get(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = OrderGetSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/orders.v1.OrdersService/OrdersList" => {
                    #[allow(non_camel_case_types)]
                    struct OrdersListSvc<T: OrdersService>(pub Arc<T>);
                    impl<
                        T: OrdersService,
                    > tonic::server::UnaryService<super::OrdersListRequest>
                    for OrdersListSvc<T> {
                        type Response = super::OrdersListResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::OrdersListRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as OrdersService>::orders_list(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = OrdersListSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/orders.v1.OrdersService/OrderCancel" => {
                    #[allow(non_camel_case_types)]
                    struct OrderCancelSvc<T: OrdersService>(pub Arc<T>);
                    impl<
                        T: OrdersService,
                    > tonic::server::UnaryService<super::OrderCancelRequest>
                    for OrderCancelSvc<T> {
                        type Response = super::OrderCancelResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::OrderCancelRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as OrdersService>::order_cancel(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = OrderCancelSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                "/orders.v1.OrdersService/OrderRefund" => {
                    #[allow(non_camel_case_types)]
                    struct OrderRefundSvc<T: OrdersService>(pub Arc<T>);
                    impl<
                        T: OrdersService,
                    > tonic::server::UnaryService<super::OrderRefundRequest>
                    for OrderRefundSvc<T> {
                        type Response = super::OrderRefundResponse;
                        type Future = BoxFuture<
                            tonic::Response<Self::Response>,
                            tonic::Status,
                        >;
                        fn call(
                            &mut self,
                            request: tonic::Request<super::OrderRefundRequest>,
                        ) -> Self::Future {
                            let inner = Arc::clone(&self.0);
                            let fut = async move {
                                <T as OrdersService>::order_refund(&inner, request).await
                            };
                            Box::pin(fut)
                        }
                    }
                    let accept_compression_encodings = self.accept_compression_encodings;
                    let send_compression_encodings = self.send_compression_encodings;
                    let max_decoding_message_size = self.max_decoding_message_size;
                    let max_encoding_message_size = self.max_encoding_message_size;
                    let inner = self.inner.clone();
                    let fut = async move {
                        let method = OrderRefundSvc(inner);
                        let codec = tonic::codec::ProstCodec::default();
                        let mut grpc = tonic::server::Grpc::new(codec)
                            .apply_compression_config(
                                accept_compression_encodings,
                                send_compression_encodings,
                            )
                            .apply_max_message_size_config(
                                max_decoding_message_size,
                                max_encoding_message_size,
                            );
                        let res = grpc.unary(method, req).await;
                        Ok(res)
                    };
                    Box::pin(fut)
                }
                _ => {
                    Box::pin(async move {
                        let mut response = http::Response::new(
                            tonic::body::Body::default(),
                        );
                        let headers = response.headers_mut();
                        headers
                            .insert(
                                tonic::Status::GRPC_STATUS,
                                (tonic::Code::Unimplemented as i32).into(),
                            );
                        headers
                            .insert(
                                http::header::CONTENT_TYPE,
                                tonic::metadata::GRPC_CONTENT_TYPE,
                            );
                        Ok(response)
                    })
                }
            }
        }
    }
    impl<T> Clone for OrdersServiceServer<T> {
        fn clone(&self) -> Self {
            let inner = self.inner.clone();
            Self {
                inner,
                accept_compression_encodings: self.accept_compression_encodings,
                send_compression_encodings: self.send_compression_encodings,
                max_decoding_message_size: self.max_decoding_message_size,
                max_encoding_message_size: self.max_encoding_message_size,
            }
        }
    }
    /// Generated gRPC service name
    pub const SERVICE_NAME: &str = "orders.v1.OrdersService";
    impl<T> tonic::server::NamedService for OrdersServiceServer<T> {
        const NAME: &'static str = SERVICE_NAME;
    }
}
