solidus_promotions 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (234) hide show
  1. checksums.yaml +7 -0
  2. data/.eslintrc.json +10 -0
  3. data/.github/stale.yml +1 -0
  4. data/MIGRATING.md +184 -0
  5. data/README.md +122 -0
  6. data/Rakefile +20 -0
  7. data/app/assets/config/solidus_promotions/manifest.js +13 -0
  8. data/app/decorators/models/solidus_promotions/adjustment_decorator.rb +11 -0
  9. data/app/decorators/models/solidus_promotions/line_item_decorator.rb +27 -0
  10. data/app/decorators/models/solidus_promotions/order_decorator.rb +42 -0
  11. data/app/decorators/models/solidus_promotions/order_recalculator_decorator.rb +15 -0
  12. data/app/decorators/models/solidus_promotions/shipment_decorator.rb +14 -0
  13. data/app/decorators/models/solidus_promotions/shipping_rate_decorator.rb +29 -0
  14. data/app/helpers/solidus_promotions/admin/benefits_helper.rb +19 -0
  15. data/app/helpers/solidus_promotions/admin/conditions_helper.rb +14 -0
  16. data/app/helpers/solidus_promotions/admin/promotions_helper.rb +15 -0
  17. data/app/javascript/backend/solidus_promotions/controllers/application.js +9 -0
  18. data/app/javascript/backend/solidus_promotions/controllers/calculator_tiers_controller.js +37 -0
  19. data/app/javascript/backend/solidus_promotions/controllers/flash_controller.js +10 -0
  20. data/app/javascript/backend/solidus_promotions/controllers/index.js +8 -0
  21. data/app/javascript/backend/solidus_promotions/controllers/product_option_values_controller.js +62 -0
  22. data/app/javascript/backend/solidus_promotions/web_components/number_with_currency.js +35 -0
  23. data/app/javascript/backend/solidus_promotions/web_components/option_value_picker.js +52 -0
  24. data/app/javascript/backend/solidus_promotions/web_components/product_picker.js +7 -0
  25. data/app/javascript/backend/solidus_promotions/web_components/select_two.js +11 -0
  26. data/app/javascript/backend/solidus_promotions/web_components/taxon_picker.js +7 -0
  27. data/app/javascript/backend/solidus_promotions/web_components/user_picker.js +7 -0
  28. data/app/javascript/backend/solidus_promotions/web_components/variant_picker.js +7 -0
  29. data/app/javascript/backend/solidus_promotions.js +11 -0
  30. data/app/jobs/solidus_promotions/promotion_code_batch_job.rb +26 -0
  31. data/app/mailers/solidus_promotions/promotion_code_batch_mailer.rb +15 -0
  32. data/app/models/concerns/solidus_promotions/benefits/line_item_benefit.rb +15 -0
  33. data/app/models/concerns/solidus_promotions/benefits/order_benefit.rb +15 -0
  34. data/app/models/concerns/solidus_promotions/benefits/shipment_benefit.rb +15 -0
  35. data/app/models/concerns/solidus_promotions/calculators/promotion_calculator.rb +11 -0
  36. data/app/models/concerns/solidus_promotions/conditions/line_item_applicable_order_level_condition.rb +23 -0
  37. data/app/models/concerns/solidus_promotions/conditions/line_item_level_condition.rb +15 -0
  38. data/app/models/concerns/solidus_promotions/conditions/order_level_condition.rb +15 -0
  39. data/app/models/concerns/solidus_promotions/conditions/shipment_level_condition.rb +15 -0
  40. data/app/models/concerns/solidus_promotions/discountable_amount.rb +21 -0
  41. data/app/models/solidus_promotions/benefit.rb +123 -0
  42. data/app/models/solidus_promotions/benefits/adjust_line_item.rb +13 -0
  43. data/app/models/solidus_promotions/benefits/adjust_line_item_quantity_groups.rb +107 -0
  44. data/app/models/solidus_promotions/benefits/adjust_shipment.rb +13 -0
  45. data/app/models/solidus_promotions/benefits/create_discounted_item.rb +49 -0
  46. data/app/models/solidus_promotions/calculators/distributed_amount.rb +31 -0
  47. data/app/models/solidus_promotions/calculators/flat_rate.rb +23 -0
  48. data/app/models/solidus_promotions/calculators/flexi_rate.rb +26 -0
  49. data/app/models/solidus_promotions/calculators/percent.rb +19 -0
  50. data/app/models/solidus_promotions/calculators/tiered_flat_rate.rb +58 -0
  51. data/app/models/solidus_promotions/calculators/tiered_percent.rb +68 -0
  52. data/app/models/solidus_promotions/calculators/tiered_percent_on_eligible_item_quantity.rb +40 -0
  53. data/app/models/solidus_promotions/condition.rb +61 -0
  54. data/app/models/solidus_promotions/condition_product.rb +8 -0
  55. data/app/models/solidus_promotions/condition_store.rb +8 -0
  56. data/app/models/solidus_promotions/condition_taxon.rb +8 -0
  57. data/app/models/solidus_promotions/condition_user.rb +8 -0
  58. data/app/models/solidus_promotions/conditions/discounted_item_total.rb +22 -0
  59. data/app/models/solidus_promotions/conditions/first_order.rb +31 -0
  60. data/app/models/solidus_promotions/conditions/first_repeat_purchase_since.rb +31 -0
  61. data/app/models/solidus_promotions/conditions/item_total.rb +75 -0
  62. data/app/models/solidus_promotions/conditions/line_item_option_value.rb +37 -0
  63. data/app/models/solidus_promotions/conditions/line_item_product.rb +56 -0
  64. data/app/models/solidus_promotions/conditions/line_item_taxon.rb +59 -0
  65. data/app/models/solidus_promotions/conditions/minimum_quantity.rb +42 -0
  66. data/app/models/solidus_promotions/conditions/nth_order.rb +40 -0
  67. data/app/models/solidus_promotions/conditions/one_use_per_user.rb +25 -0
  68. data/app/models/solidus_promotions/conditions/option_value.rb +28 -0
  69. data/app/models/solidus_promotions/conditions/product.rb +85 -0
  70. data/app/models/solidus_promotions/conditions/shipping_method.rb +19 -0
  71. data/app/models/solidus_promotions/conditions/store.rb +26 -0
  72. data/app/models/solidus_promotions/conditions/taxon.rb +98 -0
  73. data/app/models/solidus_promotions/conditions/user.rb +35 -0
  74. data/app/models/solidus_promotions/conditions/user_logged_in.rb +16 -0
  75. data/app/models/solidus_promotions/conditions/user_role.rb +42 -0
  76. data/app/models/solidus_promotions/distributed_amounts_handler.rb +39 -0
  77. data/app/models/solidus_promotions/eligibility_result.rb +5 -0
  78. data/app/models/solidus_promotions/eligibility_results.rb +47 -0
  79. data/app/models/solidus_promotions/item_discount.rb +21 -0
  80. data/app/models/solidus_promotions/migration_support/order_promotion_syncer.rb +54 -0
  81. data/app/models/solidus_promotions/order_adjuster/choose_discounts.rb +21 -0
  82. data/app/models/solidus_promotions/order_adjuster/discount_order.rb +93 -0
  83. data/app/models/solidus_promotions/order_adjuster/load_promotions.rb +53 -0
  84. data/app/models/solidus_promotions/order_adjuster/persist_discounted_order.rb +79 -0
  85. data/app/models/solidus_promotions/order_adjuster.rb +33 -0
  86. data/app/models/solidus_promotions/order_promotion.rb +23 -0
  87. data/app/models/solidus_promotions/permission_sets/solidus_promotion_management.rb +15 -0
  88. data/app/models/solidus_promotions/promotion.rb +163 -0
  89. data/app/models/solidus_promotions/promotion_advertiser.rb +10 -0
  90. data/app/models/solidus_promotions/promotion_category.rb +9 -0
  91. data/app/models/solidus_promotions/promotion_code/batch_builder.rb +73 -0
  92. data/app/models/solidus_promotions/promotion_code.rb +56 -0
  93. data/app/models/solidus_promotions/promotion_code_batch.rb +25 -0
  94. data/app/models/solidus_promotions/promotion_finder.rb +10 -0
  95. data/app/models/solidus_promotions/promotion_handler/coupon.rb +113 -0
  96. data/app/models/solidus_promotions/promotion_handler/page.rb +30 -0
  97. data/app/models/solidus_promotions/shipping_rate_discount.rb +11 -0
  98. data/app/subscribers/solidus_promotions/order_promotion_subscriber.rb +20 -0
  99. data/bin/rails +13 -0
  100. data/config/importmap.rb +14 -0
  101. data/config/locales/en.yml +376 -0
  102. data/config/locales/promotion_categories.en.yml +6 -0
  103. data/config/locales/promotions.en.yml +6 -0
  104. data/config/routes.rb +38 -0
  105. data/db/migrate/20230703101637_create_promotions.rb +25 -0
  106. data/db/migrate/20230703113625_create_promotion_benefits.rb +15 -0
  107. data/db/migrate/20230703141116_create_promotion_categories.rb +14 -0
  108. data/db/migrate/20230703143943_create_promotion_conditions.rb +12 -0
  109. data/db/migrate/20230704083830_add_condition_join_tables.rb +31 -0
  110. data/db/migrate/20230704102444_create_promotion_codes.rb +11 -0
  111. data/db/migrate/20230704102656_create_promotion_code_batches.rb +34 -0
  112. data/db/migrate/20230705171556_create_order_promotions.rb +11 -0
  113. data/db/migrate/20230725074235_create_shipping_rate_discounts.rb +12 -0
  114. data/db/migrate/20231011100059_add_db_comments_to_order_promotions.rb +61 -0
  115. data/db/migrate/20231011120928_add_db_comments_to_condition_taxons.rb +54 -0
  116. data/db/migrate/20231011131324_add_db_comments_to_conditions.rb +60 -0
  117. data/db/migrate/20231011142040_add_db_comments_to_condition_users.rb +53 -0
  118. data/db/migrate/20231011155822_add_db_comments_to_promotions.rb +123 -0
  119. data/db/migrate/20231011163030_add_db_comments_to_promotion_codes.rb +60 -0
  120. data/db/migrate/20231011173312_add_db_comments_to_promotion_code_batches.rb +91 -0
  121. data/db/migrate/20231011184205_add_db_comments_to_condition_stores.rb +53 -0
  122. data/db/migrate/20231011190222_add_db_comments_to_benefits.rb +61 -0
  123. data/db/migrate/20231012020928_add_db_comments_to_condition_products.rb +52 -0
  124. data/db/migrate/20231012120928_add_db_comments_to_promotion_categories.rb +52 -0
  125. data/db/migrate/20231104135812_add_managed_by_order_benefit_to_line_items.rb +5 -0
  126. data/lib/components/admin/solidus_admin/orders/show/adjustments/index/source/solidus_promotions_benefit/component.rb +17 -0
  127. data/lib/components/admin/solidus_promotions/orders/index/component.rb +15 -0
  128. data/lib/components/admin/solidus_promotions/orders/index/component.yml +3 -0
  129. data/lib/components/admin/solidus_promotions/promotion_categories/index/component.rb +60 -0
  130. data/lib/components/admin/solidus_promotions/promotions/index/component.rb +108 -0
  131. data/lib/components/admin/solidus_promotions/promotions/index/component.yml +10 -0
  132. data/lib/controllers/admin/solidus_promotions/promotion_categories_controller.rb +29 -0
  133. data/lib/controllers/admin/solidus_promotions/promotions_controller.rb +46 -0
  134. data/lib/controllers/backend/solidus_promotions/admin/base_controller.rb +15 -0
  135. data/lib/controllers/backend/solidus_promotions/admin/benefits_controller.rb +85 -0
  136. data/lib/controllers/backend/solidus_promotions/admin/conditions_controller.rb +69 -0
  137. data/lib/controllers/backend/solidus_promotions/admin/promotion_categories_controller.rb +13 -0
  138. data/lib/controllers/backend/solidus_promotions/admin/promotion_code_batches_controller.rb +42 -0
  139. data/lib/controllers/backend/solidus_promotions/admin/promotion_codes_controller.rb +58 -0
  140. data/lib/controllers/backend/solidus_promotions/admin/promotions_controller.rb +65 -0
  141. data/lib/generators/solidus_promotions/install/install_generator.rb +56 -0
  142. data/lib/generators/solidus_promotions/install/templates/initializer.rb +6 -0
  143. data/lib/solidus_promotions/configuration.rb +125 -0
  144. data/lib/solidus_promotions/engine.rb +115 -0
  145. data/lib/solidus_promotions/migrate_adjustments.rb +62 -0
  146. data/lib/solidus_promotions/migrate_order_promotions.rb +73 -0
  147. data/lib/solidus_promotions/promotion_map.rb +126 -0
  148. data/lib/solidus_promotions/promotion_migrator.rb +103 -0
  149. data/lib/solidus_promotions/testing_support/factories/completed_order_with_solidus_promotion_factory.rb +20 -0
  150. data/lib/solidus_promotions/testing_support/factories/solidus_order_promotion_factory.rb +8 -0
  151. data/lib/solidus_promotions/testing_support/factories/solidus_promotion_category_factory.rb +7 -0
  152. data/lib/solidus_promotions/testing_support/factories/solidus_promotion_code_factory.rb +8 -0
  153. data/lib/solidus_promotions/testing_support/factories/solidus_promotion_factory.rb +65 -0
  154. data/lib/solidus_promotions/testing_support/factories/solidus_shipping_rate_discount_factory.rb +14 -0
  155. data/lib/solidus_promotions/testing_support/factory_bot.rb +30 -0
  156. data/lib/solidus_promotions.rb +37 -0
  157. data/lib/tasks/solidus_promotions/migrate_adjustments.rake +17 -0
  158. data/lib/tasks/solidus_promotions/migrate_existing_promotions.rake +12 -0
  159. data/lib/tasks/solidus_promotions/migrate_order_promotions.rake +17 -0
  160. data/lib/views/backend/solidus_promotions/admin/benefit_fields/_adjust_line_item.html.erb +6 -0
  161. data/lib/views/backend/solidus_promotions/admin/benefit_fields/_adjust_line_item_quantity_groups.html.erb +13 -0
  162. data/lib/views/backend/solidus_promotions/admin/benefit_fields/_adjust_shipment.html.erb +6 -0
  163. data/lib/views/backend/solidus_promotions/admin/benefit_fields/_calculator_fields.erb +11 -0
  164. data/lib/views/backend/solidus_promotions/admin/benefit_fields/_create_discounted_item.html.erb +21 -0
  165. data/lib/views/backend/solidus_promotions/admin/benefits/_benefit.html.erb +50 -0
  166. data/lib/views/backend/solidus_promotions/admin/benefits/_calculator_select.html.erb +16 -0
  167. data/lib/views/backend/solidus_promotions/admin/benefits/_form.html.erb +3 -0
  168. data/lib/views/backend/solidus_promotions/admin/benefits/_new_benefit.html.erb +33 -0
  169. data/lib/views/backend/solidus_promotions/admin/benefits/_type_select.html.erb +16 -0
  170. data/lib/views/backend/solidus_promotions/admin/benefits/edit.html.erb +19 -0
  171. data/lib/views/backend/solidus_promotions/admin/benefits/new.html.erb +1 -0
  172. data/lib/views/backend/solidus_promotions/admin/calculator_fields/_default_fields.html.erb +6 -0
  173. data/lib/views/backend/solidus_promotions/admin/calculator_fields/distributed_amount/_fields.html.erb +18 -0
  174. data/lib/views/backend/solidus_promotions/admin/calculator_fields/flat_rate/_fields.html.erb +6 -0
  175. data/lib/views/backend/solidus_promotions/admin/calculator_fields/flexi_rate/_fields.html.erb +24 -0
  176. data/lib/views/backend/solidus_promotions/admin/calculator_fields/percent/_fields.html.erb +6 -0
  177. data/lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_flat_rate/_fields.html.erb +32 -0
  178. data/lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_flat_rate/_tier_fields.html.erb +31 -0
  179. data/lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_percent/_fields.html.erb +47 -0
  180. data/lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_percent/_tier_fields.html.erb +33 -0
  181. data/lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_percent_on_eligible_item_quantity/_fields.html.erb +36 -0
  182. data/lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_percent_on_eligible_item_quantity/_tier_fields.html.erb +35 -0
  183. data/lib/views/backend/solidus_promotions/admin/condition_fields/_first_order.html.erb +3 -0
  184. data/lib/views/backend/solidus_promotions/admin/condition_fields/_first_repeat_purchase_since.html.erb +7 -0
  185. data/lib/views/backend/solidus_promotions/admin/condition_fields/_item_total.html.erb +15 -0
  186. data/lib/views/backend/solidus_promotions/admin/condition_fields/_line_item_option_value.html.erb +25 -0
  187. data/lib/views/backend/solidus_promotions/admin/condition_fields/_line_item_product.html.erb +21 -0
  188. data/lib/views/backend/solidus_promotions/admin/condition_fields/_line_item_taxon.html.erb +17 -0
  189. data/lib/views/backend/solidus_promotions/admin/condition_fields/_minimum_quantity.html.erb +5 -0
  190. data/lib/views/backend/solidus_promotions/admin/condition_fields/_nth_order.html.erb +15 -0
  191. data/lib/views/backend/solidus_promotions/admin/condition_fields/_one_use_per_user.html.erb +3 -0
  192. data/lib/views/backend/solidus_promotions/admin/condition_fields/_option_value.html.erb +63 -0
  193. data/lib/views/backend/solidus_promotions/admin/condition_fields/_product.html.erb +27 -0
  194. data/lib/views/backend/solidus_promotions/admin/condition_fields/_shipping_method.html.erb +10 -0
  195. data/lib/views/backend/solidus_promotions/admin/condition_fields/_store.html.erb +9 -0
  196. data/lib/views/backend/solidus_promotions/admin/condition_fields/_taxon.html.erb +27 -0
  197. data/lib/views/backend/solidus_promotions/admin/condition_fields/_user.html.erb +7 -0
  198. data/lib/views/backend/solidus_promotions/admin/condition_fields/_user_logged_in.html.erb +3 -0
  199. data/lib/views/backend/solidus_promotions/admin/condition_fields/_user_role.html.erb +15 -0
  200. data/lib/views/backend/solidus_promotions/admin/condition_fields/line_item_option_value/_option_value_fields.html.erb +21 -0
  201. data/lib/views/backend/solidus_promotions/admin/conditions/_condition.html.erb +26 -0
  202. data/lib/views/backend/solidus_promotions/admin/conditions/_new_condition.html.erb +26 -0
  203. data/lib/views/backend/solidus_promotions/admin/conditions/_type_select.html.erb +20 -0
  204. data/lib/views/backend/solidus_promotions/admin/conditions/new.html.erb +1 -0
  205. data/lib/views/backend/solidus_promotions/admin/promotion_categories/_form.html.erb +14 -0
  206. data/lib/views/backend/solidus_promotions/admin/promotion_categories/edit.html.erb +10 -0
  207. data/lib/views/backend/solidus_promotions/admin/promotion_categories/index.html.erb +47 -0
  208. data/lib/views/backend/solidus_promotions/admin/promotion_categories/new.html.erb +10 -0
  209. data/lib/views/backend/solidus_promotions/admin/promotion_code_batches/_form_fields.html.erb +22 -0
  210. data/lib/views/backend/solidus_promotions/admin/promotion_code_batches/download.csv.ruby +8 -0
  211. data/lib/views/backend/solidus_promotions/admin/promotion_code_batches/index.html.erb +65 -0
  212. data/lib/views/backend/solidus_promotions/admin/promotion_code_batches/new.html.erb +8 -0
  213. data/lib/views/backend/solidus_promotions/admin/promotion_codes/index.csv.ruby +8 -0
  214. data/lib/views/backend/solidus_promotions/admin/promotion_codes/index.html.erb +32 -0
  215. data/lib/views/backend/solidus_promotions/admin/promotion_codes/new.html.erb +31 -0
  216. data/lib/views/backend/solidus_promotions/admin/promotions/_form.html.erb +124 -0
  217. data/lib/views/backend/solidus_promotions/admin/promotions/_table.html.erb +57 -0
  218. data/lib/views/backend/solidus_promotions/admin/promotions/_table_filter.html.erb +78 -0
  219. data/lib/views/backend/solidus_promotions/admin/promotions/edit.html.erb +41 -0
  220. data/lib/views/backend/solidus_promotions/admin/promotions/index.html.erb +23 -0
  221. data/lib/views/backend/solidus_promotions/admin/promotions/new.html.erb +9 -0
  222. data/lib/views/backend/solidus_promotions/admin/shared/_number_with_currency.html.erb +20 -0
  223. data/lib/views/backend/solidus_promotions/admin/shared/_promotion_sub_menu.html.erb +14 -0
  224. data/lib/views/backend/solidus_promotions/admin/shared/preference_fields/_boolean.html.erb +14 -0
  225. data/lib/views/backend/solidus_promotions/admin/shared/preference_fields/_decimal.html.erb +12 -0
  226. data/lib/views/backend/solidus_promotions/admin/shared/preference_fields/_encrypted_string.html.erb +12 -0
  227. data/lib/views/backend/solidus_promotions/admin/shared/preference_fields/_integer.html.erb +12 -0
  228. data/lib/views/backend/solidus_promotions/admin/shared/preference_fields/_password.html.erb +12 -0
  229. data/lib/views/backend/solidus_promotions/admin/shared/preference_fields/_string.html.erb +12 -0
  230. data/lib/views/backend/solidus_promotions/admin/shared/preference_fields/_text.html.erb +12 -0
  231. data/lib/views/backend/solidus_promotions/promotion_code_batch_mailer/promotion_code_batch_errored.text.erb +2 -0
  232. data/lib/views/backend/solidus_promotions/promotion_code_batch_mailer/promotion_code_batch_finished.text.erb +2 -0
  233. data/solidus_promotions.gemspec +33 -0
  234. metadata +366 -0
@@ -0,0 +1,41 @@
1
+ <% admin_layout "full-width" %>
2
+
3
+ <% admin_breadcrumb(link_to plural_resource_name(SolidusPromotions::Promotion), solidus_promotions.admin_promotions_path) %>
4
+ <% admin_breadcrumb(@promotion.name) %>
5
+
6
+ <%= content_for :head do %>
7
+ <%= javascript_importmap_tags "backend/solidus_promotions", importmap: SolidusPromotions.importmap %>
8
+ <%#= stylesheet_link_tag 'solidus_promotions/promotions' %>
9
+ <% end %>
10
+
11
+ <% content_for :page_actions do %>
12
+ <li>
13
+ <% if can?(:show, SolidusPromotions::PromotionCode) %>
14
+ <%= link_to t('solidus_promotions.view_promotion_codes_list'), solidus_promotions.admin_promotion_promotion_codes_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
15
+
16
+ <%= link_to t('solidus_promotions.download_promotion_codes_list'), solidus_promotions.admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
17
+ <% end %>
18
+
19
+ <% if can?(:show, SolidusPromotions::PromotionCodeBatch) %>
20
+ <%= link_to plural_resource_name(SolidusPromotions::PromotionCodeBatch), solidus_promotions.admin_promotion_promotion_code_batches_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
21
+ <% end %>
22
+ </li>
23
+ <% end %>
24
+
25
+ <%= form_for @promotion, url: object_url, method: :put do |f| %>
26
+ <%= render partial: 'form', locals: { f: f } %>
27
+ <% if can?(:update, @promotion) %>
28
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
29
+ <% end %>
30
+ <% end %>
31
+
32
+ <fieldset>
33
+ <legend align="center"><%= t("benefits", scope: :solidus_promotions) %></legend>
34
+ <% if @promotion.benefits.any? %>
35
+ <%= render partial: 'solidus_promotions/admin/benefits/benefit', collection: @promotion.benefits %>
36
+ <% end %>
37
+
38
+ <%= turbo_frame_tag @promotion, "new_benefit" do %>
39
+ <%= link_to t(:add_benefit, scope: :solidus_promotions), solidus_promotions.new_admin_promotion_benefit_path(@promotion), class: 'btn btn-secondary' %>
40
+ <% end %>
41
+ </fieldset>
@@ -0,0 +1,23 @@
1
+ <% admin_breadcrumb(plural_resource_name(SolidusPromotions::Promotion)) %>
2
+
3
+ <% content_for :page_actions do %>
4
+ <% if can? :create, SolidusPromotions::Promotion %>
5
+ <li>
6
+ <%= link_to t('solidus_promotions.new_promotion'), solidus_promotions.new_admin_promotion_path, class: 'btn btn-primary' %>
7
+ </li>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <%= render "table_filter", search: @search %>
12
+
13
+ <%= paginate @promotions, theme: "solidus_admin" %>
14
+
15
+ <% if @promotions.length > 0 %>
16
+ <%= render "table", promotions: @promotions %>
17
+ <% else %>
18
+ <div class="no-objects-found">
19
+ <%= render 'spree/admin/shared/no_objects_found',
20
+ resource: SolidusPromotions::Promotion,
21
+ new_resource_url: new_object_url %>
22
+ </div>
23
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <% admin_layout "full-width" %>
2
+
3
+ <% admin_breadcrumb(link_to plural_resource_name(SolidusPromotions::Promotion), solidus_promotions.admin_promotions_path) %>
4
+ <% admin_breadcrumb(t('solidus_promotions.new_promotion')) %>
5
+
6
+ <%= form_for @promotion, url: collection_url do |f| %>
7
+ <%= render partial: 'form', locals: { f: f } %>
8
+ <%= render partial: 'spree/admin/shared/new_resource_links' %>
9
+ <% end %>
@@ -0,0 +1,20 @@
1
+ <% amount_attr ||= :amount %>
2
+ <% currency_attr ||= :currency %>
3
+ <% currency ||= nil %>
4
+ <% required ||= nil %>
5
+
6
+ <number-with-currency class="input-group number-with-currency <%= "number-with-currency-with-select" unless currency %>">
7
+ <div class="input-group-prepend">
8
+ <span class="input-group-text number-with-currency-symbol"></span>
9
+ </div>
10
+ <%= f.text_field amount_attr, value: number_to_currency(f.object.public_send(amount_attr), unit: '', delimiter: ''), class: 'form-control number-with-currency-amount', required: required %>
11
+ <% if currency %>
12
+ <div class="input-group-append">
13
+ <span class="input-group-text number-with-currency-addon" data-currency="<%= currency %>">
14
+ <%= ::Money::Currency.find(currency).iso_code %>
15
+ </span>
16
+ </div>
17
+ <% else %>
18
+ <%= f.select currency_attr, Spree::Config.available_currencies.map(&:iso_code), {selected: f.object.send(currency_attr) || Spree::Config.currency}, {required: required, class: 'number-with-currency-select'} %>
19
+ <% end %>
20
+ </number-with-currency>
@@ -0,0 +1,14 @@
1
+ <ul class="admin-subnav" data-hook="admin_promotion_sub_tabs">
2
+ <% if can? :admin, SolidusPromotions::Promotion %>
3
+ <%= tab url: solidus_promotions.admin_promotions_path, label: :promotions %>
4
+ <% end %>
5
+ <% if can? :admin, SolidusPromotions::PromotionCategory %>
6
+ <%= tab url: solidus_promotions.admin_promotion_categories_path, label: :promotion_categories %>
7
+ <% end %>
8
+ <% if can?(:admin, Spree::Promotion) && Spree::Promotion.any? %>
9
+ <%= tab url: spree.admin_promotions_path, label: :legacy_promotions %>
10
+ <% end %>
11
+ <% if can?(:admin, Spree::PromotionCategory) && Spree::PromotionCategory.any? %>
12
+ <%= tab url: spree.admin_promotion_categories_path, label: :legacy_promotion_categories %>
13
+ <% end %>
14
+ </ul>
@@ -0,0 +1,14 @@
1
+ <% label = local_assigns[:label].presence %>
2
+ <% html_options = local_assigns[:html_options] || {} %>
3
+
4
+ <div class="form-group">
5
+ <label>
6
+ <% if local_assigns[:form] %>
7
+ <%= form.check_box attribute, html_options %>
8
+ <% else %>
9
+ <%= hidden_field_tag name, 0 %>
10
+ <%= check_box_tag name, 1, value, html_options %>
11
+ <% end %>
12
+ <%= label || form.object.class.human_attribute_name(attribute) %>
13
+ </label>
14
+ </div>
@@ -0,0 +1,12 @@
1
+ <% label = local_assigns[:label].presence %>
2
+ <% html_options = {class: 'input_decimal fullwidth'}.update(local_assigns[:html_options] || {}) %>
3
+
4
+ <div class="form-group">
5
+ <% if local_assigns[:form] %>
6
+ <%= form.label attribute, label %>
7
+ <%= form.text_field attribute, html_options %>
8
+ <% else %>
9
+ <%= label_tag name, label %>
10
+ <%= text_field_tag name, value, html_options %>
11
+ <% end %>
12
+ </div>
@@ -0,0 +1,12 @@
1
+ <% label = local_assigns[:label].presence %>
2
+ <% html_options = {class: 'input_string fullwidth'}.merge(local_assigns[:html_options] || {}) %>
3
+
4
+ <div class="form-group">
5
+ <% if local_assigns[:form] %>
6
+ <%= form.label attribute, label %>
7
+ <%= form.text_field attribute, html_options %>
8
+ <% else %>
9
+ <%= label_tag name, label %>
10
+ <%= text_field_tag name, value, html_options %>
11
+ <% end %>
12
+ </div>
@@ -0,0 +1,12 @@
1
+ <% label = local_assigns[:label].presence %>
2
+ <% html_options = {class: 'input_integer fullwidth'}.update(local_assigns[:html_options] || {}) %>
3
+
4
+ <div class="form-group">
5
+ <% if local_assigns[:form] %>
6
+ <%= form.label attribute, label %>
7
+ <%= form.number_field attribute, html_options %>
8
+ <% else %>
9
+ <%= label_tag name, label %>
10
+ <%= number_field_tag name, value, html_options %>
11
+ <% end %>
12
+ </div>
@@ -0,0 +1,12 @@
1
+ <% label = local_assigns[:label].presence %>
2
+ <% html_options = {class: 'password_string fullwidth'}.update(local_assigns[:html_options] || {}) %>
3
+
4
+ <div class="form-group">
5
+ <% if local_assigns[:form] %>
6
+ <%= form.label attribute, label %>
7
+ <%= form.password_field attribute, html_options %>
8
+ <% else %>
9
+ <%= label_tag name, label %>
10
+ <%= password_field_tag name, value, html_options %>
11
+ <% end %>
12
+ </div>
@@ -0,0 +1,12 @@
1
+ <% label = local_assigns[:label].presence %>
2
+ <% html_options = {class: 'input_string fullwidth'}.update(local_assigns[:html_options] || {}) %>
3
+
4
+ <div class="form-group">
5
+ <% if local_assigns[:form] %>
6
+ <%= form.label attribute, label %>
7
+ <%= form.text_field attribute, html_options %>
8
+ <% else %>
9
+ <%= label_tag name, label %>
10
+ <%= text_field_tag name, value, html_options %>
11
+ <% end %>
12
+ </div>
@@ -0,0 +1,12 @@
1
+ <% label = local_assigns[:label].presence %>
2
+ <% html_options = {cols: 85, rows: 15}.update(local_assigns[:html_options] || {}) %>
3
+
4
+ <div class="form-group">
5
+ <% if local_assigns[:form] %>
6
+ <%= form.label attribute, label %>
7
+ <%= form.text_area attribute, html_options %>
8
+ <% else %>
9
+ <%= label_tag name, label %>
10
+ <%= text_area_tag name, value, html_options %>
11
+ <% end %>
12
+ </div>
@@ -0,0 +1,2 @@
1
+ <%= t(".message", error: @promotion_code_batch.error) %>
2
+ <%= @promotion_code_batch.promotion.name %>
@@ -0,0 +1,2 @@
1
+ <%= t(".message", number_of_codes: 10) %>
2
+ <%= @promotion_code_batch.promotion.name %>
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../core/lib/spree/core/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.platform = Gem::Platform::RUBY
7
+ spec.name = "solidus_promotions"
8
+ spec.version = Spree.solidus_version
9
+ spec.summary = "New promotion system for Solidus"
10
+ spec.description = spec.summary
11
+
12
+ spec.authors = ["Martin Meyerhoff", "Solidus Team"]
13
+ spec.email = "contact@solidus.io"
14
+ spec.homepage = "https://github.com/solidusio/solidus/blob/main/promotions/README.md"
15
+
16
+ spec.license = "BSD-3-Clause"
17
+
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+
20
+ spec.required_ruby_version = ">= 3.0.0"
21
+
22
+ # Specify which files should be added to the gem when it is released.
23
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
+ files = Dir.chdir(__dir__) { `git ls-files -z`.split("\x0") }
25
+ spec.files = files.grep_v(%r{^(test|spec|features)/})
26
+
27
+ spec.add_dependency "importmap-rails", "~> 1.2"
28
+ spec.add_dependency "ransack-enum", "~> 1.0"
29
+ spec.add_dependency "solidus_core", [">= 4.0.0", "< 5"]
30
+ spec.add_dependency "solidus_support", "~> 0.5"
31
+ spec.add_dependency "stimulus-rails", "~> 1.2"
32
+ spec.add_dependency "turbo-rails", ">= 1.4"
33
+ end
metadata ADDED
@@ -0,0 +1,366 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: solidus_promotions
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.4.0
5
+ platform: ruby
6
+ authors:
7
+ - Martin Meyerhoff
8
+ - Solidus Team
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2024-11-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: importmap-rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.2'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '1.2'
28
+ - !ruby/object:Gem::Dependency
29
+ name: ransack-enum
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.0'
42
+ - !ruby/object:Gem::Dependency
43
+ name: solidus_core
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: 4.0.0
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '5'
52
+ type: :runtime
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: 4.0.0
59
+ - - "<"
60
+ - !ruby/object:Gem::Version
61
+ version: '5'
62
+ - !ruby/object:Gem::Dependency
63
+ name: solidus_support
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.5'
69
+ type: :runtime
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.5'
76
+ - !ruby/object:Gem::Dependency
77
+ name: stimulus-rails
78
+ requirement: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.2'
83
+ type: :runtime
84
+ prerelease: false
85
+ version_requirements: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.2'
90
+ - !ruby/object:Gem::Dependency
91
+ name: turbo-rails
92
+ requirement: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '1.4'
97
+ type: :runtime
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '1.4'
104
+ description: New promotion system for Solidus
105
+ email: contact@solidus.io
106
+ executables: []
107
+ extensions: []
108
+ extra_rdoc_files: []
109
+ files:
110
+ - ".eslintrc.json"
111
+ - ".github/stale.yml"
112
+ - MIGRATING.md
113
+ - README.md
114
+ - Rakefile
115
+ - app/assets/config/solidus_promotions/manifest.js
116
+ - app/decorators/models/solidus_promotions/adjustment_decorator.rb
117
+ - app/decorators/models/solidus_promotions/line_item_decorator.rb
118
+ - app/decorators/models/solidus_promotions/order_decorator.rb
119
+ - app/decorators/models/solidus_promotions/order_recalculator_decorator.rb
120
+ - app/decorators/models/solidus_promotions/shipment_decorator.rb
121
+ - app/decorators/models/solidus_promotions/shipping_rate_decorator.rb
122
+ - app/helpers/solidus_promotions/admin/benefits_helper.rb
123
+ - app/helpers/solidus_promotions/admin/conditions_helper.rb
124
+ - app/helpers/solidus_promotions/admin/promotions_helper.rb
125
+ - app/javascript/backend/solidus_promotions.js
126
+ - app/javascript/backend/solidus_promotions/controllers/application.js
127
+ - app/javascript/backend/solidus_promotions/controllers/calculator_tiers_controller.js
128
+ - app/javascript/backend/solidus_promotions/controllers/flash_controller.js
129
+ - app/javascript/backend/solidus_promotions/controllers/index.js
130
+ - app/javascript/backend/solidus_promotions/controllers/product_option_values_controller.js
131
+ - app/javascript/backend/solidus_promotions/web_components/number_with_currency.js
132
+ - app/javascript/backend/solidus_promotions/web_components/option_value_picker.js
133
+ - app/javascript/backend/solidus_promotions/web_components/product_picker.js
134
+ - app/javascript/backend/solidus_promotions/web_components/select_two.js
135
+ - app/javascript/backend/solidus_promotions/web_components/taxon_picker.js
136
+ - app/javascript/backend/solidus_promotions/web_components/user_picker.js
137
+ - app/javascript/backend/solidus_promotions/web_components/variant_picker.js
138
+ - app/jobs/solidus_promotions/promotion_code_batch_job.rb
139
+ - app/mailers/solidus_promotions/promotion_code_batch_mailer.rb
140
+ - app/models/concerns/solidus_promotions/benefits/line_item_benefit.rb
141
+ - app/models/concerns/solidus_promotions/benefits/order_benefit.rb
142
+ - app/models/concerns/solidus_promotions/benefits/shipment_benefit.rb
143
+ - app/models/concerns/solidus_promotions/calculators/promotion_calculator.rb
144
+ - app/models/concerns/solidus_promotions/conditions/line_item_applicable_order_level_condition.rb
145
+ - app/models/concerns/solidus_promotions/conditions/line_item_level_condition.rb
146
+ - app/models/concerns/solidus_promotions/conditions/order_level_condition.rb
147
+ - app/models/concerns/solidus_promotions/conditions/shipment_level_condition.rb
148
+ - app/models/concerns/solidus_promotions/discountable_amount.rb
149
+ - app/models/solidus_promotions/benefit.rb
150
+ - app/models/solidus_promotions/benefits/adjust_line_item.rb
151
+ - app/models/solidus_promotions/benefits/adjust_line_item_quantity_groups.rb
152
+ - app/models/solidus_promotions/benefits/adjust_shipment.rb
153
+ - app/models/solidus_promotions/benefits/create_discounted_item.rb
154
+ - app/models/solidus_promotions/calculators/distributed_amount.rb
155
+ - app/models/solidus_promotions/calculators/flat_rate.rb
156
+ - app/models/solidus_promotions/calculators/flexi_rate.rb
157
+ - app/models/solidus_promotions/calculators/percent.rb
158
+ - app/models/solidus_promotions/calculators/tiered_flat_rate.rb
159
+ - app/models/solidus_promotions/calculators/tiered_percent.rb
160
+ - app/models/solidus_promotions/calculators/tiered_percent_on_eligible_item_quantity.rb
161
+ - app/models/solidus_promotions/condition.rb
162
+ - app/models/solidus_promotions/condition_product.rb
163
+ - app/models/solidus_promotions/condition_store.rb
164
+ - app/models/solidus_promotions/condition_taxon.rb
165
+ - app/models/solidus_promotions/condition_user.rb
166
+ - app/models/solidus_promotions/conditions/discounted_item_total.rb
167
+ - app/models/solidus_promotions/conditions/first_order.rb
168
+ - app/models/solidus_promotions/conditions/first_repeat_purchase_since.rb
169
+ - app/models/solidus_promotions/conditions/item_total.rb
170
+ - app/models/solidus_promotions/conditions/line_item_option_value.rb
171
+ - app/models/solidus_promotions/conditions/line_item_product.rb
172
+ - app/models/solidus_promotions/conditions/line_item_taxon.rb
173
+ - app/models/solidus_promotions/conditions/minimum_quantity.rb
174
+ - app/models/solidus_promotions/conditions/nth_order.rb
175
+ - app/models/solidus_promotions/conditions/one_use_per_user.rb
176
+ - app/models/solidus_promotions/conditions/option_value.rb
177
+ - app/models/solidus_promotions/conditions/product.rb
178
+ - app/models/solidus_promotions/conditions/shipping_method.rb
179
+ - app/models/solidus_promotions/conditions/store.rb
180
+ - app/models/solidus_promotions/conditions/taxon.rb
181
+ - app/models/solidus_promotions/conditions/user.rb
182
+ - app/models/solidus_promotions/conditions/user_logged_in.rb
183
+ - app/models/solidus_promotions/conditions/user_role.rb
184
+ - app/models/solidus_promotions/distributed_amounts_handler.rb
185
+ - app/models/solidus_promotions/eligibility_result.rb
186
+ - app/models/solidus_promotions/eligibility_results.rb
187
+ - app/models/solidus_promotions/item_discount.rb
188
+ - app/models/solidus_promotions/migration_support/order_promotion_syncer.rb
189
+ - app/models/solidus_promotions/order_adjuster.rb
190
+ - app/models/solidus_promotions/order_adjuster/choose_discounts.rb
191
+ - app/models/solidus_promotions/order_adjuster/discount_order.rb
192
+ - app/models/solidus_promotions/order_adjuster/load_promotions.rb
193
+ - app/models/solidus_promotions/order_adjuster/persist_discounted_order.rb
194
+ - app/models/solidus_promotions/order_promotion.rb
195
+ - app/models/solidus_promotions/permission_sets/solidus_promotion_management.rb
196
+ - app/models/solidus_promotions/promotion.rb
197
+ - app/models/solidus_promotions/promotion_advertiser.rb
198
+ - app/models/solidus_promotions/promotion_category.rb
199
+ - app/models/solidus_promotions/promotion_code.rb
200
+ - app/models/solidus_promotions/promotion_code/batch_builder.rb
201
+ - app/models/solidus_promotions/promotion_code_batch.rb
202
+ - app/models/solidus_promotions/promotion_finder.rb
203
+ - app/models/solidus_promotions/promotion_handler/coupon.rb
204
+ - app/models/solidus_promotions/promotion_handler/page.rb
205
+ - app/models/solidus_promotions/shipping_rate_discount.rb
206
+ - app/subscribers/solidus_promotions/order_promotion_subscriber.rb
207
+ - bin/rails
208
+ - config/importmap.rb
209
+ - config/locales/en.yml
210
+ - config/locales/promotion_categories.en.yml
211
+ - config/locales/promotions.en.yml
212
+ - config/routes.rb
213
+ - db/migrate/20230703101637_create_promotions.rb
214
+ - db/migrate/20230703113625_create_promotion_benefits.rb
215
+ - db/migrate/20230703141116_create_promotion_categories.rb
216
+ - db/migrate/20230703143943_create_promotion_conditions.rb
217
+ - db/migrate/20230704083830_add_condition_join_tables.rb
218
+ - db/migrate/20230704102444_create_promotion_codes.rb
219
+ - db/migrate/20230704102656_create_promotion_code_batches.rb
220
+ - db/migrate/20230705171556_create_order_promotions.rb
221
+ - db/migrate/20230725074235_create_shipping_rate_discounts.rb
222
+ - db/migrate/20231011100059_add_db_comments_to_order_promotions.rb
223
+ - db/migrate/20231011120928_add_db_comments_to_condition_taxons.rb
224
+ - db/migrate/20231011131324_add_db_comments_to_conditions.rb
225
+ - db/migrate/20231011142040_add_db_comments_to_condition_users.rb
226
+ - db/migrate/20231011155822_add_db_comments_to_promotions.rb
227
+ - db/migrate/20231011163030_add_db_comments_to_promotion_codes.rb
228
+ - db/migrate/20231011173312_add_db_comments_to_promotion_code_batches.rb
229
+ - db/migrate/20231011184205_add_db_comments_to_condition_stores.rb
230
+ - db/migrate/20231011190222_add_db_comments_to_benefits.rb
231
+ - db/migrate/20231012020928_add_db_comments_to_condition_products.rb
232
+ - db/migrate/20231012120928_add_db_comments_to_promotion_categories.rb
233
+ - db/migrate/20231104135812_add_managed_by_order_benefit_to_line_items.rb
234
+ - lib/components/admin/solidus_admin/orders/show/adjustments/index/source/solidus_promotions_benefit/component.rb
235
+ - lib/components/admin/solidus_promotions/orders/index/component.rb
236
+ - lib/components/admin/solidus_promotions/orders/index/component.yml
237
+ - lib/components/admin/solidus_promotions/promotion_categories/index/component.rb
238
+ - lib/components/admin/solidus_promotions/promotions/index/component.rb
239
+ - lib/components/admin/solidus_promotions/promotions/index/component.yml
240
+ - lib/controllers/admin/solidus_promotions/promotion_categories_controller.rb
241
+ - lib/controllers/admin/solidus_promotions/promotions_controller.rb
242
+ - lib/controllers/backend/solidus_promotions/admin/base_controller.rb
243
+ - lib/controllers/backend/solidus_promotions/admin/benefits_controller.rb
244
+ - lib/controllers/backend/solidus_promotions/admin/conditions_controller.rb
245
+ - lib/controllers/backend/solidus_promotions/admin/promotion_categories_controller.rb
246
+ - lib/controllers/backend/solidus_promotions/admin/promotion_code_batches_controller.rb
247
+ - lib/controllers/backend/solidus_promotions/admin/promotion_codes_controller.rb
248
+ - lib/controllers/backend/solidus_promotions/admin/promotions_controller.rb
249
+ - lib/generators/solidus_promotions/install/install_generator.rb
250
+ - lib/generators/solidus_promotions/install/templates/initializer.rb
251
+ - lib/solidus_promotions.rb
252
+ - lib/solidus_promotions/configuration.rb
253
+ - lib/solidus_promotions/engine.rb
254
+ - lib/solidus_promotions/migrate_adjustments.rb
255
+ - lib/solidus_promotions/migrate_order_promotions.rb
256
+ - lib/solidus_promotions/promotion_map.rb
257
+ - lib/solidus_promotions/promotion_migrator.rb
258
+ - lib/solidus_promotions/testing_support/factories/completed_order_with_solidus_promotion_factory.rb
259
+ - lib/solidus_promotions/testing_support/factories/solidus_order_promotion_factory.rb
260
+ - lib/solidus_promotions/testing_support/factories/solidus_promotion_category_factory.rb
261
+ - lib/solidus_promotions/testing_support/factories/solidus_promotion_code_factory.rb
262
+ - lib/solidus_promotions/testing_support/factories/solidus_promotion_factory.rb
263
+ - lib/solidus_promotions/testing_support/factories/solidus_shipping_rate_discount_factory.rb
264
+ - lib/solidus_promotions/testing_support/factory_bot.rb
265
+ - lib/tasks/solidus_promotions/migrate_adjustments.rake
266
+ - lib/tasks/solidus_promotions/migrate_existing_promotions.rake
267
+ - lib/tasks/solidus_promotions/migrate_order_promotions.rake
268
+ - lib/views/backend/solidus_promotions/admin/benefit_fields/_adjust_line_item.html.erb
269
+ - lib/views/backend/solidus_promotions/admin/benefit_fields/_adjust_line_item_quantity_groups.html.erb
270
+ - lib/views/backend/solidus_promotions/admin/benefit_fields/_adjust_shipment.html.erb
271
+ - lib/views/backend/solidus_promotions/admin/benefit_fields/_calculator_fields.erb
272
+ - lib/views/backend/solidus_promotions/admin/benefit_fields/_create_discounted_item.html.erb
273
+ - lib/views/backend/solidus_promotions/admin/benefits/_benefit.html.erb
274
+ - lib/views/backend/solidus_promotions/admin/benefits/_calculator_select.html.erb
275
+ - lib/views/backend/solidus_promotions/admin/benefits/_form.html.erb
276
+ - lib/views/backend/solidus_promotions/admin/benefits/_new_benefit.html.erb
277
+ - lib/views/backend/solidus_promotions/admin/benefits/_type_select.html.erb
278
+ - lib/views/backend/solidus_promotions/admin/benefits/edit.html.erb
279
+ - lib/views/backend/solidus_promotions/admin/benefits/new.html.erb
280
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/_default_fields.html.erb
281
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/distributed_amount/_fields.html.erb
282
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/flat_rate/_fields.html.erb
283
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/flexi_rate/_fields.html.erb
284
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/percent/_fields.html.erb
285
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_flat_rate/_fields.html.erb
286
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_flat_rate/_tier_fields.html.erb
287
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_percent/_fields.html.erb
288
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_percent/_tier_fields.html.erb
289
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_percent_on_eligible_item_quantity/_fields.html.erb
290
+ - lib/views/backend/solidus_promotions/admin/calculator_fields/tiered_percent_on_eligible_item_quantity/_tier_fields.html.erb
291
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_first_order.html.erb
292
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_first_repeat_purchase_since.html.erb
293
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_item_total.html.erb
294
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_line_item_option_value.html.erb
295
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_line_item_product.html.erb
296
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_line_item_taxon.html.erb
297
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_minimum_quantity.html.erb
298
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_nth_order.html.erb
299
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_one_use_per_user.html.erb
300
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_option_value.html.erb
301
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_product.html.erb
302
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_shipping_method.html.erb
303
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_store.html.erb
304
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_taxon.html.erb
305
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_user.html.erb
306
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_user_logged_in.html.erb
307
+ - lib/views/backend/solidus_promotions/admin/condition_fields/_user_role.html.erb
308
+ - lib/views/backend/solidus_promotions/admin/condition_fields/line_item_option_value/_option_value_fields.html.erb
309
+ - lib/views/backend/solidus_promotions/admin/conditions/_condition.html.erb
310
+ - lib/views/backend/solidus_promotions/admin/conditions/_new_condition.html.erb
311
+ - lib/views/backend/solidus_promotions/admin/conditions/_type_select.html.erb
312
+ - lib/views/backend/solidus_promotions/admin/conditions/new.html.erb
313
+ - lib/views/backend/solidus_promotions/admin/promotion_categories/_form.html.erb
314
+ - lib/views/backend/solidus_promotions/admin/promotion_categories/edit.html.erb
315
+ - lib/views/backend/solidus_promotions/admin/promotion_categories/index.html.erb
316
+ - lib/views/backend/solidus_promotions/admin/promotion_categories/new.html.erb
317
+ - lib/views/backend/solidus_promotions/admin/promotion_code_batches/_form_fields.html.erb
318
+ - lib/views/backend/solidus_promotions/admin/promotion_code_batches/download.csv.ruby
319
+ - lib/views/backend/solidus_promotions/admin/promotion_code_batches/index.html.erb
320
+ - lib/views/backend/solidus_promotions/admin/promotion_code_batches/new.html.erb
321
+ - lib/views/backend/solidus_promotions/admin/promotion_codes/index.csv.ruby
322
+ - lib/views/backend/solidus_promotions/admin/promotion_codes/index.html.erb
323
+ - lib/views/backend/solidus_promotions/admin/promotion_codes/new.html.erb
324
+ - lib/views/backend/solidus_promotions/admin/promotions/_form.html.erb
325
+ - lib/views/backend/solidus_promotions/admin/promotions/_table.html.erb
326
+ - lib/views/backend/solidus_promotions/admin/promotions/_table_filter.html.erb
327
+ - lib/views/backend/solidus_promotions/admin/promotions/edit.html.erb
328
+ - lib/views/backend/solidus_promotions/admin/promotions/index.html.erb
329
+ - lib/views/backend/solidus_promotions/admin/promotions/new.html.erb
330
+ - lib/views/backend/solidus_promotions/admin/shared/_number_with_currency.html.erb
331
+ - lib/views/backend/solidus_promotions/admin/shared/_promotion_sub_menu.html.erb
332
+ - lib/views/backend/solidus_promotions/admin/shared/preference_fields/_boolean.html.erb
333
+ - lib/views/backend/solidus_promotions/admin/shared/preference_fields/_decimal.html.erb
334
+ - lib/views/backend/solidus_promotions/admin/shared/preference_fields/_encrypted_string.html.erb
335
+ - lib/views/backend/solidus_promotions/admin/shared/preference_fields/_integer.html.erb
336
+ - lib/views/backend/solidus_promotions/admin/shared/preference_fields/_password.html.erb
337
+ - lib/views/backend/solidus_promotions/admin/shared/preference_fields/_string.html.erb
338
+ - lib/views/backend/solidus_promotions/admin/shared/preference_fields/_text.html.erb
339
+ - lib/views/backend/solidus_promotions/promotion_code_batch_mailer/promotion_code_batch_errored.text.erb
340
+ - lib/views/backend/solidus_promotions/promotion_code_batch_mailer/promotion_code_batch_finished.text.erb
341
+ - solidus_promotions.gemspec
342
+ homepage: https://github.com/solidusio/solidus/blob/main/promotions/README.md
343
+ licenses:
344
+ - BSD-3-Clause
345
+ metadata:
346
+ homepage_uri: https://github.com/solidusio/solidus/blob/main/promotions/README.md
347
+ post_install_message:
348
+ rdoc_options: []
349
+ require_paths:
350
+ - lib
351
+ required_ruby_version: !ruby/object:Gem::Requirement
352
+ requirements:
353
+ - - ">="
354
+ - !ruby/object:Gem::Version
355
+ version: 3.0.0
356
+ required_rubygems_version: !ruby/object:Gem::Requirement
357
+ requirements:
358
+ - - ">="
359
+ - !ruby/object:Gem::Version
360
+ version: '0'
361
+ requirements: []
362
+ rubygems_version: 3.5.22
363
+ signing_key:
364
+ specification_version: 4
365
+ summary: New promotion system for Solidus
366
+ test_files: []