Class: SpreeUberDirect::QuoteMapping
- Inherits:
-
Object
- Object
- SpreeUberDirect::QuoteMapping
- Defined in:
- app/models/spree_uber_direct/quote_mapping.rb
Overview
Tracks the most recent Uber Direct quote requested for an order, generated as checkout progresses (see Spree::Calculator::Shipping:: UberDirectQuote, M3) and consulted again at order.completed to decide whether to accept it as-is or re-quote (see DeliveryDispatcher, M4) — same role as SpreeDoordash::QuoteMapping, checkout can easily outlast a quote's validity window.
Unlike DoorDash's 5-minute rule (undocumented on the response itself,
just DoorDash's own stated policy), expired? here checks Uber's own
returned quote_expires_at — always accurate to what Uber will
actually honor, never a guessed/hardcoded window.
Instance Method Summary collapse
Instance Method Details
#expired? ⇒ Boolean
21 22 23 |
# File 'app/models/spree_uber_direct/quote_mapping.rb', line 21 def expired? quote_expires_at.blank? || quote_expires_at <= Time.current end |