spree_cm_commissioner 2.5.0.pre.pre7 → 2.5.0.pre.pre8

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 (100) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test_and_build_gem.yml +1 -1
  3. data/.tool-versions +1 -1
  4. data/Gemfile.lock +1 -1
  5. data/app/controllers/spree/api/v2/storefront/popular_route_places_controller.rb +7 -1
  6. data/app/controllers/spree/api/v2/storefront/route_places_controller.rb +9 -9
  7. data/app/finders/spree_cm_commissioner/places/find_with_route.rb +10 -10
  8. data/app/finders/spree_cm_commissioner/routes/find_popular.rb +10 -14
  9. data/app/interactors/spree_cm_commissioner/stock/inventory_item_resetter.rb +1 -1
  10. data/app/jobs/spree_cm_commissioner/stock/inventory_items_adjuster_job.rb +3 -3
  11. data/app/models/concerns/spree_cm_commissioner/option_type_attr_type.rb +3 -15
  12. data/app/models/concerns/spree_cm_commissioner/order_state_machine.rb +0 -2
  13. data/app/models/concerns/spree_cm_commissioner/store_metadata.rb +2 -14
  14. data/app/models/concerns/spree_cm_commissioner/tenant_preference.rb +3 -0
  15. data/app/models/concerns/spree_cm_commissioner/variant_options_concern.rb +7 -1
  16. data/app/models/spree_cm_commissioner/guest.rb +0 -13
  17. data/app/models/spree_cm_commissioner/inventory_item.rb +1 -5
  18. data/app/models/spree_cm_commissioner/line_item_decorator.rb +1 -13
  19. data/app/models/spree_cm_commissioner/option_type_decorator.rb +0 -8
  20. data/app/models/spree_cm_commissioner/option_value_decorator.rb +0 -34
  21. data/app/models/spree_cm_commissioner/order_decorator.rb +0 -1
  22. data/app/models/spree_cm_commissioner/product_decorator.rb +2 -3
  23. data/app/models/spree_cm_commissioner/redis_stock/cached_inventory_items_builder.rb +2 -2
  24. data/app/models/spree_cm_commissioner/redis_stock/inventory_updater.rb +2 -2
  25. data/app/models/spree_cm_commissioner/taxon_decorator.rb +0 -1
  26. data/app/models/spree_cm_commissioner/taxonomy_decorator.rb +1 -13
  27. data/app/models/spree_cm_commissioner/variant_decorator.rb +4 -7
  28. data/app/models/spree_cm_commissioner/vendor_decorator.rb +0 -4
  29. data/app/presenters/spree/variants/{visible_options_presenter.rb → visable_options_presenter.rb} +4 -2
  30. data/app/request_schemas/spree_cm_commissioner/popular_route_places_request_schema.rb +12 -0
  31. data/app/request_schemas/spree_cm_commissioner/route_places_request_schema.rb +5 -0
  32. data/app/views/spree/admin/tenants/_form.html.erb +18 -0
  33. data/app/views/spree/admin/tenants/form/_footer.html.erb +31 -0
  34. data/app/views/spree/admin/tenants/form/_social.html.erb +31 -0
  35. data/app/views/spree/order_mailer/confirm_email.html.erb +1 -1
  36. data/app/views/spree_cm_commissioner/layouts/order_mailer.html.erb +1 -1
  37. data/app/views/spree_cm_commissioner/order_mailer/tenant/_footer.html.erb +13 -6
  38. data/app/views/spree_cm_commissioner/order_mailer/tenant/_support_contact.html.erb +23 -24
  39. data/config/locales/en.yml +0 -8
  40. data/config/locales/km.yml +0 -8
  41. data/config/routes.rb +0 -8
  42. data/db/migrate/20251209022924_add_contact_fields_to_cm_tenants.rb +9 -0
  43. data/lib/cm_app_logger.rb +3 -21
  44. data/lib/spree_cm_commissioner/version.rb +1 -1
  45. data/lib/spree_cm_commissioner.rb +7 -8
  46. metadata +7 -57
  47. data/app/controllers/spree/admin/integration_mappings_controller.rb +0 -21
  48. data/app/controllers/spree/admin/integration_sessions_controller.rb +0 -21
  49. data/app/controllers/spree/admin/integrations_controller.rb +0 -83
  50. data/app/controllers/spree/api/v2/storefront/event_matches_controller.rb +0 -15
  51. data/app/errors/spree_cm_commissioner/integrations/external_client_error.rb +0 -10
  52. data/app/errors/spree_cm_commissioner/integrations/sync_error.rb +0 -4
  53. data/app/finders/spree_cm_commissioner/events/find_matches.rb +0 -15
  54. data/app/helpers/spree_cm_commissioner/external_integrations_helper.rb +0 -58
  55. data/app/jobs/spree_cm_commissioner/integrations/base_job.rb +0 -39
  56. data/app/jobs/spree_cm_commissioner/integrations/polling_job.rb +0 -53
  57. data/app/jobs/spree_cm_commissioner/integrations/polling_scheduler_job.rb +0 -30
  58. data/app/jobs/spree_cm_commissioner/telegram_alerts/integration_sync_failure_job.rb +0 -17
  59. data/app/models/concerns/spree_cm_commissioner/integrations/integration_mappable.rb +0 -61
  60. data/app/models/concerns/spree_cm_commissioner/line_item_integration.rb +0 -36
  61. data/app/models/concerns/spree_cm_commissioner/order_integration.rb +0 -33
  62. data/app/models/spree_cm_commissioner/integration.rb +0 -29
  63. data/app/models/spree_cm_commissioner/integration_mapping.rb +0 -41
  64. data/app/models/spree_cm_commissioner/integration_sync_session.rb +0 -15
  65. data/app/models/spree_cm_commissioner/integrations/stadium_x_v1.rb +0 -37
  66. data/app/overrides/spree/admin/shared/sub_menu/_integrations/external_integrations.html.erb.deface +0 -6
  67. data/app/services/spree_cm_commissioner/integrations/base/sync_manager.rb +0 -69
  68. data/app/services/spree_cm_commissioner/integrations/base/sync_result.rb +0 -183
  69. data/app/services/spree_cm_commissioner/integrations/polling.rb +0 -70
  70. data/app/services/spree_cm_commissioner/integrations/polling_scheduler.rb +0 -79
  71. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/external_client/client.rb +0 -152
  72. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/inventory/unstock_inventory.rb +0 -83
  73. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/polling/sync_matches.rb +0 -113
  74. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/polling/sync_zones.rb +0 -215
  75. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/base.rb +0 -20
  76. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/league.rb +0 -19
  77. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/match.rb +0 -95
  78. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket.rb +0 -81
  79. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/ticket_image.rb +0 -19
  80. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/resources/zone.rb +0 -90
  81. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_manager.rb +0 -35
  82. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_strategies/full_sync_strategy.rb +0 -38
  83. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_strategies/incremental_sync_strategy.rb +0 -44
  84. data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/sync_strategies/webhook_sync_strategy.rb +0 -16
  85. data/app/services/spree_cm_commissioner/telegram_alerts/integration_sync_failure.rb +0 -49
  86. data/app/views/spree/admin/integration_mappings/_integration_mappings.html.erb +0 -107
  87. data/app/views/spree/admin/integration_mappings/index.html.erb +0 -33
  88. data/app/views/spree/admin/integration_sessions/_integration_sync_sessions.html.erb +0 -116
  89. data/app/views/spree/admin/integration_sessions/index.html.erb +0 -42
  90. data/app/views/spree/admin/integrations/_form.html.erb +0 -104
  91. data/app/views/spree/admin/integrations/_stadium_x_v1_fields.html.erb +0 -29
  92. data/app/views/spree/admin/integrations/edit.html.erb +0 -45
  93. data/app/views/spree/admin/integrations/index.html.erb +0 -75
  94. data/app/views/spree/admin/integrations/new.html.erb +0 -25
  95. data/db/migrate/20251017094845_create_cm_integrations.rb +0 -22
  96. data/db/migrate/20251017101555_create_cm_integration_sync_sessions.rb +0 -68
  97. data/db/migrate/20251017101605_create_cm_integration_mappings.rb +0 -52
  98. data/lib/spree_cm_commissioner/test_helper/factories/integration_factory.rb +0 -25
  99. data/lib/spree_cm_commissioner/test_helper/factories/integration_mapping_factory.rb +0 -14
  100. data/lib/spree_cm_commissioner/test_helper/factories/integration_sync_session_factory.rb +0 -7
@@ -5,7 +5,6 @@ module SpreeCmCommissioner
5
5
  base.include SpreeCmCommissioner::ProductDelegation
6
6
  base.include SpreeCmCommissioner::VariantOptionsConcern
7
7
  base.include SpreeCmCommissioner::KycBitwise
8
- base.include SpreeCmCommissioner::Integrations::IntegrationMappable
9
8
 
10
9
  base.after_commit :update_vendor_price
11
10
  base.validate :validate_option_types
@@ -17,6 +16,10 @@ module SpreeCmCommissioner
17
16
  base.has_one :vehicle, class_name: 'SpreeCmCommissioner::Vehicle', through: :trip
18
17
 
19
18
  base.has_many :taxons, class_name: 'Spree::Taxon', through: :product
19
+ base.has_many :visible_option_values, lambda {
20
+ joins(:option_type).where(spree_option_types: { hidden: false })
21
+ }, through: :option_value_variants, source: :option_value
22
+
20
23
  base.has_many :video_on_demands, class_name: 'SpreeCmCommissioner::VideoOnDemand', dependent: :destroy
21
24
  base.has_many :complete_line_items, -> { complete }, class_name: 'Spree::LineItem'
22
25
 
@@ -39,12 +42,6 @@ module SpreeCmCommissioner
39
42
  base.before_validation -> { self.product_type = product.product_type }, if: -> { product_type.nil? }
40
43
  end
41
44
 
42
- # Override variant.rb to return cached formatted options text, avoiding repeated database queries.
43
- # Falls back to database queries & computing the format if preload data is unavailable.
44
- def options_text
45
- public_metadata[:preload_options_text].presence || Spree::Variants::VisibleOptionsPresenter.new(self).to_sentence
46
- end
47
-
48
45
  def delivery_required?
49
46
  delivery_option == 'delivery'
50
47
  end
@@ -9,7 +9,6 @@ module SpreeCmCommissioner
9
9
  base.include SpreeCmCommissioner::VendorPreference
10
10
  base.include SpreeCmCommissioner::TenantUpdatable
11
11
  base.include SpreeCmCommissioner::StoreMetadata
12
- base.include SpreeCmCommissioner::Integrations::IntegrationMappable
13
12
 
14
13
  base.attr_accessor :service_availabilities
15
14
 
@@ -40,9 +39,6 @@ module SpreeCmCommissioner
40
39
  base.has_many :vendor_kind_option_values,
41
40
  through: :option_value_vendors, source: :option_value
42
41
 
43
- # currently a vendor can have only one integration, but in future it can be many.
44
- base.has_one :integration, class_name: 'SpreeCmCommissioner::Integration', dependent: :destroy, inverse_of: :vendor
45
-
46
42
  base.has_many :branches, -> { branch }, class_name: 'SpreeCmCommissioner::VendorPlace'
47
43
  base.has_many :stops, -> { stop }, class_name: 'SpreeCmCommissioner::VendorPlace'
48
44
  base.has_many :locations, -> { location }, class_name: 'SpreeCmCommissioner::VendorPlace'
@@ -1,9 +1,11 @@
1
1
  module Spree
2
2
  module Variants
3
- class VisibleOptionsPresenter < OptionsPresenter
3
+ class VisableOptionsPresenter < OptionsPresenter
4
+ delegate :visible_option_values, to: :variant
5
+
4
6
  # override
5
7
  def to_sentence
6
- options = variant.option_values.reject { |ov| ov.option_type.hidden? }
8
+ options = visible_option_values
7
9
  options = sort_options(options)
8
10
  options = present_options(options)
9
11
 
@@ -0,0 +1,12 @@
1
+ module SpreeCmCommissioner
2
+ class PopularRoutePlacesRequestSchema < ApplicationRequestSchema
3
+ params do
4
+ optional(:query).maybe(:string)
5
+ optional(:route_type).maybe(:string)
6
+ end
7
+ route_types = SpreeCmCommissioner::RouteType::ROUTE_TYPES.map(&:to_s)
8
+ rule(:route_type) do
9
+ key.failure("Invalid route_type. Use #{route_types}") if value.present? && route_types.exclude?(value)
10
+ end
11
+ end
12
+ end
@@ -6,6 +6,11 @@ module SpreeCmCommissioner
6
6
  optional(:place_id).maybe(:integer)
7
7
  optional(:route_type).maybe(:string)
8
8
  end
9
+ route_types = SpreeCmCommissioner::RouteType::ROUTE_TYPES.map(&:to_s)
10
+
11
+ rule(:route_type) do
12
+ key.failure("Invalid route_type. Use #{route_types}") if value.present? && route_types.exclude?(value)
13
+ end
9
14
 
10
15
  rule(:place_type) do
11
16
  key.failure('Invalid place_type. Use origin or destination') unless %w[origin destination].include?(value)
@@ -74,6 +74,8 @@
74
74
  <%= content_tag :div, nil, style: "background-color: #{@object.preferred_brand_primary_color}; width: 60px; height: 60px; border: 1px solid #ccc; box-sizing: border-box; display: block;" %>
75
75
  </div>
76
76
  </div>
77
+
78
+ <!-- Assetlinks Field -->
77
79
  <div class="col-12">
78
80
  <%= f.field_container :preferred_assetlinks do %>
79
81
  <%= f.label :preferred_assetlinks, raw(Spree.t(:assetlinks)) %>
@@ -182,6 +184,22 @@
182
184
  </div>
183
185
  </div>
184
186
 
187
+ <!-- ======================== Footer ======================== -->
188
+ <div class="card mb-4">
189
+ <div class="card-body">
190
+ <div data-hook="admin_tenant_form_fields" class="row mt-4">
191
+ <div class="col-12 mb-4">
192
+ <h4>Footer <span class="text-muted" style="font-size: 1rem; font-weight: normal;">(Footer is for customer support details and tenant address)</span></h4>
193
+ </div>
194
+ <!-- Footer Field -->
195
+ <div class="col-12">
196
+ <%= render partial: 'spree/admin/tenants/form/footer', locals: { f: f } %>
197
+ <%= render partial: 'spree/admin/tenants/form/social', locals: { f: f } %>
198
+ </div>
199
+ </div>
200
+ </div>
201
+ </div>
202
+
185
203
  <!-- ======================== Redirect Settings ======================== -->
186
204
  <div class="card mb-4">
187
205
  <div class="card-body">
@@ -0,0 +1,31 @@
1
+ <div data-hook="admin_tenant_support_fields" class="row">
2
+ <div class="col-6">
3
+ <%= f.field_container :customer_support_email do %>
4
+ <%= f.label :customer_support_email, 'Customer support email' %>
5
+ <%= f.email_field :customer_support_email, class: 'form-control', placeholder: 'support@example.com' %>
6
+ <% if f.object.errors[:customer_support_email].any? %>
7
+ <div class="error text-danger"><%= f.object.errors[:customer_support_email].join(', ') %></div>
8
+ <% end %>
9
+ <% end %>
10
+ </div>
11
+
12
+ <div class="col-6">
13
+ <%= f.field_container :contact_phone do %>
14
+ <%= f.label :contact_phone, 'Contact phone' %>
15
+ <%= f.telephone_field :contact_phone, class: 'form-control', placeholder: '+855 12 345 678' %>
16
+ <% if f.object.errors[:contact_phone].any? %>
17
+ <div class="error text-danger"><%= f.object.errors[:contact_phone].join(', ') %></div>
18
+ <% end %>
19
+ <% end %>
20
+ </div>
21
+
22
+ <div class="col-12 mt-3">
23
+ <%= f.field_container :address do %>
24
+ <%= f.label :address, 'Address' %>
25
+ <%= f.text_area :address, class: 'form-control', rows: 3, placeholder: 'Store address' %>
26
+ <% if f.object.errors[:address].any? %>
27
+ <div class="error text-danger"><%= f.object.errors[:address].join(', ') %></div>
28
+ <% end %>
29
+ <% end %>
30
+ </div>
31
+ </div>
@@ -0,0 +1,31 @@
1
+ <div data-hook="admin_tenant_social_fields" class="row">
2
+ <div class="col-4">
3
+ <%= f.field_container :preferred_facebook do %>
4
+ <%= f.label :preferred_facebook, 'Facebook URL' %>
5
+ <%= f.url_field :preferred_facebook, class: 'form-control', placeholder: 'https://facebook.com/yourpage' %>
6
+ <% if f.object.errors[:preferred_facebook].any? %>
7
+ <div class="error text-danger"><%= f.object.errors[:preferred_facebook].join(', ') %></div>
8
+ <% end %>
9
+ <% end %>
10
+ </div>
11
+
12
+ <div class="col-4">
13
+ <%= f.field_container :preferred_twitter do %>
14
+ <%= f.label :preferred_twitter, 'Twitter URL' %>
15
+ <%= f.url_field :preferred_twitter, class: 'form-control', placeholder: 'https://twitter.com/yourhandle' %>
16
+ <% if f.object.errors[:preferred_twitter].any? %>
17
+ <div class="error text-danger"><%= f.object.errors[:preferred_twitter].join(', ') %></div>
18
+ <% end %>
19
+ <% end %>
20
+ </div>
21
+
22
+ <div class="col-4">
23
+ <%= f.field_container :preferred_instagram do %>
24
+ <%= f.label :preferred_instagram, 'Instagram URL' %>
25
+ <%= f.url_field :preferred_instagram, class: 'form-control', placeholder: 'https://instagram.com/youraccount' %>
26
+ <% if f.object.errors[:preferred_instagram].any? %>
27
+ <div class="error text-danger"><%= f.object.errors[:preferred_instagram].join(', ') %></div>
28
+ <% end %>
29
+ <% end %>
30
+ </div>
31
+ </div>
@@ -21,7 +21,7 @@
21
21
  <%= render 'spree_cm_commissioner/order_mailer/order_total', order: @order %>
22
22
  <%= render 'spree_cm_commissioner/order_mailer/your_booking', order: @order, show_booking_header: true %>
23
23
  <%= render 'spree_cm_commissioner/order_mailer/tenant/customer_info', order: @order %>
24
- <%= render 'spree_cm_commissioner/order_mailer/tenant/support_contact' %>
24
+ <%= render 'spree_cm_commissioner/order_mailer/tenant/support_contact', order: @order, name: @name%>
25
25
  </div>
26
26
  </div>
27
27
  <% end %>
@@ -26,7 +26,7 @@
26
26
  <% if @order.tenant.nil? %>
27
27
  <%= render 'spree_cm_commissioner/order_mailer/footer', store: @order.store %>
28
28
  <% else %>
29
- <%= render 'spree_cm_commissioner/order_mailer/tenant/footer', store: @order.store %>
29
+ <%= render 'spree_cm_commissioner/order_mailer/tenant/footer', tenant: @order.tenant %>
30
30
  <% end %>
31
31
  </td>
32
32
  </tr>
@@ -1,24 +1,31 @@
1
1
  <div class="email-footer_inner">
2
- <div class="mb-24"><%= store.description%></div>
3
- <div class="mb-24 f-14"><%= store.address%></div>
2
+ <div class="mb-24"><%= tenant&.description %></div>
3
+ <div class="mb-24 f-14"><%= tenant&.address %></div>
4
4
  <h2 class="mb-24">Connect with us</h2>
5
5
  <table class="mb-24 social_icons">
6
6
  <tbody>
7
7
  <tr>
8
- <% if store.facebook? %>
8
+ <% if tenant&.preferred_facebook.present? %>
9
9
  <td class="social_icon">
10
- <%= link_to store.facebook, target: :_blank do %>
10
+ <%= link_to tenant.preferred_facebook, target: :_blank do %>
11
11
  <%= image_tag "mailer/facebook.png", class: "mail-icon"%>
12
12
  <% end %>
13
13
  </td>
14
14
  <% end %>
15
- <% if store.instagram?%>
15
+ <% if tenant&.preferred_instagram.present? %>
16
16
  <td class="social_icon">
17
- <%= link_to store.instagram, target: :_blank do %>
17
+ <%= link_to tenant.preferred_instagram, target: :_blank do %>
18
18
  <%= image_tag "mailer/instagram.png", class: "mail-icon"%>
19
19
  <% end %>
20
20
  </td>
21
21
  <% end %>
22
+ <% if tenant&.preferred_twitter.present? %>
23
+ <td class="social_icon">
24
+ <%= link_to tenant.preferred_twitter, target: :_blank do %>
25
+ <%= image_tag "mailer/twitter.png", class: "mail-icon"%>
26
+ <% end %>
27
+ </td>
28
+ <% end %>
22
29
  </tr>
23
30
  </tbody>
24
31
  </table>
@@ -1,33 +1,32 @@
1
1
  <div class="content-cell">
2
- <div class="container">
3
- <h2><%= I18n.t('mail.order_mailer.bookmeplus_support')%></h2>
4
- <div class="flex two-columns">
5
- <div class="two-columns-item">
6
- <div class="flex two-columns-item_detail">
7
- <div class="two-columns_icon"><%= image_tag "mailer/tenant_phone.png", class: "mail-icon"%></div>
8
- <div class="two-columns_text-container">
9
- <p class="two-columns_title">Contact</p>
10
- <% if @order.store.contact_phone.present? %>
11
- <p class="two-columns_description">
12
- <%= link_to @order.store.contact_phone, "tel:#{@order.store.contact_phone}" %>
13
- </p>
14
- <% end %>
2
+ <div class="container">
3
+ <h2><%= name %> Support</h2>
4
+ <div class="flex two-columns">
5
+ <div class="two-columns-item">
6
+ <div class="flex two-columns-item_detail">
7
+ <div class="two-columns_icon"><%= image_tag "mailer/tenant_phone.png", class: "mail-icon"%></div>
8
+ <div class="two-columns_text-container">
9
+ <p class="two-columns_title">Contact</p>
10
+ <% if order&.tenant&.contact_phone&.present? %>
11
+ <p class="two-columns_description">
12
+ <%= link_to order.tenant.contact_phone, "tel:#{order.tenant.contact_phone}" %>
13
+ </p>
14
+ <% end %>
15
+ </div>
15
16
  </div>
16
17
  </div>
17
- </div>
18
- <div class="vertical-separater"></div>
19
- <div class="two-columns-item">
20
- <div class="flex two-columns-item_detail">
21
- <div class="two-columns_icon"><%= image_tag "mailer/mail.png", class: "mail-icon"%></div>
22
- <div class="two-columns_text-container">
23
- <p class="two-columns_title">Email</p>
18
+ <div class="vertical-separater"></div>
19
+ <div class="two-columns-item">
20
+ <div class="flex two-columns-item_detail">
21
+ <div class="two-columns_icon"><%= image_tag "mailer/mail.png", class: "mail-icon"%></div>
22
+ <div class="two-columns_text-container">
23
+ <p class="two-columns_title">Email</p>
24
24
  <p class="two-columns_description">
25
- <%= @vendor&.support_email.present? ? link_to(@vendor.support_email, "mailto:#{@vendor.support_email}") : "N/A" %>
26
- </p>
27
-
25
+ <%= order&.tenant&.customer_support_email.present? ? link_to(order.tenant.customer_support_email, "mailto:#{order.tenant.customer_support_email}") : "N/A" %>
26
+ </p>
27
+ </div>
28
28
  </div>
29
29
  </div>
30
30
  </div>
31
31
  </div>
32
32
  </div>
33
- </div>
@@ -454,14 +454,6 @@ en:
454
454
  admin:
455
455
  display_on:
456
456
  frontend_for_early_adopter: "Storefront for Early Adopter"
457
- external_integrations_title: "External Integrations"
458
- integration_sync_enqueued: "Integration sync has been enqueued"
459
- integration_inactive: "Integration is inactive"
460
- external_integrations:
461
- view_result: "View Result"
462
- sync_result: "Sync Result"
463
- external_payload: "External Payload"
464
- no_results: "No results found"
465
457
  event:
466
458
  check_in:
467
459
  success: "Guest check-in in successfully"
@@ -341,14 +341,6 @@ km:
341
341
  admin:
342
342
  display_on:
343
343
  frontend_for_early_adopter: "Storefront for Early Adopter"
344
- external_integrations_title: "ការភ្ជាប់ខាងក្រៅ"
345
- integration_sync_enqueued: "ការធ្វើសមកាលកម្មបានដាក់ក្នុងជួរ"
346
- integration_inactive: "ការភ្ជាប់មិនដំណើរការ"
347
- external_integrations:
348
- view_result: "មើលលទ្ធផល"
349
- sync_result: "លទ្ធផលធ្វើសមកាលកម្ម"
350
- external_payload: "ទិន្នន័យខាងក្រៅ"
351
- no_results: "មិនមានលទ្ធផលទេ"
352
344
  event:
353
345
  check_in:
354
346
  success: "Guest check-in in successfully"
data/config/routes.rb CHANGED
@@ -283,13 +283,6 @@ Spree::Core::Engine.add_routes do
283
283
  post :set_webhook
284
284
  end
285
285
  end
286
- resources :integrations do
287
- member do
288
- post :enqueue_polling
289
- end
290
- resources :sessions, only: [:index], controller: 'integration_sessions'
291
- resources :mappings, only: [:index], controller: 'integration_mappings'
292
- end
293
286
 
294
287
  resources :webhooks_subscribers do
295
288
  resources :rules, controller: :webhooks_subscriber_rules, except: %i[index show]
@@ -702,7 +695,6 @@ Spree::Core::Engine.add_routes do
702
695
 
703
696
  resources :seat_layouts, only: %i[show index]
704
697
  resources :inventory_items, only: %i[index]
705
- resources :event_matches, only: %i[index]
706
698
  namespace :transit do
707
699
  resources :draft_orders, only: %i[create]
708
700
  end
@@ -0,0 +1,9 @@
1
+ class AddContactFieldsToCmTenants < ActiveRecord::Migration[7.0]
2
+ def change
3
+ add_column :cm_tenants, :customer_support_email, :string, if_not_exists: true
4
+ add_column :cm_tenants, :address, :text, if_not_exists: true
5
+ add_column :cm_tenants, :contact_phone, :string, if_not_exists: true
6
+ add_index :cm_tenants, :customer_support_email, if_not_exists: true
7
+ add_index :cm_tenants, :contact_phone, if_not_exists: true
8
+ end
9
+ end
data/lib/cm_app_logger.rb CHANGED
@@ -1,18 +1,17 @@
1
1
  # lib/cm_app_logger.rb
2
2
  module CmAppLogger
3
3
  def self.log(label:, data: nil)
4
- message = { label: label, data: safe_serialize(data) }
4
+ message = { label: label, data: data }
5
5
  start_time = Time.current
6
6
  Rails.logger.info(message.to_json)
7
7
 
8
8
  return unless block_given?
9
9
 
10
- # Capture the block's return value and return it to preserve existing behavior for callers expecting that value.
10
+ # Capture the blocks return value and return it to preserve existing behavior for callers expecting that value.
11
11
  block_result = yield
12
12
 
13
13
  message[:start_time] = start_time
14
14
  message[:duration_ms] = (Time.current - start_time) * 1000
15
- message[:result] = safe_serialize(block_result)
16
15
  Rails.logger.info(message.to_json)
17
16
  block_result
18
17
  end
@@ -20,26 +19,9 @@ module CmAppLogger
20
19
  def self.error(label:, data: nil)
21
20
  message = {
22
21
  label: label,
23
- data: safe_serialize(data)
22
+ data: data
24
23
  }
25
24
 
26
25
  Rails.logger.error(message.to_json)
27
26
  end
28
-
29
- def self.safe_serialize(obj)
30
- case obj
31
- when Hash
32
- obj.transform_values { |v| safe_serialize(v) }
33
- when Array
34
- obj.map { |item| safe_serialize(item) }
35
- when NilClass, TrueClass, FalseClass, Numeric, String, Symbol
36
- obj
37
- when ActiveJob::Base
38
- # Don't serialize the entire job object - just its class and ID
39
- { job_class: obj.class.name, job_id: obj.job_id }
40
- else
41
- # For other objects, try to_s as fallback
42
- obj.respond_to?(:id) ? { class: obj.class.name, id: obj.id } : obj.to_s
43
- end
44
- end
45
27
  end
@@ -1,5 +1,5 @@
1
1
  module SpreeCmCommissioner
2
- VERSION = '2.5.0-pre7'.freeze
2
+ VERSION = '2.5.0.pre.pre8'.freeze
3
3
 
4
4
  module_function
5
5
 
@@ -55,17 +55,16 @@ require 'byebug' if Rails.env.development? || Rails.env.test?
55
55
 
56
56
  module SpreeCmCommissioner
57
57
  class << self
58
- # Allows overriding the default Redis connection pools with custom ones
59
- attr_writer :inventory_redis_pool
58
+ # Allows overriding the default Redis connection pool with a custom one
59
+ attr_writer :redis_pool
60
60
 
61
- # Inventory Redis pool for inventory management
62
- def inventory_redis_pool
63
- @inventory_redis_pool ||= default_redis_pool
61
+ def redis_pool
62
+ @redis_pool ||= default_redis_pool
64
63
  end
65
64
 
66
- # Resets all Redis pools, useful for testing or reinitialization
67
- def reset_redis_pools
68
- @inventory_redis_pool = nil
65
+ # Resets the Redis pool, useful for testing or reinitialization
66
+ def reset_redis_pool
67
+ @redis_pool = nil
69
68
  end
70
69
 
71
70
  private