spree_cm_commissioner 2.3.0.pre.pre8 → 2.3.0.pre.pre10

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: 2f34833e624dbc5f5d7386db45173842d1ec05bcf55d4bef0510af1a998fc383
4
- data.tar.gz: 6b08e67cf9b33f19fad0c5de0e143054d89343074036d94e8f94e227db21338e
3
+ metadata.gz: 3fd2c90bbaae526fa142b83741b54f05088e5f257445fcd1fb8f1848aa4e5962
4
+ data.tar.gz: 5d0c437dc6da1c51576d06e8cd5cfb80bffc9faa79802aef8b7ac11dd3e590a0
5
5
  SHA512:
6
- metadata.gz: 7703ce9a2409a83d4d645de74101e10a34827b673eaebde07eaebde82c11b277b918f397f1c42a8c382af4d09580eec8bde53ad0e2c51c6616414759121736f8
7
- data.tar.gz: 28d97a9ac0f5e4de02db09c9c38fcd9a6848e163578d0139403ae550d9945ab310c87c66261445bb235fdf26270508e5e4445c685807ecbb450f8d38a0df55a4
6
+ metadata.gz: 6dafc95c2bd6d4733b9a2912faa109c1da958bf0531f8536382bebd34c526fef4fdebf73b8408afa54a9348c060abd5b05072c0f2b8b59baf555f96b2d51566e
7
+ data.tar.gz: 8ab18278b04a39096144422f64957d73762fe60d268db4314d278b5121f59b007b748937b5864a7533b9bb18884573bf784143a1ef800b9014944ffbdf311d0e
data/Gemfile.lock CHANGED
@@ -34,7 +34,7 @@ GIT
34
34
  PATH
35
35
  remote: .
36
36
  specs:
37
- spree_cm_commissioner (2.3.0.pre.pre8)
37
+ spree_cm_commissioner (2.3.0.pre.pre10)
38
38
  activerecord-multi-tenant
39
39
  activerecord_json_validator (~> 2.1, >= 2.1.3)
40
40
  aws-sdk-cloudfront
@@ -1,14 +1,14 @@
1
1
  module SpreeCmCommissioner
2
2
  module Seats
3
3
  class BlocksHolder
4
- HOLD_DURATION = 8.minutes
4
+ HOLD_DURATION = ENV.fetch('HOLD_DURATION_IN_MINUTES', '8').to_i.minutes
5
5
 
6
6
  def initialize(line_item_ids:, hold_by: nil)
7
7
  @line_item_ids = line_item_ids
8
8
  @hold_by = hold_by
9
9
  end
10
10
 
11
- # Hold blocks for the given line items, preventing dublicate block selection.
11
+ # Hold blocks for the given line items, preventing duplicate block selection.
12
12
  #
13
13
  # It ensures:
14
14
  # - Raises an error if already reserved.
@@ -1,11 +1,25 @@
1
1
  module SpreeCmCommissioner
2
2
  module Checkout
3
3
  module UpdateDecorator
4
- # override
4
+ # Override to:
5
+ # 1. Validate line items are in stock before updating address
6
+ # 2. Skip automatic state transitions (lines 17-18 commented out)
7
+ # State changes are handled by the advance action, not update
5
8
  def call(order:, params:, permitted_attributes:, request_env:)
6
9
  return failure(order) unless order.ensure_line_items_are_in_stock
7
10
 
8
- super
11
+ ship_changed = address_with_country_iso_present?(params, 'ship')
12
+ bill_changed = address_with_country_iso_present?(params, 'bill')
13
+
14
+ params[:order][:ship_address_attributes] = replace_country_iso_with_id(params[:order][:ship_address_attributes]) if ship_changed
15
+ params[:order][:bill_address_attributes] = replace_country_iso_with_id(params[:order][:bill_address_attributes]) if bill_changed
16
+
17
+ # order.state = 'address' if (ship_changed || bill_changed) && order.has_checkout_step?('address')
18
+ # order.state = 'delivery' if selected_shipping_rate_present?(params) && order.has_checkout_step?('delivery')
19
+
20
+ return success(order) if order.update_from_params(params, permitted_attributes, request_env)
21
+
22
+ failure(order)
9
23
  end
10
24
  end
11
25
  end
@@ -1,5 +1,5 @@
1
1
  module SpreeCmCommissioner
2
- VERSION = '2.3.0-pre8'.freeze
2
+ VERSION = '2.3.0-pre10'.freeze
3
3
 
4
4
  module_function
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_cm_commissioner
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0.pre.pre8
4
+ version: 2.3.0.pre.pre10
5
5
  platform: ruby
6
6
  authors:
7
7
  - You