Module: Spree::V2::Storefront::LineItemSerializerDecorator

Defined in:
app/serializers/spree/v2/storefront/line_item_serializer_decorator.rb

Class Method Summary collapse

Class Method Details

.prepended(base) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/serializers/spree/v2/storefront/line_item_serializer_decorator.rb', line 5

def self.prepended(base)
  base.attributes :from_date, :to_date, :need_confirmation, :product_type, :event_status, :amount, :display_amount,
                  :checkin_date, :checkout_date,
                  :number, :qr_data,
                  :kyc, :kyc_fields, :remaining_total_guests, :number_of_guests,
                  :completion_steps, :available_social_contact_platforms, :allow_anonymous_booking, :discontinue_on,
                  :high_demand, :jwt_token,
                  :direction, :trip_id, :boarding_trip_stop_id, :drop_off_trip_stop_id

  base.attribute :required_self_check_in_location, &:required_self_check_in_location?
  base.attribute :allowed_self_check_in, &:allowed_self_check_in?
  base.attribute :allowed_upload_later, &:allowed_upload_later?
  base.attribute :delivery_required, &:delivery_required?
  base.attribute :sufficient_stock, &:sufficient_stock?

  base.has_one :vendor

  base.belongs_to :order, serializer: Spree::V2::Storefront::OrderSerializer

  base.has_one :google_wallet, serializer: SpreeCmCommissioner::V2::Storefront::GoogleWalletSerializer

  base.has_many :guests, serializer: SpreeCmCommissioner::V2::Storefront::GuestSerializer

  base.has_many :pending_guests, serializer: SpreeCmCommissioner::V2::Storefront::GuestSerializer

  base.has_one :product, serializer: Spree::V2::Storefront::ProductSerializer

  # completion_steps updates frequently
  base.cache_options store: nil
end