Openbravo Issue Tracking System - Retail Modules
View Issue Details
0055260Retail ModulesRetail API Gift Cardspublic2024-04-08 11:192024-04-23 09:11
gorkaion 
Rajesh_18 
highmajoralways
closedfixed 
5
 
RR24Q2 
No
0055260: Consume GiftCards API returns a 500 error when the coupon is consumed
When the Consume Giftcards API is called with a giftcard that it is already closed 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 new GiftCard instance.
2. Check using the API that the giftcard is available using /org.openbravo.api.ExportService/GiftCard/bySearchKey
3. Consume completelly (with an amount higher than the available) the giftcard using /ws/org.openbravo.retail.api.giftcards.ImportService/ConsumeGiftCard the response is 2XX
4. Check again the giftcard and notice it is closed.
5. Try to consume again the giftcards using the ConsumeGiftcard api, notice that the response is a 500 error. This is wrong, status should be 2XX with a message indicating that the giftcard is already expired/consumed/...
change the response status to 2XX
No tags attached.
blocks defect 0055121 closed Rajesh_18 Consume GiftCards API returns a 500 error when the coupon is consumed 
Issue History
2024-04-19 08:13marvintmTypedefect => backport
2024-04-19 08:13marvintmTarget Version => RR24Q2
2024-04-23 08:48hgbotNote Added: 0163560
2024-04-23 09:11hgbotResolutionopen => fixed
2024-04-23 09:11hgbotStatusscheduled => closed
2024-04-23 09:11hgbotNote Added: 0163571
2024-04-23 09:11hgbotNote Added: 0163572

Notes
(0163560)
hgbot   
2024-04-23 08:48   
Merge Request created: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api.giftcards/-/merge_requests/35 [^]
(0163571)
hgbot   
2024-04-23 09:11   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api.giftcards [^]
Changeset: 71f91ef1badf10a32de32dcd2fa3573238514716
Author: Rajesh Senthilkumar <rajesh@qualiantech.com>
Date: 23-04-2024 12:15:28
URL: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api.giftcards/-/commit/71f91ef1badf10a32de32dcd2fa3573238514716 [^]

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

---
M src/org/openbravo/retail/api/giftcards/service/ConsumeGiftCardApiImportWebService.java
---
(0163572)
hgbot   
2024-04-23 09:11   
Merge request merged: https://gitlab.com/openbravo/product/pmods/org.openbravo.retail.api.giftcards/-/merge_requests/35 [^]