Skip to content

Commit

Permalink
close #2116 add promotion related field to serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
theachoem committed Dec 6, 2024
1 parent b011684 commit fd28e18
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<%= f.field_container :auto_apply, class: ['checkbox'] do %>
<%= f.label :auto_apply do %>
<%= f.check_box :auto_apply %>
<%= f.check_box :auto_apply, checked: f.object.code.nil? && f.object.path.nil? %>
<%= Spree.t(:auto_apply) %>
<small class="form-text text-muted">
<%= raw Spree.t('auto_apply_info') %>
</small>
<% end %>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ def self.prepended(base)

base.has_one :default_state, serializer: :state
base.has_one :venue, serializer: ::SpreeCmCommissioner::V2::Storefront::ProductPlaceSerializer
base.attributes :need_confirmation, :product_type, :kyc, :allowed_upload_later, :allow_anonymous_booking, :use_video_as_default

base.attributes :need_confirmation, :product_type, :kyc, :kyc_fields, :allowed_upload_later, :allow_anonymous_booking, :use_video_as_default
base.attributes :reveal_description, :discontinue_on, :public_metadata, :purchasable_on

base.attribute :purchasable_on_app do |product|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module SpreeCmCommissioner
module V2
module Storefront
class PromotionSerializer < BaseSerializer
attributes :name, :description, :match_policy, :advertise
attributes :name, :description, :match_policy, :advertise, :expires_at

has_many :promotion_rules
has_many :promotion_actions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
:display_compare_at_price,
:need_confirmation,
:kyc,
:kyc_fields,
:product_type,
:reveal_description,
:allowed_upload_later,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
:name,
:description,
:match_policy,
:advertise
:advertise,
:expires_at,
)
end

Expand Down

0 comments on commit fd28e18

Please sign in to comment.