spree_cm_commissioner 2.5.0.pre.pre7 → 2.5.0.pre.pre9
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 +4 -4
- data/.bundle/config +3 -2
- data/.github/workflows/test_and_build_gem.yml +123 -57
- data/Gemfile.lock +1 -1
- data/Rakefile +55 -29
- data/app/controllers/spree/admin/base_controller_decorator.rb +3 -3
- data/app/controllers/spree/admin/base_import_orders_controller.rb +6 -1
- data/app/controllers/spree/admin/classifications_controller.rb +1 -1
- data/app/controllers/spree/admin/notification_sender_controller.rb +1 -1
- data/app/controllers/spree/api/v2/storefront/popular_route_places_controller.rb +7 -1
- data/app/controllers/spree/api/v2/storefront/queue_cart/line_items_controller.rb +6 -6
- data/app/controllers/spree/api/v2/storefront/route_places_controller.rb +9 -9
- data/app/finders/spree_cm_commissioner/places/find_with_route.rb +10 -10
- data/app/finders/spree_cm_commissioner/routes/find_popular.rb +10 -14
- data/app/interactors/spree_cm_commissioner/create_event.rb +1 -1
- data/app/interactors/spree_cm_commissioner/customer_notification_cron_executor.rb +1 -1
- data/app/interactors/spree_cm_commissioner/stock/stock_movement_creator.rb +3 -2
- data/app/jobs/spree_cm_commissioner/conversion_pre_calculator_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/customer_notification_sender_job.rb +3 -3
- data/app/jobs/spree_cm_commissioner/enqueue_cart/add_item_job.rb +7 -7
- data/app/jobs/spree_cm_commissioner/ensure_event_for_product_line_item_guests_job.rb +1 -1
- data/app/jobs/spree_cm_commissioner/event_line_items_date_syncer_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/export_csv_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/import_order_job.rb +5 -5
- data/app/jobs/spree_cm_commissioner/invalidate_cache_request_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/inventory_item_syncer_job.rb +8 -2
- data/app/jobs/spree_cm_commissioner/option_type_variants_public_metadata_updater_job.rb +7 -3
- data/app/jobs/spree_cm_commissioner/option_value_variants_public_metadata_updater_job.rb +6 -2
- data/app/jobs/spree_cm_commissioner/order_complete_telegram_sender_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/product_event_id_to_children_syncer_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/reports_assigner_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/sms_pin_code_job.rb +1 -1
- data/app/jobs/spree_cm_commissioner/state_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/stock/inventory_items_adjuster_job.rb +4 -1
- data/app/jobs/spree_cm_commissioner/stock/inventory_items_generator_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/transit/route_fulfilled_order_count_incrementer_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/transit/route_order_count_incrementer_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/transit/route_previous_trip_count_decrementer_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/transit/route_trip_count_decrementer_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/transit/route_trip_count_incrementer_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/vendor_creation_telegram_alert_sender_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/vendor_job.rb +2 -2
- data/app/jobs/spree_cm_commissioner/waiting_room_session_firebase_logger_job.rb +1 -1
- data/app/models/concerns/spree_cm_commissioner/option_type_attr_type.rb +1 -1
- data/app/models/concerns/spree_cm_commissioner/option_value_attr_type.rb +1 -1
- data/app/models/concerns/spree_cm_commissioner/order_state_machine.rb +2 -2
- data/app/models/concerns/spree_cm_commissioner/tenant_preference.rb +3 -0
- data/app/models/spree_cm_commissioner/export.rb +1 -1
- data/app/models/spree_cm_commissioner/product_decorator.rb +1 -1
- data/app/models/spree_cm_commissioner/redis_stock/inventory_updater.rb +4 -1
- data/app/models/spree_cm_commissioner/stock_item_decorator.rb +4 -4
- data/app/models/spree_cm_commissioner/taxon_decorator.rb +1 -1
- data/app/models/spree_cm_commissioner/vendor_decorator.rb +2 -2
- data/app/request_schemas/spree_cm_commissioner/popular_route_places_request_schema.rb +12 -0
- data/app/request_schemas/spree_cm_commissioner/route_places_request_schema.rb +5 -0
- data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/inventory/unstock_inventory.rb +1 -1
- data/app/views/spree/admin/tenants/_form.html.erb +18 -0
- data/app/views/spree/admin/tenants/form/_footer.html.erb +31 -0
- data/app/views/spree/admin/tenants/form/_social.html.erb +31 -0
- data/app/views/spree/order_mailer/confirm_email.html.erb +1 -1
- data/app/views/spree_cm_commissioner/layouts/order_mailer.html.erb +1 -1
- data/app/views/spree_cm_commissioner/order_mailer/tenant/_footer.html.erb +13 -6
- data/app/views/spree_cm_commissioner/order_mailer/tenant/_support_contact.html.erb +23 -24
- data/bin/run_spec_group +101 -0
- data/db/migrate/20251209022924_add_contact_fields_to_cm_tenants.rb +9 -0
- data/lib/cm_app_logger.rb +28 -14
- data/lib/spree_cm_commissioner/test_helper/factories/vendor_factory.rb +1 -0
- data/lib/spree_cm_commissioner/test_helper/factories/vendor_place_factory.rb +3 -2
- data/lib/spree_cm_commissioner/version.rb +1 -1
- metadata +7 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class CustomerNotificationSenderJob < ApplicationUniqueJob
|
|
3
|
-
def perform(
|
|
4
|
-
customer_notification = SpreeCmCommissioner::CustomerNotification.find(customer_notification_id)
|
|
5
|
-
SpreeCmCommissioner::CustomerNotificationSender.call(customer_notification: customer_notification, user_ids: user_ids)
|
|
3
|
+
def perform(options = {})
|
|
4
|
+
customer_notification = SpreeCmCommissioner::CustomerNotification.find(options[:customer_notification_id])
|
|
5
|
+
SpreeCmCommissioner::CustomerNotificationSender.call(customer_notification: customer_notification, user_ids: options[:user_ids])
|
|
6
6
|
end
|
|
7
7
|
end
|
|
8
8
|
end
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
module EnqueueCart
|
|
3
3
|
class AddItemJob < ApplicationUniqueJob
|
|
4
|
-
def perform(
|
|
4
|
+
def perform(options = {})
|
|
5
5
|
SpreeCmCommissioner::EnqueueCart::AddItem.call(
|
|
6
|
-
order_id: order_id,
|
|
7
|
-
variant_id: variant_id,
|
|
8
|
-
quantity: quantity,
|
|
9
|
-
public_metadata: public_metadata,
|
|
10
|
-
private_metadata: private_metadata,
|
|
11
|
-
options: options,
|
|
6
|
+
order_id: options[:order_id],
|
|
7
|
+
variant_id: options[:variant_id],
|
|
8
|
+
quantity: options[:quantity],
|
|
9
|
+
public_metadata: options[:public_metadata],
|
|
10
|
+
private_metadata: options[:private_metadata],
|
|
11
|
+
options: options[:options],
|
|
12
12
|
job_id: job_id
|
|
13
13
|
)
|
|
14
14
|
end
|
|
@@ -5,7 +5,7 @@ module SpreeCmCommissioner
|
|
|
5
5
|
Spree::Taxon.event.includes(:children_products).find_each do |event|
|
|
6
6
|
event.children_products.where('event_id IS NULL OR event_id != ?', event.id).find_each do |product|
|
|
7
7
|
product.update_columns(event_id: event.id) # rubocop:disable Rails/SkipsModelValidations
|
|
8
|
-
::SpreeCmCommissioner::ProductEventIdToChildrenSyncerJob.perform_later(product.id)
|
|
8
|
+
::SpreeCmCommissioner::ProductEventIdToChildrenSyncerJob.perform_later(product_id: product.id)
|
|
9
9
|
end
|
|
10
10
|
end
|
|
11
11
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class EventLineItemsDateSyncerJob < ApplicationJob
|
|
3
|
-
def perform(
|
|
4
|
-
event = Spree::Taxon.event.find(event_id)
|
|
3
|
+
def perform(options = {})
|
|
4
|
+
event = Spree::Taxon.event.find(options[:event_id])
|
|
5
5
|
SpreeCmCommissioner::EventLineItemsDateSyncer.call(event: event)
|
|
6
6
|
end
|
|
7
7
|
end
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class ImportOrderJob < ApplicationUniqueJob
|
|
3
|
-
def perform(
|
|
4
|
-
if import_type == 'new_order'
|
|
3
|
+
def perform(options = {})
|
|
4
|
+
if options[:import_type] == 'new_order'
|
|
5
5
|
SpreeCmCommissioner::Imports::CreateOrderService.new(
|
|
6
|
-
import_order_id: import_order_id,
|
|
7
|
-
import_by_user_id: import_by_user_id
|
|
6
|
+
import_order_id: options[:import_order_id],
|
|
7
|
+
import_by_user_id: options[:import_by_user_id]
|
|
8
8
|
).call
|
|
9
9
|
else
|
|
10
10
|
SpreeCmCommissioner::Imports::UpdateOrderService.new(
|
|
11
|
-
import_order_id: import_order_id
|
|
11
|
+
import_order_id: options[:import_order_id]
|
|
12
12
|
).call
|
|
13
13
|
end
|
|
14
14
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class InvalidateCacheRequestJob < ApplicationUniqueJob
|
|
3
|
-
def perform(
|
|
4
|
-
SpreeCmCommissioner::InvalidateCacheRequest.call(pattern: pattern)
|
|
3
|
+
def perform(options = {})
|
|
4
|
+
SpreeCmCommissioner::InvalidateCacheRequest.call(pattern: options[:pattern])
|
|
5
5
|
end
|
|
6
6
|
end
|
|
7
7
|
end
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class InventoryItemSyncerJob < ApplicationUniqueJob
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
# :line_item_ids, :inventory_id_and_quantities
|
|
4
|
+
#
|
|
5
|
+
# :line_item_ids is included for unique job key generation to prevent duplicate jobs,
|
|
6
|
+
# though it's not used in the perform method implementation.
|
|
7
|
+
def perform(options = {})
|
|
8
|
+
InventoryItemSyncer.call(
|
|
9
|
+
inventory_id_and_quantities: options[:inventory_id_and_quantities]
|
|
10
|
+
)
|
|
5
11
|
end
|
|
6
12
|
end
|
|
7
13
|
end
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class OptionTypeVariantsPublicMetadataUpdaterJob < ApplicationUniqueJob
|
|
3
|
-
def perform(
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
def perform(options = {})
|
|
4
|
+
option_type = ::Spree::OptionType.find_by(id: options[:option_type_id])
|
|
5
|
+
|
|
6
|
+
# job can be queued with invalid id or record is created but rolled back or deleted.
|
|
7
|
+
return if option_type.blank?
|
|
8
|
+
|
|
9
|
+
option_type.variants.find_each(&:set_options_to_public_metadata!)
|
|
6
10
|
end
|
|
7
11
|
end
|
|
8
12
|
end
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class OptionValueVariantsPublicMetadataUpdaterJob < ApplicationUniqueJob
|
|
3
|
-
def perform(
|
|
4
|
-
option_value = ::Spree::OptionValue.
|
|
3
|
+
def perform(options = {})
|
|
4
|
+
option_value = ::Spree::OptionValue.find_by(id: options[:option_value_id])
|
|
5
|
+
|
|
6
|
+
# job can be queued with invalid id or record is created but rolled back or deleted.
|
|
7
|
+
return if option_value.blank?
|
|
8
|
+
|
|
5
9
|
option_value.variants.find_each(&:set_options_to_public_metadata!)
|
|
6
10
|
end
|
|
7
11
|
end
|
|
@@ -4,8 +4,8 @@ module SpreeCmCommissioner
|
|
|
4
4
|
class OrderCompleteTelegramSenderJob < ApplicationUniqueJob
|
|
5
5
|
queue_as :telegram_bot
|
|
6
6
|
|
|
7
|
-
def perform(
|
|
8
|
-
order = Spree::Order.find(order_id)
|
|
7
|
+
def perform(options = {})
|
|
8
|
+
order = Spree::Order.find(options[:order_id])
|
|
9
9
|
SpreeCmCommissioner::OrderCompleteTelegramSender.call(order: order)
|
|
10
10
|
end
|
|
11
11
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class ProductEventIdToChildrenSyncerJob < ApplicationUniqueJob
|
|
3
|
-
def perform(
|
|
4
|
-
product = Spree::Product.find(product_id)
|
|
3
|
+
def perform(options = {})
|
|
4
|
+
product = Spree::Product.find(options[:product_id])
|
|
5
5
|
SpreeCmCommissioner::ProductEventIdToChildrenSyncer.call(product: product)
|
|
6
6
|
end
|
|
7
7
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class ReportsAssignerJob < ApplicationUniqueJob
|
|
3
|
-
def perform(
|
|
4
|
-
SpreeCmCommissioner::ReportsAssigner.call(queryable_id: queryable_id, queryable_type: queryable_type)
|
|
3
|
+
def perform(options = {})
|
|
4
|
+
SpreeCmCommissioner::ReportsAssigner.call(queryable_id: options[:queryable_id], queryable_type: options[:queryable_type])
|
|
5
5
|
end
|
|
6
6
|
end
|
|
7
7
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class StateJob < ApplicationUniqueJob
|
|
3
|
-
def perform(
|
|
4
|
-
state = ::Spree::State.find_by(id: state_id)
|
|
3
|
+
def perform(options = {})
|
|
4
|
+
state = ::Spree::State.find_by(id: options[:state_id])
|
|
5
5
|
StateUpdater.call(state: state)
|
|
6
6
|
end
|
|
7
7
|
end
|
|
@@ -2,7 +2,10 @@ module SpreeCmCommissioner
|
|
|
2
2
|
module Stock
|
|
3
3
|
class InventoryItemsAdjusterJob < ApplicationUniqueJob
|
|
4
4
|
def perform(options = {})
|
|
5
|
-
variant = Spree::Variant.
|
|
5
|
+
variant = Spree::Variant.find_by(id: options[:variant_id])
|
|
6
|
+
|
|
7
|
+
# potentially the variant was deleted during the job wait time, we just skip in that case.
|
|
8
|
+
return if variant.blank?
|
|
6
9
|
|
|
7
10
|
SpreeCmCommissioner::Stock::InventoryItemsAdjuster.call(variant: variant, quantity: options[:quantity])
|
|
8
11
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
module Stock
|
|
3
3
|
class InventoryItemsGeneratorJob < ApplicationUniqueJob
|
|
4
|
-
def perform(
|
|
5
|
-
variant = Spree::Variant.find(variant_id)
|
|
4
|
+
def perform(options = {})
|
|
5
|
+
variant = Spree::Variant.find(options[:variant_id])
|
|
6
6
|
|
|
7
7
|
SpreeCmCommissioner::Stock::InventoryItemsGenerator.call(variant: variant)
|
|
8
8
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
module Transit
|
|
3
3
|
class RouteFulfilledOrderCountIncrementerJob < ApplicationUniqueJob
|
|
4
|
-
def perform(
|
|
5
|
-
order = Spree::Order.find(order_id)
|
|
4
|
+
def perform(options = {})
|
|
5
|
+
order = Spree::Order.find(options[:order_id])
|
|
6
6
|
SpreeCmCommissioner::Routes::IncrementFulfilledOrderCount.call(order: order)
|
|
7
7
|
end
|
|
8
8
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
module Transit
|
|
3
3
|
class RouteOrderCountIncrementerJob < ApplicationUniqueJob
|
|
4
|
-
def perform(
|
|
5
|
-
order = Spree::Order.find(order_id)
|
|
4
|
+
def perform(options = {})
|
|
5
|
+
order = Spree::Order.find(options[:order_id])
|
|
6
6
|
SpreeCmCommissioner::Routes::IncrementOrderCount.call(order: order)
|
|
7
7
|
end
|
|
8
8
|
end
|
|
@@ -5,8 +5,8 @@ module SpreeCmCommissioner
|
|
|
5
5
|
class RoutePreviousTripCountDecrementerJob < ApplicationUniqueJob
|
|
6
6
|
queue_as :default
|
|
7
7
|
|
|
8
|
-
def perform(
|
|
9
|
-
SpreeCmCommissioner::Routes::DecrementPreviousTripCount.call(previous_route_id: previous_route_id)
|
|
8
|
+
def perform(options = {})
|
|
9
|
+
SpreeCmCommissioner::Routes::DecrementPreviousTripCount.call(previous_route_id: options[:previous_route_id])
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
module Transit
|
|
3
3
|
class RouteTripCountDecrementerJob < ApplicationUniqueJob
|
|
4
|
-
def perform(
|
|
5
|
-
trip = SpreeCmCommissioner::Trip.find(trip_id)
|
|
4
|
+
def perform(options = {})
|
|
5
|
+
trip = SpreeCmCommissioner::Trip.find(options[:trip_id])
|
|
6
6
|
SpreeCmCommissioner::Routes::DecrementTripCount.call(trip: trip)
|
|
7
7
|
end
|
|
8
8
|
end
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
module Transit
|
|
3
3
|
class RouteTripCountIncrementerJob < ApplicationUniqueJob
|
|
4
|
-
def perform(
|
|
5
|
-
trip = SpreeCmCommissioner::Trip.find(trip_id)
|
|
4
|
+
def perform(options = {})
|
|
5
|
+
trip = SpreeCmCommissioner::Trip.find(options[:trip_id])
|
|
6
6
|
SpreeCmCommissioner::Routes::IncrementTripCount.call(trip: trip)
|
|
7
7
|
end
|
|
8
8
|
end
|
|
@@ -2,8 +2,8 @@ module SpreeCmCommissioner
|
|
|
2
2
|
class VendorCreationTelegramAlertSenderJob < ApplicationUniqueJob
|
|
3
3
|
queue_as :telegram_bot
|
|
4
4
|
|
|
5
|
-
def perform(
|
|
6
|
-
vendor = Spree::Vendor.find(vendor_id)
|
|
5
|
+
def perform(options = {})
|
|
6
|
+
vendor = Spree::Vendor.find(options[:vendor_id])
|
|
7
7
|
SpreeCmCommissioner::VendorCreationTelegramAlertSender.call(vendor: vendor)
|
|
8
8
|
end
|
|
9
9
|
end
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module SpreeCmCommissioner
|
|
2
2
|
class VendorJob < ApplicationUniqueJob
|
|
3
|
-
def perform(
|
|
4
|
-
vendor = ::Spree::Vendor.find(vendor_id)
|
|
3
|
+
def perform(options = {})
|
|
4
|
+
vendor = ::Spree::Vendor.find(options[:vendor_id])
|
|
5
5
|
VendorUpdater.call(vendor: vendor)
|
|
6
6
|
end
|
|
7
7
|
end
|
|
@@ -23,7 +23,7 @@ module SpreeCmCommissioner
|
|
|
23
23
|
class WaitingRoomSessionFirebaseLoggerJob < ApplicationUniqueJob
|
|
24
24
|
retry_on StandardError, wait: :exponentially_longer, attempts: 4
|
|
25
25
|
|
|
26
|
-
def perform(options)
|
|
26
|
+
def perform(options = {})
|
|
27
27
|
room_session = SpreeCmCommissioner::WaitingRoomSession.find(options[:room_session_id])
|
|
28
28
|
waiting_guest_firebase_doc_id = options[:waiting_guest_firebase_doc_id]
|
|
29
29
|
|
|
@@ -104,7 +104,7 @@ module SpreeCmCommissioner
|
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
def update_variants_metadata
|
|
107
|
-
SpreeCmCommissioner::OptionTypeVariantsPublicMetadataUpdaterJob.perform_later(id)
|
|
107
|
+
SpreeCmCommissioner::OptionTypeVariantsPublicMetadataUpdaterJob.perform_later(option_type_id: id)
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
private
|
|
@@ -76,7 +76,7 @@ module SpreeCmCommissioner
|
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
def update_variants_metadata
|
|
79
|
-
SpreeCmCommissioner::OptionValueVariantsPublicMetadataUpdaterJob.perform_later(id)
|
|
79
|
+
SpreeCmCommissioner::OptionValueVariantsPublicMetadataUpdaterJob.perform_later(option_value_id: id)
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
private
|
|
@@ -83,7 +83,7 @@ module SpreeCmCommissioner
|
|
|
83
83
|
|
|
84
84
|
def precalculate_conversion
|
|
85
85
|
line_items.each do |item|
|
|
86
|
-
SpreeCmCommissioner::ConversionPreCalculatorJob.perform_later(item.product_id)
|
|
86
|
+
SpreeCmCommissioner::ConversionPreCalculatorJob.perform_later(product_id: item.product_id)
|
|
87
87
|
end
|
|
88
88
|
end
|
|
89
89
|
|
|
@@ -246,7 +246,7 @@ module SpreeCmCommissioner
|
|
|
246
246
|
end
|
|
247
247
|
|
|
248
248
|
def notify_order_complete_telegram_notification_to_user
|
|
249
|
-
SpreeCmCommissioner::OrderCompleteTelegramSenderJob.perform_later(id) if user_id.present?
|
|
249
|
+
SpreeCmCommissioner::OrderCompleteTelegramSenderJob.perform_later(order_id: id) if user_id.present?
|
|
250
250
|
end
|
|
251
251
|
|
|
252
252
|
def send_order_requested_app_notification_to_user
|
|
@@ -12,6 +12,9 @@ module SpreeCmCommissioner
|
|
|
12
12
|
preference :brand_primary_color, :string, default: ''
|
|
13
13
|
preference :redirect_target_host, :string, default: ''
|
|
14
14
|
preference :redirect_excluded_paths, :string, default: ''
|
|
15
|
+
preference :facebook, :string, default: ''
|
|
16
|
+
preference :twitter, :string, default: ''
|
|
17
|
+
preference :instagram, :string, default: ''
|
|
15
18
|
end
|
|
16
19
|
end
|
|
17
20
|
end
|
|
@@ -151,7 +151,7 @@ module SpreeCmCommissioner
|
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
def sync_event_id_to_children
|
|
154
|
-
::SpreeCmCommissioner::ProductEventIdToChildrenSyncerJob.perform_later(id)
|
|
154
|
+
::SpreeCmCommissioner::ProductEventIdToChildrenSyncerJob.perform_later(product_id: id)
|
|
155
155
|
end
|
|
156
156
|
|
|
157
157
|
def validate_event_taxons
|
|
@@ -119,7 +119,10 @@ module SpreeCmCommissioner
|
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
def schedule_sync_inventory(inventory_id_and_quantities)
|
|
122
|
-
SpreeCmCommissioner::InventoryItemSyncerJob.perform_later(
|
|
122
|
+
SpreeCmCommissioner::InventoryItemSyncerJob.perform_later(
|
|
123
|
+
inventory_id_and_quantities: inventory_id_and_quantities,
|
|
124
|
+
line_item_ids: @line_item_ids
|
|
125
|
+
)
|
|
123
126
|
end
|
|
124
127
|
end
|
|
125
128
|
end
|
|
@@ -9,7 +9,7 @@ module SpreeCmCommissioner
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def update_vendor_total_inventory
|
|
12
|
-
SpreeCmCommissioner::VendorJob.perform_later(vendor.id) if vendor.present?
|
|
12
|
+
SpreeCmCommissioner::VendorJob.perform_later(vendor_id: vendor.id) if vendor.present?
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
private
|
|
@@ -20,9 +20,9 @@ module SpreeCmCommissioner
|
|
|
20
20
|
|
|
21
21
|
# When admin delete stock item, it will deduct stock from inventory item
|
|
22
22
|
def adjust_inventory_items_async
|
|
23
|
-
|
|
24
|
-
CmAppLogger.log(label: "#{self.class.name}#adjust_inventory_items_async", data:
|
|
25
|
-
SpreeCmCommissioner::Stock::InventoryItemsAdjusterJob.perform_later(**
|
|
23
|
+
args = { variant_id: variant.id, quantity: -count_on_hand }
|
|
24
|
+
CmAppLogger.log(label: "#{self.class.name}#adjust_inventory_items_async", data: args) do
|
|
25
|
+
SpreeCmCommissioner::Stock::InventoryItemsAdjusterJob.perform_later(**args)
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
end
|
|
@@ -135,7 +135,7 @@ module SpreeCmCommissioner
|
|
|
135
135
|
def sync_event_dates_to_line_items
|
|
136
136
|
return unless event? && depth == 1
|
|
137
137
|
|
|
138
|
-
::SpreeCmCommissioner::EventLineItemsDateSyncerJob.perform_later(id)
|
|
138
|
+
::SpreeCmCommissioner::EventLineItemsDateSyncerJob.perform_later(event_id: id)
|
|
139
139
|
end
|
|
140
140
|
|
|
141
141
|
private
|
|
@@ -185,7 +185,7 @@ module SpreeCmCommissioner
|
|
|
185
185
|
end
|
|
186
186
|
|
|
187
187
|
def update_state_total_inventory
|
|
188
|
-
SpreeCmCommissioner::StateJob.perform_later(default_state_id) unless default_state_id.nil?
|
|
188
|
+
SpreeCmCommissioner::StateJob.perform_later(state_id: default_state_id) unless default_state_id.nil?
|
|
189
189
|
end
|
|
190
190
|
end
|
|
191
191
|
|
|
@@ -209,7 +209,7 @@ module SpreeCmCommissioner
|
|
|
209
209
|
end
|
|
210
210
|
|
|
211
211
|
def send_telegram_vendor_creation_alert
|
|
212
|
-
VendorCreationTelegramAlertSenderJob.perform_later(id)
|
|
212
|
+
VendorCreationTelegramAlertSenderJob.perform_later(vendor_id: id)
|
|
213
213
|
end
|
|
214
214
|
|
|
215
215
|
delegate :present?, to: :tenant, prefix: true
|
|
@@ -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)
|
data/app/services/spree_cm_commissioner/integrations/stadium_x_v1/inventory/unstock_inventory.rb
CHANGED
|
@@ -66,7 +66,7 @@ class SpreeCmCommissioner::Integrations::StadiumXV1
|
|
|
66
66
|
integration: integration
|
|
67
67
|
)
|
|
68
68
|
|
|
69
|
-
guest_mapping.external_qr_data = ticket
|
|
69
|
+
guest_mapping.external_qr_data = group_ticket_qr_data([ticket])
|
|
70
70
|
guest_mapping.mark_as_active!(external_payload: ticket.to_h)
|
|
71
71
|
end
|
|
72
72
|
end
|
|
@@ -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',
|
|
29
|
+
<%= render 'spree_cm_commissioner/order_mailer/tenant/footer', tenant: @order.tenant %>
|
|
30
30
|
<% end %>
|
|
31
31
|
</td>
|
|
32
32
|
</tr>
|