Skip to content

Commit

Permalink
Invoiced read model wasn't ready for async
Browse files Browse the repository at this point in the history
Reverted this to sync jobs. Otherwise it created many invoice records per one order. This resulted in a user bug, where providing billing address didnt allow issuing an invoice.
Hard to write tests for this - maybe we should use "real" sidekiq in integration tests?
  • Loading branch information
andrzejkrzywda committed Dec 18, 2023
1 parent 66ecf27 commit e240d37
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rails_application/app/read_models/invoices/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class Order < ApplicationRecord

class Configuration
def call(event_store)
event_store.subscribe(CreateInvoiceItem, to: [Invoicing::InvoiceItemAdded])
event_store.subscribe(SetBillingAddress, to: [Invoicing::BillingAddressSet])
event_store.subscribe(SetPaymentDate, to: [Invoicing::InvoicePaymentDateSet])
event_store.subscribe(MarkAsIssued, to: [Invoicing::InvoiceIssued])
event_store.subscribe(MarkOrderSubmitted, to: [Ordering::OrderSubmitted])
event_store.subscribe(CreateInvoiceItem.new, to: [Invoicing::InvoiceItemAdded])
event_store.subscribe(SetBillingAddress.new, to: [Invoicing::BillingAddressSet])
event_store.subscribe(SetPaymentDate.new, to: [Invoicing::InvoicePaymentDateSet])
event_store.subscribe(MarkAsIssued.new, to: [Invoicing::InvoiceIssued])
event_store.subscribe(MarkOrderSubmitted.new, to: [Ordering::OrderSubmitted])
end
end
end

0 comments on commit e240d37

Please sign in to comment.