Sha256: 349be650ff7e1aafc54ad6aba0059905ae4b150efee55d582acfc7cfacf8b84e

Contents?: true

Size: 666 Bytes

Versions: 4

Compression:

Stored size: 666 Bytes

Contents

module Workarea
  module Storefront
    class LegacyOrderViewModel < ApplicationViewModel
      def fulfillment_status
        status
      end

      def requires_shipping?
        shipping_address.present?
      end

      def items
        @items ||= LegacyOrderItemViewModel.wrap(model.items)
      end

      def pending_items
        items.select { |i| i.status == 'pending' }
      end

      def shipped_items
        items.select { |i| i.status == 'shipped' }
      end

      def canceled_items
        items.select { |i| i.status == 'canceled' }
      end

      def packages
        []
      end

      def refunds
        []
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
workarea-legacy_orders-2.0.3 app/view_models/workarea/storefront/legacy_order_view_model.rb
workarea-legacy_orders-2.0.2 app/view_models/workarea/storefront/legacy_order_view_model.rb
workarea-legacy_orders-2.0.1 app/view_models/workarea/storefront/legacy_order_view_model.rb
workarea-legacy_orders-2.0.0 app/view_models/workarea/storefront/legacy_order_view_model.rb