기능(Feature) #483
Updated by John Lee 9 months ago
*Generate coupon item based on condition of a specific coupon budget*
- Each coupon budget can only be used once based on the USE_YN column
- COUPON_ITEM_CODE is unique and combine with value of DRAFT_CODE in BS_COUPON_BUDGET
- COUPON_ITEM_CODE is a string that is not easily guessed
*Schema of BS_COUPON_ITEM*
COUPON_ITEM_SEQ bigint NOT NULL AUTO_INCREMENT,
COUPON_BUDGET_SEQ bigint NOT NULL,
COUPON_ITEM_CODE varchar(20) NOT NULL COMMENT 'Combine Value of DRAFT_CODE and random characters',
COUPON_NAME_EN varchar(100) NOT NULL,
COUPON_NAME_KO varchar(100) NOT NULL,
COUPON_NAME_JA varchar(100) DEFAULT NULL,
COUPON_NAME_VI varchar(100) DEFAULT NULL,
COUPON_NAME_ZH varchar(100) DEFAULT NULL,
COUPON_DESC varchar(1000) DEFAULT NULL,
ITEM_DETAIL_CATEGORY_CODE_LIST varchar(100) DEFAULT NULL COMMENT 'Reserved Item Detail of Category Code()',
MAX_ISSUE_ABLE_COUNT smallint NOT NULL DEFAULT 1 COMMENT 'Value is the same with value of MAX_USAGE_PER_COUPON in BS_COUPON_BUDGET table',
LEFT_COUPON_COUNT smallint NOT NULL DEFAULT 1 COMMENT 'Initial Value is the same with value of MAX_ISSUE_ABLE_COUNT',
FIRST_INSERT_UNO bigint NOT NULL,
FIRST_INSERT_DATETIME datetime NOT NULL,
LAST_UPDATE_UNO bigint NOT NULL,
LAST_UPDATE_DATETIME datetime NOT NULL,
PRIMARY KEY (COUPON_ITEM_SEQ)
<pre><code class="c">
curl --location 'https://dev-admapi.ohmyhotel.com/booking/hotel/hana/generate-coupon-item' \
--header 'accept: application/json, text/plain, */*' \
--header 'accept-language: en-US,en;q=0.9,ja;q=0.8,fr-FR;q=0.7,fr;q=0.6,en-GB;q=0.5,vi;q=0.4,vi-VN;q=0.3' \
--header 'content-type: application/json' \
--header 'origin: https://dev-adm.ohmyhotel.com' \
--header 'priority: u=1, i' \
--header 'referer: https://dev-adm.ohmyhotel.com/' \
--header 'sec-ch-ua: "Chromium";v="136", "Google Chrome";v="136", "Not.A/Brand";v="99"' \
--header 'sec-ch-ua-mobile: ?0' \
--header 'sec-ch-ua-platform: "Windows"' \
--header 'sec-fetch-dest: empty' \
--header 'sec-fetch-mode: cors' \
--header 'sec-fetch-site: same-site' \
--header 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36' \
--header 'usertoken: affiliateTest' \
--data '{
"language": "EN",
"country": "KR",
"stationTypeCode": "STN03",
"currency": "KRW",
"condition": {
"couponBudgetSeq": 100014
}
}'
</code></pre>