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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3fd2c90bbaae526fa142b83741b54f05088e5f257445fcd1fb8f1848aa4e5962
|
|
4
|
+
data.tar.gz: 5d0c437dc6da1c51576d06e8cd5cfb80bffc9faa79802aef8b7ac11dd3e590a0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6dafc95c2bd6d4733b9a2912faa109c1da958bf0531f8536382bebd34c526fef4fdebf73b8408afa54a9348c060abd5b05072c0f2b8b59baf555f96b2d51566e
|
|
7
|
+
data.tar.gz: 8ab18278b04a39096144422f64957d73762fe60d268db4314d278b5121f59b007b748937b5864a7533b9bb18884573bf784143a1ef800b9014944ffbdf311d0e
|
data/Gemfile.lock
CHANGED
|
@@ -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
|
|
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
|
-
#
|
|
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
|
-
|
|
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
|