spree_core 6.0.4 → 6.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/app/jobs/spree/imports/create_rows_job.rb +4 -2
  3. data/app/jobs/spree/imports/process_rows_job.rb +4 -2
  4. data/app/jobs/spree/products/auto_match_taxons_job.rb +5 -2
  5. data/app/jobs/spree/search_provider/index_job.rb +8 -0
  6. data/app/jobs/spree/search_provider/remove_job.rb +3 -0
  7. data/app/jobs/spree/stock_locations/stock_items/create_job.rb +5 -2
  8. data/app/mailers/spree/base_mailer.rb +1 -1
  9. data/app/models/concerns/spree/acted_by.rb +2 -2
  10. data/app/models/concerns/spree/customer_methods.rb +6 -4
  11. data/app/models/concerns/spree/deprecated_customer_alias.rb +11 -3
  12. data/app/models/concerns/spree/derived_number.rb +1 -1
  13. data/app/models/concerns/spree/has_custom_fields.rb +12 -10
  14. data/app/models/concerns/spree/integrations_concern.rb +5 -3
  15. data/app/models/concerns/spree/label_translatable.rb +4 -4
  16. data/app/models/concerns/spree/metadata.rb +3 -3
  17. data/app/models/concerns/spree/presentation_translatable.rb +1 -1
  18. data/app/models/concerns/spree/purchase/addresses.rb +8 -5
  19. data/app/models/concerns/spree/purchase/deprecated_aliases.rb +2 -2
  20. data/app/models/concerns/spree/stores/markets.rb +4 -2
  21. data/app/models/concerns/spree/user_address.rb +5 -2
  22. data/app/models/concerns/spree/user_methods.rb +2 -2
  23. data/app/models/spree/address.rb +29 -14
  24. data/app/models/spree/asset.rb +3 -3
  25. data/app/models/spree/base.rb +1 -1
  26. data/app/models/spree/calculator/shipping/flat_rate.rb +6 -4
  27. data/app/models/spree/cart.rb +2 -2
  28. data/app/models/spree/category.rb +8 -6
  29. data/app/models/spree/classification.rb +2 -2
  30. data/app/models/spree/current.rb +19 -0
  31. data/app/models/spree/custom_field.rb +6 -6
  32. data/app/models/spree/custom_field_definition.rb +10 -7
  33. data/app/models/spree/delivery_method.rb +21 -15
  34. data/app/models/spree/delivery_rate.rb +1 -1
  35. data/app/models/spree/digital.rb +1 -1
  36. data/app/models/spree/digital_asset.rb +2 -2
  37. data/app/models/spree/digital_link.rb +4 -4
  38. data/app/models/spree/export.rb +29 -2
  39. data/app/models/spree/fulfillment/custom_events.rb +18 -10
  40. data/app/models/spree/fulfillment.rb +30 -23
  41. data/app/models/spree/fulfillment_item.rb +3 -3
  42. data/app/models/spree/fulfilment_changer.rb +1 -1
  43. data/app/models/spree/gift_card.rb +12 -12
  44. data/app/models/spree/import.rb +23 -15
  45. data/app/models/spree/import_row.rb +6 -6
  46. data/app/models/spree/inventory_unit.rb +1 -1
  47. data/app/models/spree/invitation.rb +8 -4
  48. data/app/models/spree/line_item.rb +10 -8
  49. data/app/models/spree/media.rb +2 -2
  50. data/app/models/spree/metafield.rb +1 -1
  51. data/app/models/spree/metafield_definition.rb +1 -1
  52. data/app/models/spree/metafields.rb +2 -2
  53. data/app/models/spree/option_type.rb +26 -0
  54. data/app/models/spree/option_value.rb +3 -3
  55. data/app/models/spree/order.rb +87 -45
  56. data/app/models/spree/order_inventory.rb +2 -2
  57. data/app/models/spree/order_merger.rb +2 -2
  58. data/app/models/spree/order_updater.rb +34 -20
  59. data/app/models/spree/payment.rb +8 -8
  60. data/app/models/spree/payment_method.rb +11 -9
  61. data/app/models/spree/price.rb +19 -8
  62. data/app/models/spree/price_list.rb +12 -6
  63. data/app/models/spree/price_rules/zone_rule.rb +1 -1
  64. data/app/models/spree/product.rb +26 -24
  65. data/app/models/spree/product_category.rb +3 -3
  66. data/app/models/spree/promotion/rules/category.rb +27 -10
  67. data/app/models/spree/promotion/rules/country.rb +1 -1
  68. data/app/models/spree/promotion/rules/taxon.rb +4 -2
  69. data/app/models/spree/promotion/rules/user.rb +1 -1
  70. data/app/models/spree/promotion_action.rb +1 -1
  71. data/app/models/spree/promotion_rule_category.rb +5 -5
  72. data/app/models/spree/promotion_rule_taxon.rb +2 -2
  73. data/app/models/spree/prototype.rb +4 -1
  74. data/app/models/spree/return_authorization_reason.rb +3 -3
  75. data/app/models/spree/return_reason.rb +1 -1
  76. data/app/models/spree/search_provider/base.rb +2 -2
  77. data/app/models/spree/search_provider.rb +7 -5
  78. data/app/models/spree/shipment.rb +4 -1
  79. data/app/models/spree/shipping_method.rb +4 -1
  80. data/app/models/spree/shipping_rate.rb +1 -1
  81. data/app/models/spree/stock/coordinator.rb +2 -2
  82. data/app/models/spree/stock/estimator.rb +7 -5
  83. data/app/models/spree/stock/package.rb +10 -8
  84. data/app/models/spree/stock_item.rb +1 -1
  85. data/app/models/spree/stock_level/custom_events.rb +1 -1
  86. data/app/models/spree/stock_level.rb +1 -1
  87. data/app/models/spree/stock_location.rb +12 -8
  88. data/app/models/spree/stock_movement.rb +6 -6
  89. data/app/models/spree/stock_reservation.rb +5 -5
  90. data/app/models/spree/store.rb +42 -16
  91. data/app/models/spree/store_credit.rb +2 -2
  92. data/app/models/spree/store_credit_category.rb +5 -5
  93. data/app/models/spree/store_credit_type.rb +2 -2
  94. data/app/models/spree/subscriber.rb +7 -7
  95. data/app/models/spree/tax_rate.rb +5 -5
  96. data/app/models/spree/taxon.rb +3 -3
  97. data/app/models/spree/taxon_rule.rb +2 -2
  98. data/app/models/spree/taxonomy.rb +1 -1
  99. data/app/models/spree/variant.rb +12 -10
  100. data/app/models/spree/variant_media.rb +1 -1
  101. data/app/models/spree/wished_item.rb +1 -1
  102. data/app/models/spree/wishlist.rb +2 -2
  103. data/app/models/spree/wishlist_item/custom_events.rb +2 -2
  104. data/app/models/spree/zone.rb +1 -1
  105. data/app/models/spree/zone_member.rb +1 -1
  106. data/app/services/spree/carts/associate.rb +6 -2
  107. data/app/services/spree/carts/create.rb +1 -1
  108. data/app/services/spree/carts/destroy.rb +1 -1
  109. data/app/services/spree/carts/remove_item.rb +1 -1
  110. data/app/services/spree/carts/remove_line_item.rb +2 -2
  111. data/app/services/spree/carts/remove_out_of_stock_items.rb +3 -1
  112. data/app/services/spree/carts/set_quantity.rb +2 -2
  113. data/app/services/spree/carts/update.rb +17 -0
  114. data/app/services/spree/checkout/add_store_credit.rb +3 -3
  115. data/app/services/spree/checkout/remove_store_credit.rb +2 -2
  116. data/app/services/spree/imports/row_processors/product_variant.rb +19 -0
  117. data/app/services/spree/orders/approve.rb +3 -3
  118. data/app/services/spree/orders/create_user_account.rb +2 -2
  119. data/app/services/spree/products/auto_match_taxons.rb +5 -2
  120. data/app/services/spree/shipments/update.rb +2 -2
  121. data/app/services/spree/stock_locations/stock_items/create.rb +5 -2
  122. data/app/services/spree/stock_reservations/extend.rb +3 -1
  123. data/app/services/spree/stock_reservations/reserve.rb +3 -1
  124. data/app/services/spree/taxons/add_products.rb +4 -2
  125. data/app/services/spree/taxons/regenerate_products.rb +5 -2
  126. data/app/services/spree/taxons/remove_products.rb +4 -2
  127. data/app/workflows/spree/carts/add_item.rb +1 -1
  128. data/app/workflows/spree/carts/recalculate.rb +1 -1
  129. data/app/workflows/spree/fulfillments/update.rb +1 -1
  130. data/app/workflows/spree/orders/cancel.rb +3 -1
  131. data/app/workflows/spree/payments/capture.rb +2 -2
  132. data/app/workflows/spree/seller_transfers/create.rb +1 -1
  133. data/config/locales/en.yml +4 -0
  134. data/db/migrate/20260710000001_rename_taxons_to_categories.rb +1 -1
  135. data/db/migrate/20260728000004_rename_shipping_to_fulfillment_and_delivery.rb +1 -1
  136. data/db/migrate/20260806000001_add_store_id_to_spree_tax_rates_and_categories.rb +1 -1
  137. data/db/migrate/20260807130001_add_country_state_codes_to_consumers.rb +1 -1
  138. data/db/migrate/20260809000001_rename_metafields_to_custom_fields.rb +1 -1
  139. data/db/migrate/20260809150001_promote_shipping_categories_to_delivery_profiles.rb +1 -1
  140. data/db/migrate/20260811000001_add_delivery_tracking_to_fulfillments.rb +1 -1
  141. data/db/migrate/20260824000001_add_store_to_spree_media.rb +1 -1
  142. data/db/migrate/20260828100001_unify_import_and_export_tenancy.rb +1 -1
  143. data/db/migrate/20261016000001_remove_default_from_spree_tax_rates_included_in_price.rb +1 -1
  144. data/lib/spree/agent_tools/default_catalog.rb +2 -2
  145. data/lib/spree/agent_tools/legacy_tools.rb +1 -1
  146. data/lib/spree/core/dependencies.rb +10 -10
  147. data/lib/spree/core/engine.rb +4 -0
  148. data/lib/spree/core/number_generator.rb +4 -3
  149. data/lib/spree/core/preferences/preferable.rb +1 -1
  150. data/lib/spree/core/preferences/preferable_class_methods.rb +5 -1
  151. data/lib/spree/core/pricing/resolver.rb +2 -2
  152. data/lib/spree/core/version.rb +1 -1
  153. data/lib/spree/core.rb +37 -10
  154. data/lib/spree/i18n.rb +6 -2
  155. data/lib/spree/localized_number.rb +1 -1
  156. data/lib/spree/removed_apis.rb +274 -0
  157. data/lib/spree/reporting/default_vocabulary.rb +1 -1
  158. data/lib/spree/testing_support/factories/digital_asset_factory.rb +1 -1
  159. data/lib/spree/testing_support/factories/stock_level_factory.rb +1 -1
  160. data/lib/spree/testing_support/factories/taxon_factory.rb +1 -1
  161. data/lib/spree/testing_support/factories/taxonomy_factory.rb +1 -1
  162. data/lib/spree/testing_support/factories/wishlist_item_factory.rb +1 -1
  163. data/lib/spree/testing_support/i18n.rb +7 -2
  164. data/lib/spree/testing_support/order_walkthrough.rb +5 -2
  165. data/lib/spree/upgrades/5_6_to_6_0/manifest.yml +14 -14
  166. data/lib/tasks/carts_migration.rake +1 -1
  167. data/lib/tasks/categories_and_collections.rake +1 -1
  168. data/lib/tasks/deliveries_migration.rake +1 -1
  169. data/lib/tasks/delivery_method_rules_migration.rake +1 -1
  170. data/lib/tasks/delivery_migration.rake +1 -1
  171. data/lib/tasks/delivery_profiles_migration.rake +2 -2
  172. data/lib/tasks/fold_store_credit_categories.rake +1 -1
  173. data/lib/tasks/migrate_country_state_codes.rake +1 -1
  174. data/lib/tasks/migrate_returns.rake +4 -4
  175. data/lib/tasks/migrate_rich_text_to_columns.rake +1 -1
  176. data/lib/tasks/store_settings.rake +1 -1
  177. data/lib/tasks/typed_stock_movements_migration.rake +1 -1
  178. metadata +7 -6
@@ -5,7 +5,9 @@ module Spree
5
5
 
6
6
  def call(cart: nil, order: nil)
7
7
  if order
8
- Spree::Deprecation.warn('Calling Spree::Carts::RemoveOutOfStockItems with order: is deprecated and will be removed in Spree 6.1. Pass cart: instead.')
8
+ Spree::Deprecation.warn(
9
+ 'Calling Spree::Carts::RemoveOutOfStockItems with order: is deprecated and will be removed in Spree 6.3. Pass cart: instead.'
10
+ )
9
11
  cart ||= order
10
12
  end
11
13
  @messages = []
@@ -3,13 +3,13 @@ module Spree
3
3
  # @deprecated Setting a quantity is a one-item upsert. Call
4
4
  # Spree::Carts::UpsertItems so the change passes the same
5
5
  # 'carts.upsert_items.validate' hook every other item mutation does.
6
- # Removed in Spree 6.1.
6
+ # Removed in Spree 6.3.
7
7
  class SetQuantity
8
8
  prepend Spree::ServiceModule::Base
9
9
 
10
10
  def call(cart: nil, order: nil, line_item: nil, quantity: nil)
11
11
  Spree::Deprecation.warn(
12
- 'Spree::Carts::SetQuantity is deprecated and will be removed in Spree 6.1. ' \
12
+ 'Spree::Carts::SetQuantity is deprecated and will be removed in Spree 6.3. ' \
13
13
  'Use Spree::Carts::UpsertItems (quantity is set, not added) instead.'
14
14
  )
15
15
  owner = cart || order
@@ -56,6 +56,13 @@ module Spree
56
56
  failure(cart, e.message)
57
57
  end
58
58
 
59
+ # Fields assign_cart_attributes handles itself; an extension can't
60
+ # reroute them through a plain assignment.
61
+ CORE_ATTRIBUTES = %i[
62
+ email customer_note po_number market_id currency locale metadata use_shipping
63
+ preferred_stock_location_id company_id po_document_signed_id
64
+ ].freeze
65
+
59
66
  private
60
67
 
61
68
  attr_reader :cart, :params
@@ -79,6 +86,7 @@ module Spree
79
86
  end
80
87
 
81
88
  def assign_cart_attributes
89
+ assign_additional_attributes
82
90
  cart.email = params[:email] if params[:email].present?
83
91
  cart.customer_note = params[:customer_note] if params.key?(:customer_note)
84
92
  cart.po_number = params[:po_number] if params.key?(:po_number)
@@ -93,6 +101,15 @@ module Spree
93
101
  assign_po_document if params.key?(:po_document_signed_id)
94
102
  end
95
103
 
104
+ # Columns an extension made writable with
105
+ # `Spree::Cart.additional_permitted_attributes += [...]`.
106
+ def assign_additional_attributes
107
+ keys = Array(Spree::Cart.try(:additional_permitted_attributes)).
108
+ flat_map { |attribute| attribute.is_a?(Hash) ? attribute.keys : attribute }.
109
+ map(&:to_sym) - CORE_ATTRIBUTES
110
+ cart.assign_attributes(params.slice(*keys)) if keys.any?
111
+ end
112
+
96
113
  # The buyer's purchase order as an ActiveStorage signed blob id — the
97
114
  # bytes are normally already in storage by the time this runs. A blank
98
115
  # value detaches, so a buyer can withdraw a document they attached in
@@ -1,14 +1,14 @@
1
1
  module Spree
2
2
  module Checkout
3
3
  # Deprecation alias for Spree::StoreCredits::Apply, renamed in 6.0 for
4
- # symmetry with Spree::GiftCards::Apply. Retained one release so existing
4
+ # symmetry with Spree::GiftCards::Apply. Retained until 6.3 so existing
5
5
  # code and extensions keep working. A constant assignment rather than a
6
6
  # subclass, so is_a? and class_name: references keep resolving; the file
7
- # is named for the constant because Zeitwerk requires it. Removed in 6.1.
7
+ # is named for the constant because Zeitwerk requires it. Removed in 6.3.
8
8
  AddStoreCredit = Spree::StoreCredits::Apply
9
9
 
10
10
  Spree::Deprecation.warn(
11
- 'Spree::Checkout::AddStoreCredit is deprecated and will be removed in Spree 6.1. ' \
11
+ 'Spree::Checkout::AddStoreCredit is deprecated and will be removed in Spree 6.3. ' \
12
12
  'Use Spree::StoreCredits::Apply instead.'
13
13
  )
14
14
  end
@@ -1,11 +1,11 @@
1
1
  module Spree
2
2
  module Checkout
3
3
  # Deprecation alias for Spree::StoreCredits::Remove — see
4
- # Spree::Checkout::AddStoreCredit. Removed in 6.1.
4
+ # Spree::Checkout::AddStoreCredit. Removed in 6.3.
5
5
  RemoveStoreCredit = Spree::StoreCredits::Remove
6
6
 
7
7
  Spree::Deprecation.warn(
8
- 'Spree::Checkout::RemoveStoreCredit is deprecated and will be removed in Spree 6.1. ' \
8
+ 'Spree::Checkout::RemoveStoreCredit is deprecated and will be removed in Spree 6.3. ' \
9
9
  'Use Spree::StoreCredits::Remove instead.'
10
10
  )
11
11
  end
@@ -13,6 +13,7 @@ module Spree
13
13
  ensure_decimals!
14
14
  @store = row.store
15
15
  @seller = import.seller
16
+ ensure_seller_options_exist! if seller.present?
16
17
  # Before the product is saved: rows are not wrapped in a transaction,
17
18
  # so an unknown location must fail the row with nothing written.
18
19
  @stock_location = import_stock_location if attributes['inventory_count'].present?
@@ -351,6 +352,24 @@ module Spree
351
352
  Spree::OptionType.for_store(store)
352
353
  end
353
354
 
355
+ # A seller builds variants from the marketplace's option types and
356
+ # values and never adds to them, so a name the store does not have
357
+ # fails the row before the product is written. Rows of one product
358
+ # repeat the same options, so the answer is cached per combination.
359
+ def ensure_seller_options_exist!
360
+ pairs = options.map { |option| [option[:option_name], option[:option_value]] }
361
+ return if pairs.empty?
362
+
363
+ unknown = cached_lookup(:unknown_seller_options, pairs) { Spree::OptionType.unknown_options(store, pairs) }.first
364
+ return unless unknown
365
+
366
+ raise ArgumentError, I18n.t('spree.product_import_unknown_option_type', name: unknown[:name]) unless unknown[:option_type]
367
+
368
+ raise ArgumentError, I18n.t('spree.product_import_unknown_option_value',
369
+ option_type: unknown[:option_type].label.presence || unknown[:option_type].name,
370
+ value: unknown[:value])
371
+ end
372
+
354
373
  def find_or_create_option_value!(option_type, label)
355
374
  cached_lookup(:option_value, option_type.id, label) do
356
375
  begin
@@ -8,12 +8,12 @@ module Spree
8
8
  # @param order [Spree::Order]
9
9
  # @param approver [Object, nil] who approved it — an admin user or an
10
10
  # API key (see Spree.actor_classes)
11
- # @param level [String, nil] deprecated and ignored — removed in Spree 6.1
12
- # @param note [String, nil] deprecated and ignored — removed in Spree 6.1
11
+ # @param level [String, nil] deprecated and ignored — removed in Spree 6.3
12
+ # @param note [String, nil] deprecated and ignored — removed in Spree 6.3
13
13
  # @return [Spree::ServiceModule::Result]
14
14
  def call(order:, approver: nil, level: nil, note: nil)
15
15
  if level.present? || note.present?
16
- Spree::Deprecation.warn('Spree::Orders::Approve no longer accepts level or note — they were never read and will be removed in Spree 6.1.')
16
+ Spree::Deprecation.warn('Spree::Orders::Approve no longer accepts level or note — they were never read and will be removed in Spree 6.3.')
17
17
  end
18
18
 
19
19
  changes = { considered_risky: false, approved_at: Time.current }
@@ -1,12 +1,12 @@
1
1
  module Spree
2
2
  module Orders
3
- # @deprecated Use {Spree::Customers::Create}; removed in 6.1. Note that
3
+ # @deprecated Use {Spree::Customers::Create}; removed in 6.3. Note that
4
4
  # core no longer sends a welcome email — implement it on the
5
5
  # `user.created` event or the `customers.create.after_create` hook.
6
6
  class CreateUserAccount
7
7
  def self.call(order:, accepts_email_marketing: false)
8
8
  Spree::Deprecation.warn(
9
- 'Spree::Orders::CreateUserAccount is deprecated and will be removed in Spree 6.1. ' \
9
+ 'Spree::Orders::CreateUserAccount is deprecated and will be removed in Spree 6.3. ' \
10
10
  'Use Spree::Customers::Create (Spree.customer_create_workflow) instead. ' \
11
11
  'Core no longer sends a welcome email — send it from a user.created subscriber or the customers.create.after_create hook.'
12
12
  )
@@ -2,14 +2,17 @@ module Spree
2
2
  module Products
3
3
  # @deprecated Automatic taxon matching moved to Spree::Collection in 6.0.
4
4
  # Delegates to Spree::Products::AutoMatchCollections (same `product:` signature);
5
- # removed in 6.1.
5
+ # removed in 6.3.
6
6
  class AutoMatchTaxons
7
7
  prepend ::Spree::ServiceModule::Base
8
8
 
9
9
  # @param product [Spree::Product]
10
10
  # @return [Spree::ServiceModule::Base::Result]
11
11
  def call(product:)
12
- Spree::Deprecation.warn('Spree::Products::AutoMatchTaxons is deprecated and will be removed in Spree 6.1. Automatic membership moved to collections; use Spree::Products::AutoMatchCollections instead.')
12
+ Spree::Deprecation.warn(
13
+ 'Spree::Products::AutoMatchTaxons is deprecated and will be removed in Spree 6.3. ' \
14
+ 'Automatic membership moved to collections; use Spree::Products::AutoMatchCollections instead.'
15
+ )
13
16
  Spree::Products::AutoMatchCollections.call(product: product)
14
17
  end
15
18
  end
@@ -1,9 +1,9 @@
1
1
  module Spree
2
2
  module Shipments
3
- # @deprecated Use {Spree::Fulfillments::Update}; removed in 6.1.
3
+ # @deprecated Use {Spree::Fulfillments::Update}; removed in 6.3.
4
4
  class Update
5
5
  def self.call(shipment:, shipment_attributes: {}, &block)
6
- Spree::Deprecation.warn('Spree::Shipments::Update is deprecated and will be removed in Spree 6.1. Use Spree::Fulfillments::Update instead.')
6
+ Spree::Deprecation.warn('Spree::Shipments::Update is deprecated and will be removed in Spree 6.3. Use Spree::Fulfillments::Update instead.')
7
7
  Spree::Fulfillments::Update.call(fulfillment: shipment, fulfillment_attributes: shipment_attributes, &block)
8
8
  end
9
9
  end
@@ -3,7 +3,7 @@ module Spree
3
3
  module StockItems
4
4
  # @deprecated Renamed to Spree::StockLocations::StockLevels::Create in 6.0.
5
5
  # This shim delegates to the renamed service so host code calling the old
6
- # name keeps working; removed in 6.1.
6
+ # name keeps working; removed in 6.3.
7
7
  class Create
8
8
  prepend Spree::ServiceModule::Base
9
9
 
@@ -11,7 +11,10 @@ module Spree
11
11
  # @param variants_scope [ActiveRecord::Relation]
12
12
  # @return [Spree::ServiceModule::Base::Result]
13
13
  def call(stock_location:, variants_scope: nil)
14
- Spree::Deprecation.warn('Spree::StockLocations::StockItems::Create is deprecated and will be removed in Spree 6.1. Use Spree::StockLocations::StockLevels::Create instead.')
14
+ Spree::Deprecation.warn(
15
+ 'Spree::StockLocations::StockItems::Create is deprecated and will be removed in Spree 6.3. ' \
16
+ 'Use Spree::StockLocations::StockLevels::Create instead.'
17
+ )
15
18
  Spree::StockLocations::StockLevels::Create.call(stock_location: stock_location, variants_scope: variants_scope)
16
19
  end
17
20
  end
@@ -5,7 +5,9 @@ module Spree
5
5
 
6
6
  def call(cart: nil, order: nil)
7
7
  if order
8
- Spree::Deprecation.warn('Calling Spree::StockReservations::Extend with order: is deprecated and will be removed in Spree 6.1. Pass cart: instead.')
8
+ Spree::Deprecation.warn(
9
+ 'Calling Spree::StockReservations::Extend with order: is deprecated and will be removed in Spree 6.3. Pass cart: instead.'
10
+ )
9
11
  cart ||= order
10
12
  end
11
13
  return success(cart) unless Spree::StorePreferences.read(cart&.store, :stock_reservations_enabled)
@@ -5,7 +5,9 @@ module Spree
5
5
 
6
6
  def call(cart: nil, order: nil)
7
7
  if order
8
- Spree::Deprecation.warn('Calling Spree::StockReservations::Reserve with order: is deprecated and will be removed in Spree 6.1. Pass cart: instead.')
8
+ Spree::Deprecation.warn(
9
+ 'Calling Spree::StockReservations::Reserve with order: is deprecated and will be removed in Spree 6.3. Pass cart: instead.'
10
+ )
9
11
  cart ||= order
10
12
  end
11
13
  return success(cart) unless Spree::StorePreferences.read(cart&.store, :stock_reservations_enabled)
@@ -2,7 +2,7 @@ module Spree
2
2
  module Taxons
3
3
  # @deprecated Renamed to Spree::Categories::AddProducts in 6.0. This shim keeps
4
4
  # the old `taxons:` keyword working by delegating to the renamed service;
5
- # removed in 6.1.
5
+ # removed in 6.3.
6
6
  class AddProducts
7
7
  prepend Spree::ServiceModule::Base
8
8
 
@@ -10,7 +10,9 @@ module Spree
10
10
  # @param products [Array<Spree::Product>]
11
11
  # @return [Spree::ServiceModule::Base::Result]
12
12
  def call(taxons:, products:)
13
- Spree::Deprecation.warn('Spree::Taxons::AddProducts is deprecated and will be removed in Spree 6.1. Use Spree::Categories::AddProducts instead.')
13
+ Spree::Deprecation.warn(
14
+ 'Spree::Taxons::AddProducts is deprecated and will be removed in Spree 6.3. Use Spree::Categories::AddProducts instead.'
15
+ )
14
16
  Spree::Categories::AddProducts.call(categories: taxons, products: products)
15
17
  end
16
18
  end
@@ -3,14 +3,17 @@ module Spree
3
3
  # @deprecated Categories are manual in 6.0 and no longer regenerate membership
4
4
  # from rules — that behavior moved to Spree::Collection. There is no faithful
5
5
  # category target, so this shim warns and no-ops (returns the given taxon).
6
- # Use Spree::Collections::RegenerateProducts for collections. Removed in 6.1.
6
+ # Use Spree::Collections::RegenerateProducts for collections. Removed in 6.3.
7
7
  class RegenerateProducts
8
8
  prepend ::Spree::ServiceModule::Base
9
9
 
10
10
  # @param taxon [Spree::Category] accepted for signature compatibility; ignored
11
11
  # @return [Spree::ServiceModule::Base::Result]
12
12
  def call(taxon: nil)
13
- Spree::Deprecation.warn('Spree::Taxons::RegenerateProducts is deprecated and does nothing in Spree 6.0 — categories are manual. Rule-based membership moved to Spree::Collection; use Spree::Collections::RegenerateProducts. Removed in 6.1.')
13
+ Spree::Deprecation.warn(
14
+ 'Spree::Taxons::RegenerateProducts is deprecated and does nothing in Spree 6.0 — categories are manual. ' \
15
+ 'Rule-based membership moved to Spree::Collection; use Spree::Collections::RegenerateProducts. Removed in 6.3.'
16
+ )
14
17
  success(taxon)
15
18
  end
16
19
  end
@@ -2,7 +2,7 @@ module Spree
2
2
  module Taxons
3
3
  # @deprecated Renamed to Spree::Categories::RemoveProducts in 6.0. This shim keeps
4
4
  # the old `taxons:` keyword working by delegating to the renamed service;
5
- # removed in 6.1.
5
+ # removed in 6.3.
6
6
  class RemoveProducts
7
7
  prepend Spree::ServiceModule::Base
8
8
 
@@ -10,7 +10,9 @@ module Spree
10
10
  # @param products [Array<Spree::Product>]
11
11
  # @return [Spree::ServiceModule::Base::Result]
12
12
  def call(taxons:, products:)
13
- Spree::Deprecation.warn('Spree::Taxons::RemoveProducts is deprecated and will be removed in Spree 6.1. Use Spree::Categories::RemoveProducts instead.')
13
+ Spree::Deprecation.warn(
14
+ 'Spree::Taxons::RemoveProducts is deprecated and will be removed in Spree 6.3. Use Spree::Categories::RemoveProducts instead.'
15
+ )
14
16
  Spree::Categories::RemoveProducts.call(categories: taxons, products: products)
15
17
  end
16
18
  end
@@ -16,7 +16,7 @@ module Spree
16
16
  # surface only (draft orders); refused once the order is placed.
17
17
  def perform(variant:, cart: nil, order: nil, quantity: nil, metadata: {}, options: {}, price: nil)
18
18
  if order
19
- Spree::Deprecation.warn('Calling Spree::Carts::AddItem with order: is deprecated and will be removed in Spree 6.1. Pass cart: instead.')
19
+ Spree::Deprecation.warn('Calling Spree::Carts::AddItem with order: is deprecated and will be removed in Spree 6.3. Pass cart: instead.')
20
20
  cart ||= order
21
21
  end
22
22
  super(cart: cart, variant: variant, quantity: quantity, metadata: metadata, options: options, price: price)
@@ -13,7 +13,7 @@ module Spree
13
13
  # for callers that are removing a promotion's effects
14
14
  def perform(cart: nil, order: nil, line_item: nil, line_item_created: false, options: {})
15
15
  if order
16
- Spree::Deprecation.warn('Calling Spree::Carts::Recalculate with order: is deprecated and will be removed in Spree 6.1. Pass cart: instead.')
16
+ Spree::Deprecation.warn('Calling Spree::Carts::Recalculate with order: is deprecated and will be removed in Spree 6.3. Pass cart: instead.')
17
17
  cart ||= order
18
18
  end
19
19
  super(cart: cart, line_item: line_item, line_item_created: line_item_created, options: options)
@@ -32,7 +32,7 @@ module Spree
32
32
  if shipment || shipment_attributes
33
33
  Spree::Deprecation.warn(
34
34
  'Calling Spree::Fulfillments::Update with shipment:/shipment_attributes: keywords is deprecated ' \
35
- 'and will be removed in Spree 6.1. Use fulfillment:/fulfillment_attributes: instead.'
35
+ 'and will be removed in Spree 6.3. Use fulfillment:/fulfillment_attributes: instead.'
36
36
  )
37
37
  end
38
38
 
@@ -33,7 +33,9 @@ module Spree
33
33
  super
34
34
 
35
35
  unless restock_items.nil?
36
- Spree::Deprecation.warn('Spree::Orders::Cancel no longer accepts restock_items — it never changed behavior and will be removed in Spree 6.1.')
36
+ Spree::Deprecation.warn(
37
+ 'Spree::Orders::Cancel no longer accepts restock_items — it never changed behavior and will be removed in Spree 6.3.'
38
+ )
37
39
  end
38
40
 
39
41
  step :ensure_cancellable
@@ -17,7 +17,7 @@ module Spree
17
17
  # @param amount [BigDecimal, nil] in the currency's own units; nil
18
18
  # captures in full, a smaller amount splits the remainder into a new
19
19
  # pending payment. An Integer is read as hundredths of the currency,
20
- # the pre-6.0 contract (deprecated, removed in 6.1).
20
+ # the pre-6.0 contract (deprecated, removed in 6.5).
21
21
  def perform(payment:, amount: nil)
22
22
  super
23
23
  @amount = capture_amount(amount)
@@ -53,7 +53,7 @@ module Spree
53
53
 
54
54
  Spree::Deprecation.warn(
55
55
  'Passing an Integer amount to the payment capture workflow is deprecated and is read as hundredths of ' \
56
- 'the currency. Pass the amount in the currency\'s own units as a BigDecimal; removed in Spree 6.1.'
56
+ 'the currency. Pass the amount in the currency\'s own units as a BigDecimal; removed in Spree 6.3.'
57
57
  )
58
58
  Spree::Money::Rounding.from_hundredths(amount)
59
59
  end
@@ -9,7 +9,7 @@ module Spree
9
9
  #
10
10
  # Idempotent by the unique index on `(order_id) WHERE kind = 'earning'` —
11
11
  # the fulfillment event can fire more than once (it is dual-emitted under a
12
- # legacy name for one release), and a re-fired event must find the earning
12
+ # legacy name until 6.5), and a re-fired event must find the earning
13
13
  # that exists rather than credit the seller twice.
14
14
  class Create < Spree::Workflow
15
15
  hooks :validate, :after_create
@@ -926,6 +926,8 @@ en:
926
926
  store_is_already_set: Store is already set
927
927
  unknown_calculator_type: "%{type} is not a calculator offered here"
928
928
  unknown_custom_field_type: 'is not a known custom field type (expected one of: %{types})'
929
+ unknown_option_type: names %{name}, which is not one of the marketplace's option types
930
+ unknown_option_value: names %{value}, which is not one of the values of %{option_type}
929
931
  unknown_row_type: "%{type} is not a %{family} offered here (expected one of: %{types})"
930
932
  unknown_scopes: 'contains unknown scopes: %{scopes}'
931
933
  unregistered_actor: is not a registered actor class
@@ -1201,6 +1203,8 @@ en:
1201
1203
  privacy_policy: Privacy Policy
1202
1204
  processing: Processing
1203
1205
  product: Product
1206
+ product_import_unknown_option_type: The marketplace has no option type named %{name}.
1207
+ product_import_unknown_option_value: "%{option_type} has no value named %{value}."
1204
1208
  product_import_unknown_stock_location: You have no stock location named %{name}.
1205
1209
  product_translations: Product Translations
1206
1210
  products: Products
@@ -7,7 +7,7 @@ class RenameTaxonsToCategories < ActiveRecord::Migration[7.2]
7
7
  # Promotion↔category join (Spree::PromotionRuleCategory) and the Mobility
8
8
  # translations table follow the same rename now, so no class needs a
9
9
  # table_name/foreign_key pin. (spree_taxon_rules + spree_prototype_taxons keep
10
- # taxon_id: the former is dropped in 6.1, the latter renamed by 6.0-product-types.)
10
+ # taxon_id: the former is dropped in 6.3, the latter renamed by 6.0-product-types.)
11
11
  rename_table :spree_promotion_rule_taxons, :spree_promotion_rule_categories
12
12
  rename_column :spree_promotion_rule_categories, :taxon_id, :category_id
13
13
 
@@ -48,7 +48,7 @@ class RenameShippingToFulfillmentAndDelivery < ActiveRecord::Migration[7.2]
48
48
  rename_column :spree_orders, :shipment_state, :fulfillment_status
49
49
  rename_column :spree_orders, :shipment_total, :delivery_total
50
50
 
51
- # Authoritative from 6.0; display_on stays readable until the 6.1 drop.
51
+ # Authoritative from 6.0; display_on stays readable until the 6.3 drop.
52
52
  # Existing rows get their real value from the spree:migrate_shipping_to_delivery
53
53
  # data task, which runs after this migration.
54
54
  add_column :spree_delivery_methods, :storefront_visible, :boolean, null: false, default: true
@@ -4,7 +4,7 @@ class AddStoreIdToSpreeTaxRatesAndCategories < ActiveRecord::Migration[8.1]
4
4
  # configuration, so they belong to a store like every other commerce
5
5
  # setting. Kept null: true here; existing rows are backfilled by
6
6
  # `spree:backfill_tax_store_ids` and presence is enforced on the model.
7
- # The NOT NULL constraints land in 6.1.
7
+ # The NOT NULL constraints land in 6.3.
8
8
  add_reference :spree_tax_rates, :store, null: true
9
9
  add_reference :spree_tax_categories, :store, null: true
10
10
 
@@ -15,7 +15,7 @@ class AddCountryStateCodesToConsumers < ActiveRecord::Migration[7.2]
15
15
  add_index :spree_market_countries, [:market_id, :country_code],
16
16
  unique: true, name: 'index_spree_market_countries_on_market_id_and_country_code'
17
17
 
18
- # The country foreign key stays until 6.1 so the upgrade task keeps its
18
+ # The country foreign key stays until 6.3 so the upgrade task keeps its
19
19
  # source data, but nothing writes it any more — a market country is
20
20
  # identified by its ISO code now.
21
21
  change_column_null :spree_market_countries, :country_id, true
@@ -32,7 +32,7 @@ class RenameMetafieldsToCustomFields < ActiveRecord::Migration[7.2]
32
32
  # column (docs/plans/6.0-rich-text-descriptions.md). Action Text keys rows
33
33
  # by the owner's STI base class, so they are found under the pre-rename
34
34
  # class name. The source rows are left in place as the rollback path; the
35
- # table is dropped in 6.1.
35
+ # table is dropped in 6.3.
36
36
  copy_action_text_bodies_into_values
37
37
 
38
38
  # display_on (both/front_end/back_end) collapses to a boolean. Only
@@ -10,7 +10,7 @@ class PromoteShippingCategoriesToDeliveryProfiles < ActiveRecord::Migration[8.1]
10
10
  rename_column :spree_products, :shipping_category_id, :delivery_profile_id
11
11
 
12
12
  # Nullable until the upgrade task assigns stores to 5.x rows; tightened
13
- # in 6.1.
13
+ # in 6.3.
14
14
  add_reference :spree_delivery_profiles, :store, index: true
15
15
  add_column :spree_delivery_profiles, :default, :boolean, null: false, default: false
16
16
  # STI: profile kinds declare behavior (Shipping, Digital, extension
@@ -10,7 +10,7 @@ class AddDeliveryTrackingToFulfillments < ActiveRecord::Migration[8.1]
10
10
  add_column :spree_fulfillments, :delivered_at, :datetime
11
11
 
12
12
  # `tracking` is the 5.6 column spree:migrate_deliveries reads; it is
13
- # dropped in 6.1 once every row has its delivery.
13
+ # dropped in 6.3 once every row has its delivery.
14
14
  add_index :spree_fulfillments, :tracking
15
15
  add_index :spree_fulfillments, :status
16
16
  end
@@ -9,7 +9,7 @@ class AddStoreToSpreeMedia < ActiveRecord::Migration[8.1]
9
9
  # to scope the library index without it.
10
10
  #
11
11
  # Existing rows are filled in by spree:upgrade:backfill_media_store_ids.
12
- # The NOT NULL constraint waits for 6.1, once that task has had a release
12
+ # The NOT NULL constraint waits for 6.3, once that task has had a release
13
13
  # to run everywhere.
14
14
  add_reference :spree_media, :store, index: true
15
15
  end
@@ -32,7 +32,7 @@ class UnifyImportAndExportTenancy < ActiveRecord::Migration[8.1]
32
32
  add_index :spree_imports, [:store_id, :seller_id]
33
33
  add_index :spree_exports, [:store_id, :seller_id]
34
34
 
35
- # `owner_type`/`owner_id` survive to 6.1 as the backfill's source and its
35
+ # `owner_type`/`owner_id` survive to 6.3 as the backfill's source and its
36
36
  # rollback path, and `Import#owner` keeps reading through them for one
37
37
  # release. `null: false` on the new store_id waits for the same release,
38
38
  # once spree:upgrade:backfill_import_export_tenancy has run everywhere.
@@ -1,7 +1,7 @@
1
1
  # Whether tax sits inside a price is the market's setting now, and the column is
2
2
  # read once by `spree:markets:backfill_tax_inclusive`. New rates leave it empty,
3
3
  # so that step, which every later upgrade runs again, never mistakes one for a
4
- # rate whose tax was added on top. The column is dropped in 6.1.
4
+ # rate whose tax was added on top. The column is dropped in 6.3.
5
5
  class RemoveDefaultFromSpreeTaxRatesIncludedInPrice < ActiveRecord::Migration[8.1]
6
6
  def change
7
7
  change_column_default :spree_tax_rates, :included_in_price, from: false, to: nil
@@ -31,7 +31,7 @@ module Spree
31
31
 
32
32
  # @deprecated The 6.0.0 workflow allowlist, kept only so a reference to
33
33
  # it does not break through 6.0.x. Nothing reads it: Admin API
34
- # operations are tools on their own. Removed in 6.1.
34
+ # operations are tools on their own. Removed in 6.3.
35
35
  WORKFLOWS = {
36
36
  # Catalog
37
37
  product_activate_workflow: 'write_products',
@@ -99,7 +99,7 @@ module Spree
99
99
 
100
100
  # @deprecated The 6.0.0 exclusion list, kept like {WORKFLOWS}. Its
101
101
  # reasons now travel as `agent_tool false, reason:` on the operation's
102
- # rswag spec. Removed in 6.1.
102
+ # rswag spec. Removed in 6.3.
103
103
  # The email template editor is a draft-and-publish surface: its steps
104
104
  # move a draft through revisions against a live preview, and they mean
105
105
  # nothing outside that screen. Publishing one sends real mail in the
@@ -19,7 +19,7 @@ module Spree
19
19
  # to record tracking marked the delivery delivered. No endpoint sets a
20
20
  # carrier status, so the name no longer answers rather than doing that.
21
21
  #
22
- # Removed in 6.1, with the names that are no longer listed.
22
+ # Removed in 6.3, with the names that are no longer listed.
23
23
  # See docs/plans/6.0-agent-tools-from-openapi.md.
24
24
  module LegacyTools
25
25
  # Old tool name => the operation it runs and its renamed parameters.
@@ -285,14 +285,14 @@ module Spree
285
285
  include Spree::DependenciesHelper
286
286
 
287
287
  # 6.0 tier rename: these seams resolve Spree::Workflow classes now.
288
- # The old *_service names stay settable and readable one release so
288
+ # The old *_service names stay settable and readable until 6.3 so
289
289
  # applications don't crash at boot — but a legacy write is stashed,
290
290
  # NOT applied to the workflow seam: a class written against the old
291
291
  # service contract is not interchangeable with the workflow the new
292
292
  # call sites consume. Reads return the stashed value (legacy code
293
293
  # calling its own class keeps working), falling back to the workflow
294
294
  # class — safe for legacy callers, whose old keyword vocabulary the
295
- # workflows accept through alias_argument bridges. Removed in 6.1.
295
+ # workflows accept through alias_argument bridges. Removed in 6.3.
296
296
  LEGACY_WORKFLOW_KEYS = {
297
297
  cart_add_item_service: :cart_add_item_workflow,
298
298
  cart_recalculate_service: :cart_recalculate_workflow,
@@ -309,7 +309,7 @@ module Spree
309
309
  # service rename: the new class speaks the fulfillment keyword
310
310
  # vocabulary (still accepting the old shipment keywords with a
311
311
  # warning), but a legacy override written against the old keywords is
312
- # not interchangeable with what the new call sites pass. Removed in 6.1.
312
+ # not interchangeable with what the new call sites pass. Removed in 6.3.
313
313
  LEGACY_SERVICE_KEYS = {
314
314
  shipment_update_service: :fulfillment_update_workflow,
315
315
  fulfillment_update_service: :fulfillment_update_workflow,
@@ -321,7 +321,7 @@ module Spree
321
321
  # Pure renames: the class, its contract and its keyword vocabulary are
322
322
  # unchanged, so unlike LEGACY_WORKFLOW_KEYS an override written against
323
323
  # the old name IS applied — there is nothing incompatible about it.
324
- # Removed in 6.1.
324
+ # Removed in 6.3.
325
325
  RENAMED_SERVICE_KEYS = {
326
326
  checkout_add_store_credit_service: :store_credit_apply_service,
327
327
  checkout_remove_store_credit_service: :store_credit_remove_service
@@ -330,7 +330,7 @@ module Spree
330
330
  RENAMED_SERVICE_KEYS.each do |legacy, current|
331
331
  define_method("#{legacy}=") do |value|
332
332
  Spree::Deprecation.warn(
333
- "Spree::Dependencies##{legacy}= is deprecated and will be removed in Spree 6.1. " \
333
+ "Spree::Dependencies##{legacy}= is deprecated and will be removed in Spree 6.3. " \
334
334
  "Use #{current}= instead."
335
335
  )
336
336
  send("#{current}=", value)
@@ -338,7 +338,7 @@ module Spree
338
338
 
339
339
  define_method(legacy) do
340
340
  Spree::Deprecation.warn(
341
- "Spree::Dependencies##{legacy} is deprecated and will be removed in Spree 6.1. " \
341
+ "Spree::Dependencies##{legacy} is deprecated and will be removed in Spree 6.3. " \
342
342
  "Use #{current} instead."
343
343
  )
344
344
  send(current)
@@ -348,7 +348,7 @@ module Spree
348
348
  # constantized reader too.
349
349
  define_method("#{legacy}_class") do
350
350
  Spree::Deprecation.warn(
351
- "Spree::Dependencies##{legacy} is deprecated and will be removed in Spree 6.1. " \
351
+ "Spree::Dependencies##{legacy} is deprecated and will be removed in Spree 6.3. " \
352
352
  "Use #{current} instead."
353
353
  )
354
354
  send("#{current}_class")
@@ -364,18 +364,18 @@ module Spree
364
364
  Spree::Deprecation.warn(
365
365
  "Spree::Dependencies##{legacy}= is deprecated and NO LONGER CONSULTED by Spree — " \
366
366
  "the override was not applied. Port the class to the #{current} contract and " \
367
- "set #{current}= instead. The #{legacy} name is removed in Spree 6.1."
367
+ "set #{current}= instead. The #{legacy} name is removed in Spree 6.3."
368
368
  )
369
369
  legacy_workflow_overrides[legacy] = value
370
370
  end
371
371
 
372
372
  define_method(legacy) do
373
- Spree::Deprecation.warn("Spree::Dependencies##{legacy} is deprecated and will be removed in Spree 6.1. Use #{current} instead.")
373
+ Spree::Deprecation.warn("Spree::Dependencies##{legacy} is deprecated and will be removed in Spree 6.3. Use #{current} instead.")
374
374
  legacy_workflow_overrides.fetch(legacy) { send(current) }
375
375
  end
376
376
 
377
377
  define_method("#{legacy}_class") do
378
- Spree::Deprecation.warn("Spree::Dependencies##{legacy} is deprecated and will be removed in Spree 6.1. Use #{current} instead.")
378
+ Spree::Deprecation.warn("Spree::Dependencies##{legacy} is deprecated and will be removed in Spree 6.3. Use #{current} instead.")
379
379
  if legacy_workflow_overrides.key?(legacy)
380
380
  value = legacy_workflow_overrides[legacy]
381
381
  value.is_a?(String) ? value.constantize : value