Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider if invariant in Crm::Order is really needed #266

Open
pjurewicz opened this issue Jan 26, 2023 · 0 comments
Open

Consider if invariant in Crm::Order is really needed #266

pjurewicz opened this issue Jan 26, 2023 · 0 comments

Comments

@pjurewicz
Copy link
Collaborator

pjurewicz commented Jan 26, 2023

After dealing with #225, it is possible for Ordering::Order to return to a draft state after being rejected.
Since, these two commands are called together:

command_bus.(Ordering::SubmitOrder.new(order_id: params[:order_id]))
command_bus.(Crm::AssignCustomerToOrder.new(customer_id: cookies[:client_id], order_id: params[:order_id]))

It causes a problem when resubmitting rejected Order because of this invariant:

raise CustomerAlreadyAssigned if @customer_id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant