spree_cm_commissioner 2.12.1 → 2.12.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91f4f80720e207b672673f48cdfbf75d0efeaba681a61a7177c537c8741d5ccf
4
- data.tar.gz: af1ca6770a66095ff54bf84dcb2840fa0a5c6578de079e8679cd28307182bc20
3
+ metadata.gz: 518b50594502cdd95eb7710824cb6f8a104974d44e9602f2babb3235bcc17559
4
+ data.tar.gz: 4906dc6a8f57707ebf5fcb9712b6a074bbef1af0437e14923f61f2ff6606c32e
5
5
  SHA512:
6
- metadata.gz: 86639ec7ba1a728feaa59ed52ddf25e02687988611ff687ede1d0a8af1eb86590a26f95585a5f793ae549193cc2caa6aadee71fe6f0d5b51cdaa58b26437aebe
7
- data.tar.gz: abae4f7a29cbe9f9963b682eb68c27f1dc77320a4495832da75d3ced6db2f8438a0c78b017362d49b21bdb800e1f78762eb03ce3122ce0834062a118ec6510f3
6
+ metadata.gz: 67a54630258eda9e5bf72e26ce22177d6b1ce8da399d71434319403f1df8d4a71469ec115f7015b7b9064544688fe833f3230329e456e09eeb88b4f8a488212c
7
+ data.tar.gz: 6aa524ac8653f151fd629c4bef58258212ee3eb67f5f1bba328f7e3e964c4efb9f67ec9692c359c80f4b2d8abac088541b7b692503d02bb8afecedc21e550072
data/Gemfile.lock CHANGED
@@ -34,7 +34,7 @@ GIT
34
34
  PATH
35
35
  remote: .
36
36
  specs:
37
- spree_cm_commissioner (2.12.1)
37
+ spree_cm_commissioner (2.12.2)
38
38
  activerecord-multi-tenant
39
39
  activerecord_json_validator (~> 2.1, >= 2.1.3)
40
40
  aws-sdk-cloudfront
@@ -195,18 +195,10 @@ module SpreeCmCommissioner
195
195
  end
196
196
  end
197
197
 
198
- # override
199
- # [spree_core] only checks active?/deleted?, so a scheduled product (available_on in the future)
200
- # reports available even though it isn't purchasable yet. Since Variant#available? delegates
201
- # here, this closes the gap for every caller (cart, checkout, Stock::AvailabilityChecker) in
202
- # one place — mirrors VariantDecorator#discontinued?'s window check.
203
- def available?
204
- return false unless active?
205
- return false if deleted?
206
- return false if discontinued?
207
- return false if available_on.present? && available_on > Time.current
208
-
209
- true
198
+ # Not yet on sale. Kept separate from available? so a scheduled product's real stock still
199
+ # shows via in_stock? Stock::AvailabilityValidatorDecorator checks this to block add-to-cart.
200
+ def scheduled?
201
+ available_on.present? && available_on > Time.current
210
202
  end
211
203
 
212
204
  private
@@ -15,6 +15,11 @@ module SpreeCmCommissioner
15
15
  # skipping it here means we never even build a checker for them.
16
16
  return if line_item.order&.ticket_transfer?
17
17
 
18
+ # scheduled? isn't checked anywhere else (product.available?/variant.discontinued? are, via
19
+ # can_supply? below) — a scheduled product must still read in_stock? true, so its sale
20
+ # window is enforced here instead.
21
+ return add_inactive_product_error(line_item) if !line_item.product.available? || line_item.product.scheduled?
22
+
18
23
  checker = SpreeCmCommissioner::Stock::LineItemAvailabilityChecker.new(line_item).checker
19
24
  return if checker.can_supply?(quantity)
20
25
 
@@ -497,6 +497,7 @@ en:
497
497
  # Overrides Spree core's "selected of %{item} is not available." Must stay under
498
498
  # `spree:` -- Spree::Stock::AvailabilityValidator looks it up as Spree.t(:selected_quantity_not_available).
499
499
  selected_quantity_not_available: "Sorry, not enough %{item} left. Please choose fewer or try again in a few minutes."
500
+ only_active_products_can_be_added_to_cart: "Sorry, this product isn't available for purchase right now."
500
501
  auto_apply: "Auto apply"
501
502
  auto_apply_info: "Path & code will be removed"
502
503
  transit:
@@ -769,11 +770,11 @@ en:
769
770
  attributes:
770
771
  base:
771
772
  last_contestant_in_parent_session: 'cannot remove the last contestant from "%{session_name}" because child sessions depend on it'
772
- advanced_from_session: 'was advanced from a previous session and cannot be removed directly. Clear the advancement in the source session instead.'
773
- pre_vote_session: 'cannot be removed from a pre-vote session.'
774
- has_advanced_to_session: 'has been assigned to advance to another session. Clear the advancement first before removing this contestant.'
773
+ advanced_from_session: "was advanced from a previous session and cannot be removed directly. Clear the advancement in the source session instead."
774
+ pre_vote_session: "cannot be removed from a pre-vote session."
775
+ has_advanced_to_session: "has been assigned to advance to another session. Clear the advancement first before removing this contestant."
775
776
  advanced_to_id:
776
- same_as_advanced_from: 'cannot be the same as the contestant it was advanced from'
777
+ same_as_advanced_from: "cannot be the same as the contestant it was advanced from"
777
778
  spree_cm_commissioner/voting_credit:
778
779
  attributes:
779
780
  free_votes_amount:
@@ -403,6 +403,7 @@ km:
403
403
  upsupported_payment: "មិនស្គាល់ការបង់ប្រាក់"
404
404
  selected_item_not_available_on_date: "Selected item not available on %{date}"
405
405
  selected_quantity_not_available: "សូមអភ័យទោស %{item} នៅសល់មិនគ្រប់គ្រាន់។ សូមរើសចំនួនតិច ឬព្យាយាមម្តងទៀត។"
406
+ only_active_products_can_be_added_to_cart: "សូមអភ័យទោស ទំនិញនេះមិនទាន់អាចទិញបានទេនៅពេលនេះ។"
406
407
  auto_apply: "ដាក់ប្រើដោយស្វ័យប្រវត្តិ"
407
408
  auto_apply_info: "Path & code will be removed"
408
409
  device_tokens: "Device Tokens"
@@ -1,5 +1,5 @@
1
1
  module SpreeCmCommissioner
2
- VERSION = '2.12.1'.freeze
2
+ VERSION = '2.12.2'.freeze
3
3
 
4
4
  module_function
5
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_cm_commissioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.1
4
+ version: 2.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - You
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-28 00:00:00.000000000 Z
11
+ date: 2026-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree