Openbravo Issue Tracking System - Retail Modules
View Issue Details
0055120Retail ModulesRetail APIpublic2024-04-08 11:142024-04-19 08:13
gorkaion 
Rajesh_18 
highmajoralways
closedfixed 
5
 
RR24Q3 
marvintm
No
0055120: Consume Coupons API returns a 500 error when the coupon is consumed
When the Coupons API is called with a coupon that it is already consumed the response has 500 status. The expected result is a 2XX status with an error message since the call has not fail technically.
1. Create a coupon in backend for a single use.
2. Check using the API that the coupon code is available using /org.openbravo.api.ExportService/Coupon/byCouponCode
3. Consume the coupon using /ws/org.openbravo.retail.discounts.coupons.api.ConsumeCoupon the response is 2XX
4. Check again the coupon and notice the coupon is already used.
5. Try to consume again the coupon using the ConsumeCoupon api, notice that the response is a 500 error. This is wrong, status should be 2XX with a message indicating that the coupon is already expired/consumed/...
change the response status to 2XX
No tags attached.
depends on backport 0055258RR24Q2 closed Rajesh_18 Consume Coupons API returns a 500 error when the coupon is consumed 
related to defect 0055121 closed Rajesh_18 Consume GiftCards API returns a 500 error when the coupon is consumed 
Issue History
2024-04-08 11:14gorkaionNew Issue
2024-04-08 11:14gorkaionAssigned To => Triage Platform Conn
2024-04-08 11:14gorkaionTriggers an Emergency Pack => No
2024-04-08 11:19gorkaionIssue cloned0055121
2024-04-08 11:19gorkaionRelationship addedrelated to 0055121
2024-04-08 11:20gorkaionAssigned ToTriage Platform Conn => Retail
2024-04-08 11:23marvintmStatusnew => acknowledged
2024-04-11 08:21Rajesh_18Assigned ToRetail => Rajesh_18
2024-04-11 08:21Rajesh_18Statusacknowledged => scheduled
2024-04-16 11:23hgbotNote Added: 0163259
2024-04-16 12:19hgbotNote Added: 0163273
2024-04-16 12:20hgbotNote Added: 0163274
2024-04-18 13:23hgbotResolutionopen => fixed
2024-04-18 13:23hgbotStatusscheduled => closed
2024-04-18 13:23hgbotNote Added: 0163373
2024-04-18 13:23hgbotNote Added: 0163374
2024-04-19 08:12marvintmStatusclosed => new
2024-04-19 08:12marvintmResolutionfixed => open
2024-04-19 08:12marvintmStatusnew => scheduled
2024-04-19 08:12marvintmStatusscheduled => resolved
2024-04-19 08:12marvintmFixed in Version => RR24Q3
2024-04-19 08:12marvintmResolutionopen => fixed
2024-04-19 08:13marvintmReview Assigned To => marvintm
2024-04-19 08:13marvintmStatusresolved => closed

Notes
(0163259)
hgbot   
2024-04-16 11:23   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/257 [^]
(0163273)
hgbot   
2024-04-16 12:19   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.api/-/merge_requests/15 [^]
(0163274)
hgbot   
2024-04-16 12:20   
Merge request closed: https://gitlab.com/openbravo/product/pmods/org.openbravo.api/-/merge_requests/257 [^]
(0163373)
hgbot   
2024-04-18 13:23   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.api [^]
Changeset: 8e1f335fd6b7944916c5b056fad4f6f8e6d55ef3
Author: Rajesh Senthilkumar <rajesh@qualiantech.com>
Date: 16-04-2024 15:36:28
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.api/-/commit/8e1f335fd6b7944916c5b056fad4f6f8e6d55ef3 [^]

Fixed ISSUE-55120: Catched OBException and returned the response status as 200

---
M src/org/openbravo/retail/discounts/coupons/api/service/ConsumeCoupon.java
---
(0163374)
hgbot   
2024-04-18 13:23   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.discounts.coupons.api/-/merge_requests/15 [^]