mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-06 22:36:07 +00:00
record subscription issue if no order is generated
This commit is contained in:
@@ -13,8 +13,8 @@ class SubscriptionPlacementJob < ActiveJob::Base
|
||||
|
||||
private
|
||||
|
||||
delegate :record_order, :record_success, :record_issue, to: :summarizer
|
||||
delegate :record_and_log_error, :send_placement_summary_emails, to: :summarizer
|
||||
delegate :record_success, :record_issue, :record_subscription_issue, to: :summarizer
|
||||
delegate :record_order, :record_and_log_error, :send_placement_summary_emails, to: :summarizer
|
||||
|
||||
def summarizer
|
||||
@summarizer ||= OrderManagement::Subscriptions::Summarizer.new
|
||||
@@ -30,6 +30,8 @@ class SubscriptionPlacementJob < ActiveJob::Base
|
||||
def place_order_for(proxy_order)
|
||||
JobLogger.logger.info("Placing Order for Proxy Order #{proxy_order.id}")
|
||||
initialise_order(proxy_order)
|
||||
return record_subscription_issue(proxy_order.subscription) if proxy_order.order.nil?
|
||||
|
||||
place_order(proxy_order.order)
|
||||
end
|
||||
|
||||
|
||||
@@ -19,3 +19,11 @@
|
||||
- orders.each_with_index do |order, i|
|
||||
%a{ href: order_url(order) }>= order.number
|
||||
= ", " if i < orders.count - 1
|
||||
|
||||
- if summary.subscription_issues.any?
|
||||
- subscription_issues = summary.subscription_issues
|
||||
%h4= t(".other.title", count: subscription_issues.count)
|
||||
%p= t(".other.explainer")
|
||||
- subscription_issues.each_with_index do |subscription_id, i|
|
||||
%a{ href: edit_admin_subscription_url(subscription_id) }>= subscription_id
|
||||
= ", " if i < subscription_issues.count - 1
|
||||
|
||||
Reference in New Issue
Block a user