spree_cm_commissioner 2.5.4 → 2.5.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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: de2ded7a346184d8d61336778882795e5b3129f7057eb9b6626042245f580d0c
|
|
4
|
+
data.tar.gz: e6719bc0d87300189d1c02eca3fc3400985379fdce0c7800c813cbe5d24861ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 44c71677f45daa6d92ec91afa436a7bc88798b6931d9a7a75afc40ad5e7691dd7a7ef8c6b7404bcbe3f1875a2a9d321ad918423dda064716bb208f0b0495aa11
|
|
7
|
+
data.tar.gz: d6bdae499df0757db662bade286df901abf2b3f59d7daecef9140ad8cdf2775a17b35c72159b46f5d813c7ec555b3dc97297b6684f4ddee411e96f74d71961ce
|
data/.env.example
CHANGED
|
@@ -31,3 +31,12 @@ ORGANIZER_URL=http://127.0.0.1:4000/organizer
|
|
|
31
31
|
# Use to sign & verify Distance object:
|
|
32
32
|
# spree_cm_commissioner/distance.rb
|
|
33
33
|
DISTANCE_SIGNING_KEY=hei********************VY
|
|
34
|
+
|
|
35
|
+
# Cache durations (in seconds) for different content types
|
|
36
|
+
# See: app/controllers/concerns/spree_cm_commissioner/content_cachable.rb
|
|
37
|
+
CACHE_CDN_MAX_AGE=86400 # CDN/server-side cache duration for all responses
|
|
38
|
+
CACHE_STATIC_MAX_AGE=86400 # Static content (countries, provinces, seat layouts, CMS pages) - 1 day
|
|
39
|
+
CACHE_SEMI_STATIC_MAX_AGE=3600 # Semi-static content (menus, homepage backgrounds, routes) - 1 hour
|
|
40
|
+
CACHE_MODERATE_MAX_AGE=1800 # Moderate freshness (products, events, vendors) - 30 minutes
|
|
41
|
+
CACHE_REALTIME_MAX_AGE=300 # High freshness (trips, trip search) - 5 minutes
|
|
42
|
+
CACHE_DEFAULT_MAX_AGE=300 # Default for unlisted controllers - 5 minutes
|
data/Gemfile.lock
CHANGED
|
@@ -58,6 +58,26 @@ module Spree
|
|
|
58
58
|
flash[:success] = "Successfully updated stocks for #{inventory_items.count} items"
|
|
59
59
|
redirect_back fallback_location: admin_product_stock_managements_path(@product)
|
|
60
60
|
end
|
|
61
|
+
|
|
62
|
+
# PATCH /products/:slug/inventory_items/bulk_reset?inventory_ids=1,2,3
|
|
63
|
+
def bulk_reset
|
|
64
|
+
inventory_ids = params[:inventory_ids].to_s.split(',').map(&:to_i)
|
|
65
|
+
inventory_items = @product.inventory_items.where(id: inventory_ids)
|
|
66
|
+
|
|
67
|
+
errors = []
|
|
68
|
+
inventory_items.each do |inventory_item|
|
|
69
|
+
result = SpreeCmCommissioner::Stock::InventoryItemResetter.call(inventory_item: inventory_item)
|
|
70
|
+
errors << result.message unless result.success?
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
if errors.empty?
|
|
74
|
+
flash[:success] = "Successfully reset inventory items (#{inventory_items.count})"
|
|
75
|
+
else
|
|
76
|
+
flash[:error] = errors.join(', ')
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
redirect_back fallback_location: admin_product_stock_managements_path(@product)
|
|
80
|
+
end
|
|
61
81
|
end
|
|
62
82
|
end
|
|
63
83
|
end
|
|
@@ -37,19 +37,6 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
<% end if can?(:update, @product) && can?(:update, variant) %>
|
|
39
39
|
|
|
40
|
-
<% if defined?(@reserved_stocks) %>
|
|
41
|
-
<div>
|
|
42
|
-
<%= svg_icon name: "cart-check.svg", width: '14', height: '14' %>
|
|
43
|
-
<%= label_tag "reserved_stock#{variant.id}", "Reserved Stock: #{@reserved_stocks[variant.id] || 0}", class: "m-0" %>
|
|
44
|
-
<%= link_to_with_icon('capture.svg', "Create Inventory Item", admin_product_inventory_items_path(@product.slug, variant_id: variant.id),
|
|
45
|
-
method: :post,
|
|
46
|
-
remote: false,
|
|
47
|
-
class: 'icon_link btn btn-sm btn-outline-primary ml-2',
|
|
48
|
-
no_text: true
|
|
49
|
-
) unless @inventory_items[variant.id].present? %>
|
|
50
|
-
</div>
|
|
51
|
-
<% end %>
|
|
52
|
-
|
|
53
40
|
<% if variant.permanent_stock? %>
|
|
54
41
|
<div>
|
|
55
42
|
<span type="button" data-toggle="popover" data-trigger="hover" data-placement="right" data-content="This product stock will renew every day">
|
|
@@ -78,7 +65,7 @@
|
|
|
78
65
|
<% end %>
|
|
79
66
|
</span>
|
|
80
67
|
|
|
81
|
-
<%= link_to_with_icon('arrow-counterclockwise.svg', "Reset Inventory Item",
|
|
68
|
+
<%= link_to_with_icon('arrow-counterclockwise.svg', "Reset Inventory Item", bulk_reset_admin_product_inventory_items_path(@product.slug, inventory_item_ids: [inventory_item.id]),
|
|
82
69
|
method: :patch,
|
|
83
70
|
remote: false,
|
|
84
71
|
class: 'icon_link btn btn-sm outline text-dark',
|
data/config/routes.rb
CHANGED
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.5.
|
|
4
|
+
version: 2.5.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- You
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-01-
|
|
11
|
+
date: 2026-01-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: spree
|