Project

General

Profile

Actions

결함(Bug) #495

closed

[Issue] Validate concurrent booking and cancel in Channel API

Added by Joseph Vo 9 months ago. Updated 8 months ago.

Status:
완료성공(Resolve)
Priority:
높음(High)
Assignee:
Start date:
06/04/2025
Due date:
06/05/2025
% Done:

100%

Estimated time:
8.00 h
Spent time:
Part:
Build env.:
Prod

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

Related to VOC - 결함(Bug) #166: [VOC-Bug] Wrong remaining allotment for this Hotel 886479 The Stay Classic Myeongdong완료성공(Resolve)Daniel Do05/12/202506/03/2025

Actions
Actions #1

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

Actions #2

Updated by calvin dev 9 months ago

  • Status changed from 신규(New) to 진행(Doing)
Actions #3

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;

Actions #4

Updated by calvin dev 9 months ago

  • Status changed from 진행(Doing) to 완료(Done)
  • % Done changed from 0 to 80
  • Build env. set to Dev
Actions #5

Updated by calvin dev 9 months ago

Please test on dev

Actions #6

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
Actions #7

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

Actions #8

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": "",
"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
}'

Actions #9

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;'

Actions #10

Updated by Anonymous 9 months ago

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 !!!

Actions #11

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

Actions #12

Updated by Anonymous 9 months ago

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.

Actions #13

Updated by calvin dev 9 months ago

  • Build env. changed from Dev to Staging

Already deploy on staging

Actions #14

Updated by calvin dev 9 months ago

Please test on staging!!!!!!!

Actions #15

Updated by calvin dev 9 months ago

please test on staging!

Actions #16

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
Actions #17

Updated by ziniy Kang 9 months ago

  • Assignee changed from calvin dev to Anonymous
Actions #18

Updated by Anonymous 9 months ago

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 !!!

Actions #19

Updated by Anonymous 9 months ago

  • Assignee changed from Anonymous to calvin dev
Actions #20

Updated by calvin dev 8 months ago

  • Build env. changed from Staging to Prod

deployed prod

Actions #21

Updated by calvin dev 8 months ago

  • Status changed from 완료(Done) to 완료성공(Resolve)
Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 50 MB)