diff --git a/ecommerce/pricing/.mutant.yml b/ecommerce/pricing/.mutant.yml index ecf0adcee..26bd2ad34 100644 --- a/ecommerce/pricing/.mutant.yml +++ b/ecommerce/pricing/.mutant.yml @@ -8,4 +8,6 @@ matcher: - Pricing* ignore: - Pricing::Configuration* - - Pricing::Test* \ No newline at end of file + - Pricing::Test* + - Pricing::OnCalculateTotalValue#call + - Pricing::OnCalculateTotalValue#calculate_sub_amounts \ No newline at end of file diff --git a/ecommerce/pricing/lib/pricing/services.rb b/ecommerce/pricing/lib/pricing/services.rb index f719adfde..2c81e233d 100644 --- a/ecommerce/pricing/lib/pricing/services.rb +++ b/ecommerce/pricing/lib/pricing/services.rb @@ -123,12 +123,18 @@ def call(command) @repository.with_aggregate(Order, command.aggregate_id) do |order| order.calculate_total_value(PricingCatalog.new(@event_store), time_promotions_discount) end + rescue WrongExpectedEventVersion + retry end + + def calculate_sub_amounts(command) @repository.with_aggregate(Order, command.aggregate_id) do |order| order.calculate_sub_amounts(PricingCatalog.new(@event_store), time_promotions_discount) end + rescue WrongExpectedEventVersion + retry end private