결함(Bug) #495
closed[Issue] Validate concurrent booking and cancel in Channel API
Added by Joseph Vo 9 months ago. Updated 8 months ago.
Description
Request : resolve concurrent process
- Insert booking and cancel request in DB with UniqueKey: Compcode, ChannelBookingNo, BookingType (Book or Cancel)
- Validate if the exception is Duplicated => wait for previous booking, cancel status.

Files
| picture229-1.png (581 KB) picture229-1.png | Joseph Vo, 06/04/2025 03:22 AM | ||
| 2025-06-06_13-39-16.PNG (175 KB) 2025-06-06_13-39-16.PNG | Anonymous, 06/06/2025 07:10 AM | ||
| 2025-06-06_13-57-26.PNG (43 KB) 2025-06-06_13-57-26.PNG | Anonymous, 06/06/2025 07:11 AM | ||
| 2025-06-06_14-11-32.PNG (77.7 KB) 2025-06-06_14-11-32.PNG | Anonymous, 06/06/2025 07:11 AM | ||
| 2025-06-06_16-46-40.PNG (99.7 KB) 2025-06-06_16-46-40.PNG | Anonymous, 06/06/2025 09:47 AM | ||
| 2025-06-20_17-39-58.PNG (70 KB) 2025-06-20_17-39-58.PNG | Anonymous, 06/20/2025 10:42 AM |
Related issues
Updated by calvin dev 9 months ago
- Start date set to 06/04/2025
CREATE TABLE OMH_SUITE.BK_BOOKING_REQUEST_LOCK(
SELLER_COMP_CODE int NOT NULL COMMENT 'Seller booking comp code',
SELLER_BOOKING_CODE varchar(100) NOT NULL COMMENT 'Seller booking code',
API_SERVICE_TYPE varchar(100) NOT NULL COMMENT 'BOOKING, CANCEL',
LAST_UPDATE_DATETIME datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'last update datetime',
PRIMARY KEY (SELLER_COMP_CODE, SELLER_BOOKING_CODE, API_SERVICE_TYPE)
)
ENGINE = INNODB,
AVG_ROW_LENGTH = 963,
CHARACTER SET utf8mb4,
COLLATE utf8mb4_unicode_ci
Updated by calvin dev 9 months ago
CREATE EVENT IF NOT EXISTS EV_DELETE_BOOKING_REQUEST_LOCK_EXPIRED
ON SCHEDULE EVERY 1 MINUTE
DO
DELETE FROM BK_BOOKING_REQUEST_LOCK
WHERE LAST_UPDATE_DATETIME < NOW - INTERVAL 2 MINUTE;
Updated by calvin dev 9 months ago
- Status changed from 진행(Doing) to 완료(Done)
- % Done changed from 0 to 80
- Build env. set to Dev
Updated by calvin dev 9 months ago
- Due date set to 06/05/2025
- % Done changed from 80 to 100
- Estimated time set to 8.00 h
Updated by calvin dev 9 months ago
Test case:
1/ Booking API
- Test normal booking
- Send 2 requests booking with same seller booking code at the same time.
--> the results of the two requests must be same.
2/ Cancel API
- Test normal cancel
- Send 2 requests cancel with same seller booking code at the same time.
--> If request 1 success, request 2 return: Booking already canceled
--> If request 1 failed, request 2 retry return failed
Updated by calvin dev 9 months ago
curl --location 'https://dev-api-ota-v2.ohmyhotel.com/channel/ota/v2.0/reservation/book' \
--header 'Authorization;' \
--header 'Signature;' \
--header 'Content-Type: application/json' \
--data-raw '{
"nationalityCode": "KR",
"language": "KO",
"channelBookingCode": "AAV014",
"contactPerson": {
"name": "ohmyhotelTest",
"email": "It6@ohmyhotel.com",
"countryPhoneCode": "+84",
"mobileNo": "911180438"
},
"hotelCode": 803104,
"checkInDate": "2025-07-29",
"checkOutDate": "2025-07-30",
"roomTypeCode": "D_109116",
"ratePlanCode": "804382|2^0",
"freeBreakfastName": null,
"rooms": [
{
"roomNo": 1,
"guests": [
{
"lastName": "Ohmyhotel",
"firstName": "Test4",
"gender": "M"
},
{
"lastName": "Ohmyhotel",
"firstName": "Test3",
"gender": "M"
}
]
}
],
"requests": [
{
"code": "BRQ01",
"comment": ""
}
],
"rateType": "standard_rate",
"totalNetAmount": 40.29
}'
Updated by calvin dev 9 months ago
curl --location 'https://dev-api-ota-v2.ohmyhotel.com/channel/ota/v2.0/reservation/book/AAV014/cancel' \
--header 'Signature;' \
--header 'Authorization;'
Updated by Anonymous 9 months ago
- File 2025-06-06_13-39-16.PNG 2025-06-06_13-39-16.PNG added
- File 2025-06-06_13-57-26.PNG 2025-06-06_13-57-26.PNG added
- File 2025-06-06_14-11-32.PNG 2025-06-06_14-11-32.PNG added
Hi calvin dev, the issues were resolved under my test cases below :
- System only displayed a same item after sending 2 requests booking with same seller booking code at the same time -> Passed
- System return error Booking Failed after tried to make booking for cancelled item -> Passed
- Request 2 of the system return message [Booking already cancelled] after cancelling booking from the request 1 -> Passed
- Request 2 of the system return failed when request 1 has returned failed earlier -> Passed
(The request takes around 50 seconds when tried to book a cancelled item again)
Thanks !!!
Updated by calvin dev 9 months ago
(The request takes around 50 seconds when tried to book a cancelled item again)
I updated, please test this case on dev @Kyle Pham
Updated by Anonymous 9 months ago
- File 2025-06-06_16-46-40.PNG 2025-06-06_16-46-40.PNG added
Hi calvin dev
Thanks for your quick fix.
I just rechecked the issue for booking a cancelled order and its only taking 2 seconds instead of 50 seconds earlier.
Updated by ziniy Kang 9 months ago
- Related to 결함(Bug) #166: [VOC-Bug] Wrong remaining allotment for this Hotel 886479 The Stay Classic Myeongdong added
Updated by ziniy Kang 9 months ago
- Assignee changed from calvin dev to Anonymous
Updated by Anonymous 9 months ago
- File 2025-06-20_17-39-58.PNG 2025-06-20_17-39-58.PNG added
Hi calvin dev, I already tested the issue on stg and its working well like dev env.
- System return error Booking Failed after tried to make booking for cancelled item => Passed
- Request 2 of the system return failed when request 1 has returned failed earlier => Passed
(The request takes around 50 seconds when tried to book a cancelled item again)
- System return error Booking Failed after tried to make booking for cancelled item => Passed
- Request 2 of the system return message [Booking already cancelled] after cancelling booking from the request 1 => Passed
Here is the booking that I have checked in stg
https://test-adm.ohmyhotel.com/reservation/hotel/K25062011697H01?tabName=BOOKING_DETAIL
Pls help us merge it into prod.
Thanks !!!
Updated by calvin dev 8 months ago
- Status changed from 완료(Done) to 완료성공(Resolve)