solidus_legacy_promotions 4.4.1 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/spree/promotion_code_batch.rb +9 -0
- data/app/{decorators/solidus_legacy_promotions/controllers/solidus_admin/solidus_admin_adjustments_controller_decorator.rb → patches/controllers/solidus_legacy_promotions/solidus_admin_adjustments_controller_patch.rb} +1 -1
- data/app/{decorators/solidus_legacy_promotions/lib/spree_order_state_machine_decorator.rb → patches/lib/solidus_legacy_promotions/spree_order_state_machine_patch.rb} +1 -1
- data/app/{decorators/solidus_legacy_promotions/models/spree_adjustment_decorator.rb → patches/models/solidus_legacy_promotions/spree_adjustment_patch.rb} +1 -1
- data/app/{decorators/solidus_legacy_promotions/models/spree_calculator_returns_default_refund_amount_decorator.rb → patches/models/solidus_legacy_promotions/spree_calculator_returns_default_refund_amount_patch.rb} +1 -1
- data/app/{decorators/solidus_legacy_promotions/models/spree_line_item_decorator.rb → patches/models/solidus_legacy_promotions/spree_line_item_patch.rb} +1 -1
- data/app/{decorators/solidus_legacy_promotions/models/spree_order_decorator.rb → patches/models/solidus_legacy_promotions/spree_order_patch.rb} +1 -1
- data/app/{decorators/solidus_legacy_promotions/models/spree_order_updater_decorator.rb → patches/models/solidus_legacy_promotions/spree_order_updater_patch.rb} +8 -2
- data/app/{decorators/solidus_legacy_promotions/models/spree_product_decorator.rb → patches/models/solidus_legacy_promotions/spree_product_patch.rb} +1 -1
- data/app/{decorators/solidus_legacy_promotions/models/spree_shipment_decorator.rb → patches/models/solidus_legacy_promotions/spree_shipment_patch.rb} +1 -1
- data/config/locales/promotion_categories.en.yml +5 -1
- data/config/routes.rb +1 -1
- data/lib/components/admin/solidus_admin/promotion_categories/edit/component.html.erb +16 -0
- data/lib/components/admin/solidus_admin/promotion_categories/edit/component.rb +4 -0
- data/lib/components/admin/solidus_admin/promotion_categories/edit/component.yml +4 -0
- data/lib/components/admin/solidus_admin/promotion_categories/index/component.rb +21 -8
- data/lib/components/admin/solidus_admin/promotion_categories/new/component.html.erb +16 -0
- data/lib/components/admin/solidus_admin/promotion_categories/new/component.rb +4 -0
- data/lib/components/admin/solidus_admin/promotion_categories/new/component.yml +4 -0
- data/lib/controllers/admin/solidus_admin/promotion_categories_controller.rb +6 -20
- data/lib/solidus_legacy_promotions/engine.rb +11 -4
- data/solidus_legacy_promotions.gemspec +2 -1
- metadata +44 -22
- data/app/decorators/solidus_legacy_promotions/models/spree_promotion_code_batch_decorator.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a55daf802efdf77185de8109a5214de29a6a0eecabb6630a7fbe9cd86deb526
|
4
|
+
data.tar.gz: 84674636a0a129b192d70ebabf17be810c0dc36790a7ed03f0edccc4a6521dee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e68e598172fd94f4eedc72b1d35b325fa3d248ca209d70ddda8b9c235cc4c000a08fe5b1418b0e2dbde9b20c9a7319f10b2117003aca4a99a55db5934f30366d
|
7
|
+
data.tar.gz: 363c73e69b24eb4790233c0454b2649f85dba023e97310c42e8b2b6372834625b2ec41d179ea59cfdc2e0afb66deb79344bb2c667a5581c61817d209aa050bcb
|
@@ -14,5 +14,14 @@ module Spree
|
|
14
14
|
def finished?
|
15
15
|
state == "completed"
|
16
16
|
end
|
17
|
+
|
18
|
+
def process
|
19
|
+
if state == "pending"
|
20
|
+
update!(state: "processing")
|
21
|
+
PromotionCodeBatchJob.perform_later(self)
|
22
|
+
else
|
23
|
+
raise CantProcessStartedBatch.new("Batch #{id} already started")
|
24
|
+
end
|
25
|
+
end
|
17
26
|
end
|
18
27
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module SolidusLegacyPromotions
|
4
|
-
module
|
4
|
+
module SpreeAdjustmentPatch
|
5
5
|
def self.prepended(base)
|
6
6
|
base.belongs_to :promotion_code, class_name: 'Spree::PromotionCode', optional: true
|
7
7
|
base.validates :promotion_code, presence: true, if: :require_promotion_code?
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module SolidusLegacyPromotions
|
4
|
-
module
|
4
|
+
module SpreeOrderUpdaterPatch
|
5
5
|
def update_adjustment_total
|
6
6
|
recalculate_adjustments
|
7
7
|
|
@@ -17,8 +17,14 @@ module SolidusLegacyPromotions
|
|
17
17
|
|
18
18
|
def update_item_totals
|
19
19
|
[*line_items, *shipments].each do |item|
|
20
|
+
Spree::ItemTotal.new(item).recalculate!
|
21
|
+
|
20
22
|
# The cancellation_total isn't persisted anywhere but is included in
|
21
|
-
# the adjustment_total
|
23
|
+
# the adjustment_total.
|
24
|
+
#
|
25
|
+
# Core doesn't have "eligible" adjustments anymore, so we need to
|
26
|
+
# override the adjustment_total calculation to exclude them for legacy
|
27
|
+
# promotions.
|
22
28
|
item.adjustment_total = item.adjustments.
|
23
29
|
select(&:eligible?).
|
24
30
|
reject(&:included?).
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module SolidusLegacyPromotions
|
4
|
-
module
|
4
|
+
module SpreeProductPatch
|
5
5
|
def self.prepended(base)
|
6
6
|
base.has_many :product_promotion_rules, dependent: :destroy
|
7
7
|
base.has_many :promotion_rules, through: :product_promotion_rules
|
@@ -2,5 +2,9 @@ en:
|
|
2
2
|
solidus_admin:
|
3
3
|
promotion_categories:
|
4
4
|
title: "Promotion Categories"
|
5
|
+
create:
|
6
|
+
success: "Promotion category was successfully created."
|
7
|
+
update:
|
8
|
+
success: "Promotion category was successfully updated."
|
5
9
|
destroy:
|
6
|
-
success: "Promotion
|
10
|
+
success: "Promotion categories were successfully removed."
|
data/config/routes.rb
CHANGED
@@ -23,6 +23,6 @@ if SolidusSupport.admin_available?
|
|
23
23
|
extend SolidusAdmin::AdminResources
|
24
24
|
|
25
25
|
admin_resources :promotions, only: [:index, :destroy]
|
26
|
-
admin_resources :promotion_categories,
|
26
|
+
admin_resources :promotion_categories, except: [:show]
|
27
27
|
end
|
28
28
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%= turbo_frame_tag :resource_modal, target: "_top" do %>
|
2
|
+
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
|
3
|
+
<%= form_for @promotion_category, url: form_url, html: { id: form_id } do |f| %>
|
4
|
+
<div class="flex flex-col gap-6 pb-4">
|
5
|
+
<%= render component("ui/forms/field").text_field(f, :name, class: "required") %>
|
6
|
+
<%= render component("ui/forms/field").text_field(f, :code, class: "required") %>
|
7
|
+
</div>
|
8
|
+
<% modal.with_actions do %>
|
9
|
+
<form method="dialog">
|
10
|
+
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
|
11
|
+
</form>
|
12
|
+
<%= render component("ui/button").new(form: form_id, type: :submit, text: t('.submit')) %>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
@@ -5,15 +5,24 @@ class SolidusAdmin::PromotionCategories::Index::Component < SolidusAdmin::UI::Pa
|
|
5
5
|
Spree::PromotionCategory
|
6
6
|
end
|
7
7
|
|
8
|
-
def
|
9
|
-
|
8
|
+
def title
|
9
|
+
t('solidus_admin.promotion_categories.title')
|
10
|
+
end
|
11
|
+
|
12
|
+
def edit_path(record)
|
13
|
+
solidus_admin.edit_promotion_category_path(record, **search_filter_params)
|
14
|
+
end
|
15
|
+
|
16
|
+
def turbo_frames
|
17
|
+
%w[resource_modal]
|
10
18
|
end
|
11
19
|
|
12
20
|
def page_actions
|
13
21
|
render component("ui/button").new(
|
14
22
|
tag: :a,
|
15
23
|
text: t('.add'),
|
16
|
-
href:
|
24
|
+
href: solidus_admin.new_promotion_category_path(**search_filter_params),
|
25
|
+
data: { turbo_frame: :resource_modal },
|
17
26
|
icon: "add-line",
|
18
27
|
)
|
19
28
|
end
|
@@ -22,7 +31,7 @@ class SolidusAdmin::PromotionCategories::Index::Component < SolidusAdmin::UI::Pa
|
|
22
31
|
[
|
23
32
|
{
|
24
33
|
label: t('.batch_actions.delete'),
|
25
|
-
action: solidus_admin.promotion_categories_path,
|
34
|
+
action: solidus_admin.promotion_categories_path(**search_filter_params),
|
26
35
|
method: :delete,
|
27
36
|
icon: 'delete-bin-7-line',
|
28
37
|
},
|
@@ -39,8 +48,10 @@ class SolidusAdmin::PromotionCategories::Index::Component < SolidusAdmin::UI::Pa
|
|
39
48
|
def name_column
|
40
49
|
{
|
41
50
|
header: :name,
|
42
|
-
data: ->(
|
43
|
-
|
51
|
+
data: ->(record) do
|
52
|
+
link_to record.name, edit_path(record),
|
53
|
+
data: { turbo_frame: :resource_modal },
|
54
|
+
class: 'body-link'
|
44
55
|
end
|
45
56
|
}
|
46
57
|
end
|
@@ -48,8 +59,10 @@ class SolidusAdmin::PromotionCategories::Index::Component < SolidusAdmin::UI::Pa
|
|
48
59
|
def code_column
|
49
60
|
{
|
50
61
|
header: :code,
|
51
|
-
data: ->(
|
52
|
-
|
62
|
+
data: ->(record) do
|
63
|
+
link_to record.code, edit_path(record),
|
64
|
+
data: { turbo_frame: :resource_modal },
|
65
|
+
class: 'body-link'
|
53
66
|
end
|
54
67
|
}
|
55
68
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<%= turbo_frame_tag :resource_modal, target: "_top" do %>
|
2
|
+
<%= render component("ui/modal").new(title: t(".title")) do |modal| %>
|
3
|
+
<%= form_for @promotion_category, url: form_url, html: { id: form_id } do |f| %>
|
4
|
+
<div class="flex flex-col gap-6 pb-4">
|
5
|
+
<%= render component("ui/forms/field").text_field(f, :name, class: "required") %>
|
6
|
+
<%= render component("ui/forms/field").text_field(f, :code, class: "required") %>
|
7
|
+
</div>
|
8
|
+
<% modal.with_actions do %>
|
9
|
+
<form method="dialog">
|
10
|
+
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %>
|
11
|
+
</form>
|
12
|
+
<%= render component("ui/button").new(form: form_id, type: :submit, text: t('.submit')) %>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
@@ -1,29 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module SolidusAdmin
|
4
|
-
class PromotionCategoriesController < SolidusAdmin::
|
5
|
-
|
4
|
+
class PromotionCategoriesController < SolidusAdmin::ResourcesController
|
5
|
+
private
|
6
6
|
|
7
|
-
def
|
8
|
-
promotion_categories = apply_search_to(
|
9
|
-
Spree::PromotionCategory.all,
|
10
|
-
param: :q,
|
11
|
-
)
|
7
|
+
def resource_class = Spree::PromotionCategory
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
respond_to do |format|
|
16
|
-
format.html { render component('promotion_categories/index').new(page: @page) }
|
17
|
-
end
|
9
|
+
def permitted_resource_params
|
10
|
+
params.require(:promotion_category).permit(:name, :code)
|
18
11
|
end
|
19
12
|
|
20
|
-
def
|
21
|
-
@promotion_categories = Spree::PromotionCategory.where(id: params[:id])
|
22
|
-
|
23
|
-
Spree::PromotionCategory.transaction { @promotion_categories.destroy_all }
|
24
|
-
|
25
|
-
flash[:notice] = t('.success')
|
26
|
-
redirect_back_or_to promotion_categories_path, status: :see_other
|
27
|
-
end
|
13
|
+
def resources_collection = Spree::PromotionCategory.unscoped
|
28
14
|
end
|
29
15
|
end
|
@@ -1,11 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'solidus_legacy_promotions'
|
4
|
-
|
4
|
+
require 'flickwerk'
|
5
5
|
module SolidusLegacyPromotions
|
6
6
|
class Engine < ::Rails::Engine
|
7
7
|
include SolidusSupport::EngineExtensions
|
8
8
|
|
9
|
+
include Flickwerk
|
10
|
+
|
9
11
|
initializer "solidus_legacy_promotions.add_backend_menu_item" do
|
10
12
|
if SolidusSupport.backend_available?
|
11
13
|
promotions_menu_item = Spree::BackendConfiguration::MenuItem.new(
|
@@ -100,12 +102,17 @@ module SolidusLegacyPromotions
|
|
100
102
|
end
|
101
103
|
|
102
104
|
initializer "solidus_legacy_promotions", after: "spree.load_config_initializers" do
|
103
|
-
|
104
|
-
|
105
|
-
|
105
|
+
# Only set these if there is no promotion configuration set. In this case,
|
106
|
+
# we're running on a store without the new `solidus_promotions` gem and we
|
107
|
+
# need to set the configuration to the legacy one.
|
108
|
+
if Spree::Config.promotions.is_a?(Spree::Core::NullPromotionConfiguration)
|
109
|
+
Spree::Config.order_contents_class = "Spree::OrderContents"
|
110
|
+
Spree::Config.promotions = SolidusLegacyPromotions::Configuration.new
|
111
|
+
end
|
106
112
|
|
107
113
|
Spree::Api::Config.adjustment_attributes << :promotion_code_id
|
108
114
|
Spree::Api::Config.adjustment_attributes << :eligible
|
115
|
+
Spree::Config.adjustment_promotion_source_types << "Spree::PromotionAction"
|
109
116
|
end
|
110
117
|
end
|
111
118
|
end
|
@@ -23,7 +23,8 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.required_ruby_version = '>= 3.1.0'
|
24
24
|
s.required_rubygems_version = '>= 1.8.23'
|
25
25
|
|
26
|
+
s.add_dependency 'csv', '~> 3.0'
|
26
27
|
s.add_dependency 'solidus_api', s.version
|
27
28
|
s.add_dependency 'solidus_core', s.version
|
28
|
-
s.add_dependency 'solidus_support'
|
29
|
+
s.add_dependency 'solidus_support', '>= 0.13.1', '< 1'
|
29
30
|
end
|
metadata
CHANGED
@@ -1,57 +1,76 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_legacy_promotions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-20 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
12
|
+
- !ruby/object:Gem::Dependency
|
13
|
+
name: csv
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
15
|
+
requirements:
|
16
|
+
- - "~>"
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '3.0'
|
19
|
+
type: :runtime
|
20
|
+
prerelease: false
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - "~>"
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: '3.0'
|
13
26
|
- !ruby/object:Gem::Dependency
|
14
27
|
name: solidus_api
|
15
28
|
requirement: !ruby/object:Gem::Requirement
|
16
29
|
requirements:
|
17
30
|
- - '='
|
18
31
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.
|
32
|
+
version: 4.5.0
|
20
33
|
type: :runtime
|
21
34
|
prerelease: false
|
22
35
|
version_requirements: !ruby/object:Gem::Requirement
|
23
36
|
requirements:
|
24
37
|
- - '='
|
25
38
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.
|
39
|
+
version: 4.5.0
|
27
40
|
- !ruby/object:Gem::Dependency
|
28
41
|
name: solidus_core
|
29
42
|
requirement: !ruby/object:Gem::Requirement
|
30
43
|
requirements:
|
31
44
|
- - '='
|
32
45
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.
|
46
|
+
version: 4.5.0
|
34
47
|
type: :runtime
|
35
48
|
prerelease: false
|
36
49
|
version_requirements: !ruby/object:Gem::Requirement
|
37
50
|
requirements:
|
38
51
|
- - '='
|
39
52
|
- !ruby/object:Gem::Version
|
40
|
-
version: 4.
|
53
|
+
version: 4.5.0
|
41
54
|
- !ruby/object:Gem::Dependency
|
42
55
|
name: solidus_support
|
43
56
|
requirement: !ruby/object:Gem::Requirement
|
44
57
|
requirements:
|
45
58
|
- - ">="
|
46
59
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
60
|
+
version: 0.13.1
|
61
|
+
- - "<"
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '1'
|
48
64
|
type: :runtime
|
49
65
|
prerelease: false
|
50
66
|
version_requirements: !ruby/object:Gem::Requirement
|
51
67
|
requirements:
|
52
68
|
- - ">="
|
53
69
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
70
|
+
version: 0.13.1
|
71
|
+
- - "<"
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '1'
|
55
74
|
description: Legacy Solidus promotion system
|
56
75
|
email: contact@solidus.io
|
57
76
|
executables: []
|
@@ -74,16 +93,6 @@ files:
|
|
74
93
|
- app/assets/stylesheets/solidus_legacy_promotions/promotions.scss
|
75
94
|
- app/assets/stylesheets/solidus_legacy_promotions/promotions/_edit.scss
|
76
95
|
- app/assets/stylesheets/spree/backend/sections/_adjustments.scss
|
77
|
-
- app/decorators/solidus_legacy_promotions/controllers/solidus_admin/solidus_admin_adjustments_controller_decorator.rb
|
78
|
-
- app/decorators/solidus_legacy_promotions/lib/spree_order_state_machine_decorator.rb
|
79
|
-
- app/decorators/solidus_legacy_promotions/models/spree_adjustment_decorator.rb
|
80
|
-
- app/decorators/solidus_legacy_promotions/models/spree_calculator_returns_default_refund_amount_decorator.rb
|
81
|
-
- app/decorators/solidus_legacy_promotions/models/spree_line_item_decorator.rb
|
82
|
-
- app/decorators/solidus_legacy_promotions/models/spree_order_decorator.rb
|
83
|
-
- app/decorators/solidus_legacy_promotions/models/spree_order_updater_decorator.rb
|
84
|
-
- app/decorators/solidus_legacy_promotions/models/spree_product_decorator.rb
|
85
|
-
- app/decorators/solidus_legacy_promotions/models/spree_promotion_code_batch_decorator.rb
|
86
|
-
- app/decorators/solidus_legacy_promotions/models/spree_shipment_decorator.rb
|
87
96
|
- app/helpers/spree/admin/promotions_helper.rb
|
88
97
|
- app/helpers/spree/promotion_rules_helper.rb
|
89
98
|
- app/jobs/spree/promotion_code_batch_job.rb
|
@@ -134,6 +143,15 @@ files:
|
|
134
143
|
- app/models/spree/promotion_rule_store.rb
|
135
144
|
- app/models/spree/promotion_rule_taxon.rb
|
136
145
|
- app/models/spree/promotion_rule_user.rb
|
146
|
+
- app/patches/controllers/solidus_legacy_promotions/solidus_admin_adjustments_controller_patch.rb
|
147
|
+
- app/patches/lib/solidus_legacy_promotions/spree_order_state_machine_patch.rb
|
148
|
+
- app/patches/models/solidus_legacy_promotions/spree_adjustment_patch.rb
|
149
|
+
- app/patches/models/solidus_legacy_promotions/spree_calculator_returns_default_refund_amount_patch.rb
|
150
|
+
- app/patches/models/solidus_legacy_promotions/spree_line_item_patch.rb
|
151
|
+
- app/patches/models/solidus_legacy_promotions/spree_order_patch.rb
|
152
|
+
- app/patches/models/solidus_legacy_promotions/spree_order_updater_patch.rb
|
153
|
+
- app/patches/models/solidus_legacy_promotions/spree_product_patch.rb
|
154
|
+
- app/patches/models/solidus_legacy_promotions/spree_shipment_patch.rb
|
137
155
|
- app/subscribers/spree/order_promotion_subscriber.rb
|
138
156
|
- app/views/spree/order_mailer/cancel_email.html.erb
|
139
157
|
- app/views/spree/order_mailer/cancel_email.text.erb
|
@@ -157,7 +175,13 @@ files:
|
|
157
175
|
- db/migrate/20240621100123_add_promotion_code_id_to_spree_adjustments.rb
|
158
176
|
- db/migrate/20240622113334_move_adjustment_eligible_to_legacy_promotions.rb
|
159
177
|
- lib/components/admin/solidus_admin/orders/show/adjustments/index/source/spree_promotion_action/component.rb
|
178
|
+
- lib/components/admin/solidus_admin/promotion_categories/edit/component.html.erb
|
179
|
+
- lib/components/admin/solidus_admin/promotion_categories/edit/component.rb
|
180
|
+
- lib/components/admin/solidus_admin/promotion_categories/edit/component.yml
|
160
181
|
- lib/components/admin/solidus_admin/promotion_categories/index/component.rb
|
182
|
+
- lib/components/admin/solidus_admin/promotion_categories/new/component.html.erb
|
183
|
+
- lib/components/admin/solidus_admin/promotion_categories/new/component.rb
|
184
|
+
- lib/components/admin/solidus_admin/promotion_categories/new/component.yml
|
161
185
|
- lib/components/admin/solidus_admin/promotions/index/component.rb
|
162
186
|
- lib/components/admin/solidus_admin/promotions/index/component.yml
|
163
187
|
- lib/components/admin/solidus_legacy_promotions/orders/index/component.rb
|
@@ -240,7 +264,6 @@ licenses:
|
|
240
264
|
- BSD-3-Clause
|
241
265
|
metadata:
|
242
266
|
rubygems_mfa_required: 'true'
|
243
|
-
post_install_message:
|
244
267
|
rdoc_options: []
|
245
268
|
require_paths:
|
246
269
|
- lib
|
@@ -255,8 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
278
|
- !ruby/object:Gem::Version
|
256
279
|
version: 1.8.23
|
257
280
|
requirements: []
|
258
|
-
rubygems_version: 3.
|
259
|
-
signing_key:
|
281
|
+
rubygems_version: 3.6.3
|
260
282
|
specification_version: 4
|
261
283
|
summary: Legacy Solidus promotion system
|
262
284
|
test_files: []
|
data/app/decorators/solidus_legacy_promotions/models/spree_promotion_code_batch_decorator.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module SolidusLegacyPromotions
|
4
|
-
module SpreePromotionCodeBatchDecorator
|
5
|
-
def process
|
6
|
-
if state == "pending"
|
7
|
-
update!(state: "processing")
|
8
|
-
Spree::PromotionCodeBatchJob.perform_later(self)
|
9
|
-
else
|
10
|
-
raise Spree::PromotionCodeBatch::CantProcessStartedBatch.new("Batch #{id} already started")
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
Spree::PromotionCodeBatch.prepend(self)
|
15
|
-
end
|
16
|
-
end
|