diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/coordinator_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/coordinator_fee.rb index a4ddd74f9f..c186b9aae3 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/coordinator_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/coordinator_fee.rb @@ -13,12 +13,12 @@ module OrderManagement end def tax_category_name - return context.data["tax_category_name"] if context.data["tax_category_name"].present? + return data["tax_category_name"] if data["tax_category_name"].present? i18n_translate("tax_category_various") if inherits_tax_category? end def inherits_tax_category? - context.data["enterprise_fee_inherits_tax_category"] == "t" + data["enterprise_fee_inherits_tax_category"] == "t" end end end diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/exchange_order_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/exchange_order_fee.rb index 87385bc0b8..c92d81c361 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/exchange_order_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/exchange_order_fee.rb @@ -10,11 +10,11 @@ module OrderManagement def fee_calculated_on_transfer_through_name i18n_translate("fee_calculated_on_transfer_through_entire_orders", - distributor: context.data["adjustment_source_distributor_name"]) + distributor: data["adjustment_source_distributor_name"]) end def tax_category_name - context.data["tax_category_name"] || i18n_translate("tax_category_various") + data["tax_category_name"] || i18n_translate("tax_category_various") end end end diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/incoming_exchange_line_item_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/incoming_exchange_line_item_fee.rb index cb51c46def..1bff07b5b0 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/incoming_exchange_line_item_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/incoming_exchange_line_item_fee.rb @@ -9,11 +9,11 @@ module OrderManagement include UsingEnterpriseFee def fee_calculated_on_transfer_through_name - context.data["incoming_exchange_enterprise_name"] + data["incoming_exchange_enterprise_name"] end def tax_category_name - context.data["tax_category_name"] || context.data["product_tax_category_name"] + data["tax_category_name"] || data["product_tax_category_name"] end end end diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/outgoing_exchange_line_item_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/outgoing_exchange_line_item_fee.rb index 9598e34654..c4b997c774 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/outgoing_exchange_line_item_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/outgoing_exchange_line_item_fee.rb @@ -9,11 +9,11 @@ module OrderManagement include UsingEnterpriseFee def fee_calculated_on_transfer_through_name - context.data["outgoing_exchange_enterprise_name"] + data["outgoing_exchange_enterprise_name"] end def tax_category_name - context.data["tax_category_name"] || context.data["product_tax_category_name"] + data["tax_category_name"] || data["product_tax_category_name"] end end end diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/payment_method_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/payment_method_fee.rb index d9623fe9f2..ed0d30af1f 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/payment_method_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/payment_method_fee.rb @@ -8,10 +8,10 @@ module OrderManagement class PaymentMethodFee include WithI18n - attr_reader :context + attr_reader :data - def initialize(context) - @context = context + def initialize(data) + @data = data end def fee_type @@ -19,11 +19,11 @@ module OrderManagement end def enterprise_name - context.data["hub_name"] + data["hub_name"] end def fee_name - context.data["payment_method_name"] + data["payment_method_name"] end def fee_placement; end diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/shipping_method_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/shipping_method_fee.rb index 3d7dcf56e1..b96fd99e34 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/shipping_method_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/shipping_method_fee.rb @@ -8,10 +8,10 @@ module OrderManagement class ShippingMethodFee include WithI18n - attr_reader :context + attr_reader :data - def initialize(context) - @context = context + def initialize(data) + @data = data end def fee_type @@ -19,11 +19,11 @@ module OrderManagement end def enterprise_name - context.data["hub_name"] + data["hub_name"] end def fee_name - context.data["shipping_method_name"] + data["shipping_method_name"] end def fee_placement; end diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/using_enterprise_fee.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/using_enterprise_fee.rb index 744cfdc862..c9c04477df 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/using_enterprise_fee.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/data_representations/using_enterprise_fee.rb @@ -12,26 +12,26 @@ module OrderManagement module UsingEnterpriseFee include WithI18n - attr_reader :context + attr_reader :data - def initialize(context) - @context = context + def initialize(data) + @data = data end def fee_type - context.data["fee_type"].try(:capitalize) + data["fee_type"].try(:capitalize) end def enterprise_name - context.data["enterprise_name"] + data["enterprise_name"] end def fee_name - context.data["fee_name"] + data["fee_name"] end def fee_placement - i18n_translate("fee_placements.#{context.data['placement_enterprise_role']}") + i18n_translate("fee_placements.#{data['placement_enterprise_role']}") end end end diff --git a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/summarizer.rb b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/summarizer.rb index da1e27f37a..ad678dc33b 100644 --- a/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/summarizer.rb +++ b/engines/order_management/app/services/order_management/reports/enterprise_fee_summary/summarizer.rb @@ -22,7 +22,7 @@ module OrderManagement private def representation - @representation ||= representation_klass.new(self) + @representation ||= representation_klass.new(data) end def representation_klass