Class: C2eCore::Drops::OrderDrop
- Defined in:
- /build/app/mailers/c2e_core/drops/order_drop.rb
Instance Method Summary collapse
-
#accepted_at ⇒ DateTime
-
Datetime object containing value when order was submitted by customer.
-
-
#admin_customer_detail_url ⇒ String
-
URL redirecting to current customer detail in staff admin application.
-
-
#admin_order_detail_url ⇒ String
-
URL redirecting to order detail in staff admin application.
-
-
#canceled? ⇒ Boolean
-
Returns true if the order is canceled, and false otherwise.
-
-
#cash_box ⇒ CashBoxDrop
-
Returns orders cash box as drop object if it is present.
-
-
#company_branch ⇒ CompanyBranchDrop
-
Company branch to which order belongs as drop object.
-
-
#credits_reward ⇒ CreditsRewardDrop?
-
The credits reward as a drop object, if it is present.
-
-
#credits_wallets ⇒ Array[CreditsWalletDrop]
-
An array of credit wallets as drop objects.
-
-
#currency ⇒ CurrencyDrop
-
Orders currency object.
-
-
#customer ⇒ CustomerDrop
-
Customer as drop object.
-
-
#customer_track_url ⇒ String
-
URL redirecting to a finish screen of a customer-facing application.
-
-
#data_from_terminal ⇒ String?
-
Returns the data we received from the terminal after a successful transaction, if present.
-
-
#delayed_delivery_time ⇒ DateTime
-
Returns time which customer specifically chosen.
-
-
#deliver_at ⇒ Time
-
Returns current time of expected delivery.
-
-
#deliver_at_minutes ⇒ Integer
-
Returns number of minutes remaining to current
deliver_attime.
-
-
#delivered_at ⇒ Time?
-
Returns current time of delivery.
-
-
#delivery_today? ⇒ Boolean
-
Returns true when deliver_at time is today.
-
-
#delivery_type_enum ⇒ String
-
DeliveryType.enum value.
-
-
#flat_items ⇒ Array[OrderRecipeFlatDrop]
-
Returns a flat array of main order recipes as drop objects.
-
-
#flat_ware_category_items ⇒ Array[OrderWareCategoryFlatDrop]
-
Returns a flat array of orders ware categories as drop objects ordered by recipes where this ware category was first.
-
-
#has_delivery? ⇒ Boolean
-
Returns true when order is supposed to be delivered by messenger.
-
-
#id ⇒ Integer
-
ID of order.
-
-
#initialize(order) ⇒ OrderDrop
constructor
A new instance of OrderDrop.
-
#invoice_promos ⇒ Array<InvoicePromoDrop>
-
An array of invoice promos as drop objects.
-
-
#main_items ⇒ Array[OrderRecipeDrop]
-
Returns an array of main orders’ recipes with name and price as drop objects.
-
-
#note ⇒ String
-
text of first info note.
-
-
#online? ⇒ Boolean
-
Returns true when order was paid by card in online gate.
-
-
#online_payment_id ⇒ Integer
-
Returns id from customer_json gopay hash.
-
-
#order_origin ⇒ OrderOriginDrop
-
Returns order origin as drop object with name.
-
-
#order_payment_methods ⇒ Array[OrderPaymentMethodDrop]
-
An array of order payment methods as drop objects.
-
-
#payment_method_enums ⇒ Array
-
An array containing the concatenation of PaymentType.enum and PaymentGate.enum values for all orders’ payment methods.
-
-
#payment_method_enums_without_wallet_credit ⇒ Array
-
An array containing the concatenation of PaymentType.enum and PaymentGate.enum values for all orders’ payment methods, excluding credit payments.
-
-
#price ⇒ OrderPriceDrop
-
Returns orders price as drop object.
-
-
#purchased_credits_wallet ⇒ CreditsWalletDrop?
-
A credit wallet that was purchased with the order as a drop object or nil.
-
-
#qr_with_id ⇒ String
-
QR code including
Order#idas data-URL.
-
-
#ratings ⇒ Array[OrderRatingDrop]
-
Returns an array of order rating notes as drop objects with quality evaluation from customer and text message e.g.:
"Dobra, ale těsto bylo trochu tuhé.".
-
-
#require_age_control? ⇒ Boolean
-
Returns true when order contains a recipe that requires age control, and false otherwise.
-
-
#resettable_id ⇒ Integer
-
Resettable ID of order.
-
-
#simplified_payment_method ⇒ String
deprecated
Deprecated.
This method is deprecated and will be removed in future versions. Use #payment_method_enums instead. Reason: This method may return incorrect values for orders paid using multiple payment methods.
-
#time_deliver_at ⇒ DateTime
-
Returns current date and time of expected delivery.
-
-
#user ⇒ UserDrop
-
Returns user who created order as drop object.
-
Constructor Details
#initialize(order) ⇒ OrderDrop
Returns a new instance of OrderDrop.
Instance Method Details
#accepted_at ⇒ DateTime
Returns - Datetime object containing value when order was submitted by customer. E.g.: "2020-11-16T11:38:56+01:00".
#admin_customer_detail_url ⇒ String
Returns - URL redirecting to current customer detail in staff admin application.
#admin_order_detail_url ⇒ String
Returns - URL redirecting to order detail in staff admin application.
#canceled? ⇒ Boolean
Returns - Returns true if the order is canceled, and false otherwise.
#cash_box ⇒ CashBoxDrop
Returns - Returns orders cash box as drop object if it is present.
#company_branch ⇒ CompanyBranchDrop
Returns - Company branch to which order belongs as drop object.
#credits_reward ⇒ CreditsRewardDrop?
Returns - The credits reward as a drop object, if it is present. Otherwise, null.
#credits_wallets ⇒ Array[CreditsWalletDrop]
Returns - An array of credit wallets as drop objects.
#currency ⇒ CurrencyDrop
Returns - Orders currency object. By default it is taken from company branch.
#customer ⇒ CustomerDrop
Returns - Customer as drop object.
#customer_track_url ⇒ String
Returns - URL redirecting to a finish screen of a customer-facing application. E.g.: https://speedlo.cz/cs/app/brand/branch/w/?order-tracking?orderId=[Integer]&userToken=[String].
#data_from_terminal ⇒ String?
Returns - Returns the data we received from the terminal after a successful transaction, if present.
#delayed_delivery_time ⇒ DateTime
Returns - Returns time which customer specifically chosen. Can differ from #deliver_at and always has same value.
#deliver_at ⇒ Time
Returns - Returns current time of expected delivery. Can be changed by staff. E.g.: 2022-10-31 15:56:02 +0100.
#deliver_at_minutes ⇒ Integer
Returns - Returns number of minutes remaining to current deliver_at time. Result is rounded to multiples of 5.
#delivered_at ⇒ Time?
Returns - Returns current time of delivery. Can be changed by staff. E.g.: 2022-10-31 15:56:02 +0100.
#delivery_today? ⇒ Boolean
Returns - Returns true when deliver_at time is today.
#delivery_type_enum ⇒ String
Returns - DeliveryType.enum value. E.g.: MESSENGER, PICKUP. Returns nil for inhouse order.
#flat_items ⇒ Array[OrderRecipeFlatDrop]
Returns - Returns a flat array of main order recipes as drop objects. Doesn’t group the same recipes with side dishes.
#flat_ware_category_items ⇒ Array[OrderWareCategoryFlatDrop]
Returns - Returns a flat array of orders ware categories as drop objects ordered by recipes where this ware category was first.
#has_delivery? ⇒ Boolean
Returns - Returns true when order is supposed to be delivered by messenger.
#id ⇒ Integer
Returns - ID of order.
#invoice_promos ⇒ Array<InvoicePromoDrop>
Returns - An array of invoice promos as drop objects.
#main_items ⇒ Array[OrderRecipeDrop]
Returns - Returns an array of main orders’ recipes with name and price as drop objects.
#note ⇒ String
Returns - text of first info note. E.g.: "Pozor pes, počkat venku!".
#online? ⇒ Boolean
Returns - Returns true when order was paid by card in online gate.
#online_payment_id ⇒ Integer
Returns - Returns id from customer_json gopay hash.
#order_origin ⇒ OrderOriginDrop
Returns - Returns order origin as drop object with name. E.g.: "Web", "Staff", "foodora"..
#order_payment_methods ⇒ Array[OrderPaymentMethodDrop]
Returns - An array of order payment methods as drop objects.
#payment_method_enums ⇒ Array
Returns - An array containing the concatenation of PaymentType.enum and PaymentGate.enum values for all orders’ payment methods. E.g.: ["CREDIT_CSOB", "WALLET_CREDIT_WALLET_CREDIT"].
#payment_method_enums_without_wallet_credit ⇒ Array
Returns - An array containing the concatenation of PaymentType.enum and PaymentGate.enum values for all orders’ payment methods, excluding credit payments. If an order is fully paid using credits, an empty array is returned. E.g.: ["CREDIT_CSOB", "CASH_CASH"].
#price ⇒ OrderPriceDrop
Returns - Returns orders price as drop object.
#purchased_credits_wallet ⇒ CreditsWalletDrop?
Returns - A credit wallet that was purchased with the order as a drop object or nil.
#qr_with_id ⇒ String
Returns - QR code including Order#id as data-URL. E.g.: "data:image/png;base64,iVBO.....". Current width of image is 400px.
#ratings ⇒ Array[OrderRatingDrop]
Returns - Returns an array of order rating notes as drop objects with quality evaluation from customer and text message e.g.: "Dobra, ale těsto bylo trochu tuhé.".
#require_age_control? ⇒ Boolean
Returns - Returns true when order contains a recipe that requires age control, and false otherwise.
#resettable_id ⇒ Integer
Returns - Resettable ID of order. E.g.: 142.
#simplified_payment_method ⇒ String
This method is deprecated and will be removed in future versions. Use #payment_method_enums instead. Reason: This method may return incorrect values for orders paid using multiple payment methods.
Returns - Cotains concatenation of PaymentType.enum and PaymentGate.enum E.g.: CREDIT_CREDIT, CREDIT_CSOB, CASH_CASH, etc.
#time_deliver_at ⇒ DateTime
Returns - Returns current date and time of expected delivery. Can be changed by staff. E.g.: 14:51.
#user ⇒ UserDrop
Returns - Returns user who created order as drop object.