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

Add service to order copy cards #570

Merged
merged 3 commits into from
Dec 3, 2019
Merged

Conversation

cintamani
Copy link
Contributor

From: https://eaflood.atlassian.net/browse/RUBY-767

Add a reusable service that given a registration, a user, a number of copy cards and a user, generates a copy cards only order

From: https://eaflood.atlassian.net/browse/RUBY-767

Add a reusable service that given a registration, a user, a number of copy cards and a user, generates a copy cards only order
@cintamani cintamani added the enhancement New feature or request label Nov 29, 2019
@cintamani cintamani self-assigned this Nov 29, 2019
Copy link
Member

@Cruikshanks Cruikshanks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started going through what WCR Frontend does and found

So gave up!

From what I'm reading it looks correct. I'm just commenting on what order to do things

  • add the new functionality and then refactor the current order method
  • or refactor the existing process first, then have the new functionality follow the same pattern

I'm voting for the later but could be shouted down.

@@ -25,19 +25,12 @@ class Order
field :manualOrder, as: :manual_order, type: String
field :order_item_reference, type: String

# TODO: Move to a service
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the intention is to move this to an OrderRenewalService (or something like that) would it be better to do that refactoring first and then add your new service?

As is I'm just not sure I like the idea that if we never get round to this TODO we'll have Order create the order with new_order, set the order items as if its a renewal, but then OrderAdditionalCardsService take that order and simply overwrites the array. Plus we're creating orders in 2 different ways.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This service do not use the code in new_order so I have left the TODO for the next person touching it. We should get there naturally when we work out the front end flow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂ Yep, was pointed out to me I was misreading the changes!

@cintamani cintamani changed the title Add service to order copy cards [TBD] Add service to order copy cards Dec 2, 2019
@@ -25,19 +25,12 @@ class Order
field :manualOrder, as: :manual_order, type: String
field :order_item_reference, type: String

# TODO: Move to a service
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦‍♂ Yep, was pointed out to me I was misreading the changes!

@cintamani cintamani changed the title [TBD] Add service to order copy cards Add service to order copy cards Dec 3, 2019
@cintamani
Copy link
Contributor Author

I am pretty sure I actually need this as it is now, so I am merging this in

@cintamani cintamani merged commit 8c34a40 into master Dec 3, 2019
@cintamani cintamani deleted the add-cards-order-service branch December 3, 2019 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants