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

Deprecate existing coupon codes methods #2958

Merged

Conversation

aitbw
Copy link
Contributor

@aitbw aitbw commented Nov 19, 2018

Hi! 👋

Following @kennyadsl's idea on #2327, this PR aims to deprecate current endpoints used to apply coupon codes (on orders and checkout) and replace them with a new API endpoint properly named Spree::Api::CouponCodesController. This was also done for the frontend with Spree::CouponCodesController.

I think this approach allows a better separation of concerns and it's easier to reason about. Plus, it'd be easier to implement a built-in solution for #1641.

I'm open to suggestions!

@aitbw aitbw force-pushed the nebulab/deprecate_coupon_code_methods branch from 66eac4c to 4559a00 Compare November 19, 2018 19:14
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

Great job!! Just a small concern, should we test somewhere that users can't add a coupon code to someone else's orders? That should be handled by the permissions system but I'm not sure we are using that here. Can you please take a look?

@aitbw
Copy link
Contributor Author

aitbw commented Nov 20, 2018

Noted @kennyadsl 👌 let me have a look on that

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

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

Thanks!

@jacobherrington jacobherrington merged commit d7dc5dc into solidusio:master Nov 29, 2018
@aitbw aitbw deleted the nebulab/deprecate_coupon_code_methods branch November 29, 2018 01:53
aitbw added a commit to aitbw/solidus_tax_cloud that referenced this pull request Jan 29, 2019
solidusio/solidus#2958 replaced `order_coupon_code` text field for
`coupon_code`, which broke master build. This patch fixes this
regression.
aitbw added a commit to aitbw/solidus_tax_cloud that referenced this pull request Jan 29, 2019
solidusio/solidus#2958 replaced `order_coupon_code` text field for
`coupon_code`, which broke master build. This patch fixes this
regression.
aitbw added a commit to aitbw/solidus_tax_cloud that referenced this pull request Jan 29, 2019
solidusio/solidus#2958 replaced `order_coupon_code` text field for
`coupon_code`, which broke master build. This patch fixes this
regression.
aitbw added a commit to aitbw/solidus_tax_cloud that referenced this pull request Jan 29, 2019
solidusio/solidus#2958 replaced `order_coupon_code` text field for
`coupon_code`, which broke master build. This patch fixes this
regression.
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

Successfully merging this pull request may close these issues.

3 participants