@vendit-dev/thirdparty-adapters 0.7.21 → 0.7.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/codeStyles/Project.xml +50 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/thirdparty-adapters.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/lib/adapters/externalChannelManagers/tl-lincoln.helper.d.ts +2 -2
- package/lib/adapters/externalChannelManagers/tl-lincoln.helper.js +110 -94
- package/lib/adapters/externalChannelManagers/tl-sample.d.ts +1218 -0
- package/lib/adapters/externalChannelManagers/tl-sample.js +3974 -0
- package/package.json +1 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
+
<code_scheme name="Project" version="173">
|
|
3
|
+
<JSCodeStyleSettings version="0">
|
|
4
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
5
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
6
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
7
|
+
<option name="VAR_DECLARATION_WRAP" value="2" />
|
|
8
|
+
<option name="OBJECT_LITERAL_WRAP" value="2" />
|
|
9
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
10
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
11
|
+
</JSCodeStyleSettings>
|
|
12
|
+
<TypeScriptCodeStyleSettings version="0">
|
|
13
|
+
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
14
|
+
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
15
|
+
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
16
|
+
<option name="VAR_DECLARATION_WRAP" value="2" />
|
|
17
|
+
<option name="OBJECT_LITERAL_WRAP" value="2" />
|
|
18
|
+
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
19
|
+
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
20
|
+
</TypeScriptCodeStyleSettings>
|
|
21
|
+
<codeStyleSettings language="JavaScript">
|
|
22
|
+
<option name="BLOCK_COMMENT_ADD_SPACE" value="true" />
|
|
23
|
+
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
|
|
24
|
+
<option name="ALIGN_MULTILINE_FOR" value="false" />
|
|
25
|
+
<option name="METHOD_CALL_CHAIN_WRAP" value="2" />
|
|
26
|
+
<option name="IF_BRACE_FORCE" value="1" />
|
|
27
|
+
<option name="DOWHILE_BRACE_FORCE" value="1" />
|
|
28
|
+
<option name="WHILE_BRACE_FORCE" value="1" />
|
|
29
|
+
<option name="FOR_BRACE_FORCE" value="1" />
|
|
30
|
+
<indentOptions>
|
|
31
|
+
<option name="INDENT_SIZE" value="2" />
|
|
32
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
33
|
+
</indentOptions>
|
|
34
|
+
</codeStyleSettings>
|
|
35
|
+
<codeStyleSettings language="TypeScript">
|
|
36
|
+
<option name="BLOCK_COMMENT_ADD_SPACE" value="true" />
|
|
37
|
+
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
|
|
38
|
+
<option name="ALIGN_MULTILINE_FOR" value="false" />
|
|
39
|
+
<option name="METHOD_CALL_CHAIN_WRAP" value="2" />
|
|
40
|
+
<option name="IF_BRACE_FORCE" value="1" />
|
|
41
|
+
<option name="DOWHILE_BRACE_FORCE" value="1" />
|
|
42
|
+
<option name="WHILE_BRACE_FORCE" value="1" />
|
|
43
|
+
<option name="FOR_BRACE_FORCE" value="1" />
|
|
44
|
+
<indentOptions>
|
|
45
|
+
<option name="INDENT_SIZE" value="2" />
|
|
46
|
+
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
47
|
+
</indentOptions>
|
|
48
|
+
</codeStyleSettings>
|
|
49
|
+
</code_scheme>
|
|
50
|
+
</component>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/thirdparty-adapters.iml" filepath="$PROJECT_DIR$/.idea/thirdparty-adapters.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
package/.idea/vcs.xml
ADDED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ExternalReservation, ExternalReservationType, ReservationStatus } from
|
|
2
|
-
import { type BasicInformation as TBasicInformation, type DataClassificationType, type InfoTravelXML, type MealConditionType, type RoomInformation, type SpecificMealConditionType } from
|
|
1
|
+
import type { ExternalReservation, ExternalReservationType, ReservationStatus } from './externalChannelManager.type';
|
|
2
|
+
import { type BasicInformation as TBasicInformation, type DataClassificationType, type InfoTravelXML, type MealConditionType, type RoomInformation, type SpecificMealConditionType } from './tl-lincoln.types';
|
|
3
3
|
interface CommonRequest {
|
|
4
4
|
systemId: string;
|
|
5
5
|
pmsUserId: string;
|
|
@@ -36,11 +36,11 @@ function jsonToXml(json) {
|
|
|
36
36
|
};
|
|
37
37
|
var builder = new fast_xml_parser_1.XMLBuilder(options);
|
|
38
38
|
var xmlContent = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
'soapenv:Envelope': {
|
|
40
|
+
'@_xmlns:soapenv': 'http://schemas.xmlsoap.org/soap/envelope/',
|
|
41
|
+
'@_xmlns:pms': json.pmsUrl,
|
|
42
|
+
'soapenv:Body': {
|
|
43
|
+
'pms:execute': {
|
|
44
44
|
arg0: __assign({ commonRequest: __assign({}, json.commonRequest) }, json.request),
|
|
45
45
|
},
|
|
46
46
|
},
|
|
@@ -53,7 +53,7 @@ function xmlToJson(xml) {
|
|
|
53
53
|
// 
 문자는 제거하고 파싱합니다.
|
|
54
54
|
try {
|
|
55
55
|
var parser = new fast_xml_parser_1.XMLParser();
|
|
56
|
-
return parser.parse(xml.replace(/
/g,
|
|
56
|
+
return parser.parse(xml.replace(/
/g, ''));
|
|
57
57
|
}
|
|
58
58
|
catch (e) {
|
|
59
59
|
console.error("xmlToJson failed: ".concat(e));
|
|
@@ -63,46 +63,46 @@ function xmlToJson(xml) {
|
|
|
63
63
|
exports.xmlToJson = xmlToJson;
|
|
64
64
|
function getReservationStatusFromDataClassification(dataClassification) {
|
|
65
65
|
switch (dataClassification) {
|
|
66
|
-
case
|
|
67
|
-
case
|
|
68
|
-
return
|
|
69
|
-
case
|
|
70
|
-
return
|
|
66
|
+
case 'NewBookReport':
|
|
67
|
+
case 'ModificationReport':
|
|
68
|
+
return 'RESERVED';
|
|
69
|
+
case 'CancellationReport':
|
|
70
|
+
return 'CANCELLED';
|
|
71
71
|
default:
|
|
72
|
-
return
|
|
72
|
+
return 'RESERVED';
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
exports.getReservationStatusFromDataClassification = getReservationStatusFromDataClassification;
|
|
76
76
|
function getExternalReservationTypeFromDataClassification(dataClassification) {
|
|
77
77
|
switch (dataClassification) {
|
|
78
|
-
case
|
|
79
|
-
return
|
|
80
|
-
case
|
|
81
|
-
return
|
|
82
|
-
case
|
|
83
|
-
return
|
|
78
|
+
case 'NewBookReport':
|
|
79
|
+
return 'CREATED';
|
|
80
|
+
case 'ModificationReport':
|
|
81
|
+
return 'UPDATED';
|
|
82
|
+
case 'CancellationReport':
|
|
83
|
+
return 'CANCELLED';
|
|
84
84
|
default:
|
|
85
|
-
return
|
|
85
|
+
return 'CREATED';
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
exports.getExternalReservationTypeFromDataClassification = getExternalReservationTypeFromDataClassification;
|
|
89
89
|
var getSpecificMealConditionText = function (_specificType) {
|
|
90
90
|
switch (_specificType) {
|
|
91
|
-
case
|
|
92
|
-
return [
|
|
93
|
-
case
|
|
94
|
-
return [
|
|
95
|
-
case
|
|
96
|
-
return [
|
|
97
|
-
case
|
|
98
|
-
return [
|
|
99
|
-
case
|
|
100
|
-
return [
|
|
101
|
-
case
|
|
102
|
-
return [
|
|
103
|
-
case
|
|
104
|
-
return [
|
|
105
|
-
case
|
|
91
|
+
case 'IncludingBreakfast':
|
|
92
|
+
return ['조식'];
|
|
93
|
+
case 'IncludingLunch':
|
|
94
|
+
return ['중식'];
|
|
95
|
+
case 'IncludingDinner':
|
|
96
|
+
return ['석식'];
|
|
97
|
+
case 'IncludingLunchAndDinner':
|
|
98
|
+
return ['중식', '석식'];
|
|
99
|
+
case 'IncludingBreakfastAndLunch':
|
|
100
|
+
return ['조식', '중식'];
|
|
101
|
+
case 'IncludingBreakfastAndDinner':
|
|
102
|
+
return ['조식', '석식'];
|
|
103
|
+
case 'IncludingBreakfastAndLunchAndDinner':
|
|
104
|
+
return ['조식', '중식', '석식'];
|
|
105
|
+
case 'None Specified':
|
|
106
106
|
return [];
|
|
107
107
|
default:
|
|
108
108
|
return [];
|
|
@@ -110,12 +110,12 @@ var getSpecificMealConditionText = function (_specificType) {
|
|
|
110
110
|
};
|
|
111
111
|
var getMealConditionText = function (_mealCondition) {
|
|
112
112
|
switch (_mealCondition) {
|
|
113
|
-
case
|
|
114
|
-
return
|
|
115
|
-
case
|
|
116
|
-
return
|
|
113
|
+
case '1night2meals':
|
|
114
|
+
return '1박2식';
|
|
115
|
+
case '1nightBreakfast':
|
|
116
|
+
return '1박조식';
|
|
117
117
|
default:
|
|
118
|
-
return
|
|
118
|
+
return '조식 없음';
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
121
|
function groupByRoomWithTotalCounts(roomAndRoomRateInformations, totalRoomCount) {
|
|
@@ -143,43 +143,59 @@ function groupByRoomWithTotalCounts(roomAndRoomRateInformations, totalRoomCount)
|
|
|
143
143
|
var formattedNameForMealCondition = function (mealCondition, specificMealCondition) {
|
|
144
144
|
var _a;
|
|
145
145
|
return "".concat(getMealConditionText(mealCondition)).concat(((_a = getSpecificMealConditionText(specificMealCondition)) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
146
|
-
? "(".concat(getSpecificMealConditionText(specificMealCondition).join(
|
|
147
|
-
:
|
|
146
|
+
? "(".concat(getSpecificMealConditionText(specificMealCondition).join(', '), ")")
|
|
147
|
+
: '');
|
|
148
148
|
};
|
|
149
149
|
exports.formattedNameForMealCondition = formattedNameForMealCondition;
|
|
150
150
|
var formattedPaxCountText = function (roomInformation, genderDivision) {
|
|
151
|
-
if (
|
|
151
|
+
if ('RoomPaxMaleCount' in roomInformation) {
|
|
152
152
|
var _a = roomInformation, _b = _a.RoomPaxMaleCount, RoomPaxMaleCount = _b === void 0 ? 0 : _b, _c = _a.RoomPaxFemaleCount, RoomPaxFemaleCount = _c === void 0 ? 0 : _c, _d = _a.RoomChildA70Count, RoomChildA70Count = _d === void 0 ? 0 : _d, _e = _a.RoomChildB50Count, RoomChildB50Count = _e === void 0 ? 0 : _e, _f = _a.RoomChildC30Count, RoomChildC30Count = _f === void 0 ? 0 : _f, _g = _a.RoomChildDNoneCount, RoomChildDNoneCount = _g === void 0 ? 0 : _g, _h = _a.RoomChildOtherCount, RoomChildOtherCount = _h === void 0 ? 0 : _h;
|
|
153
153
|
return "".concat([
|
|
154
154
|
genderDivision
|
|
155
155
|
? "\uB0A8 ".concat(RoomPaxMaleCount, "\uBA85, \uC5EC ").concat(RoomPaxFemaleCount, "\uBA85")
|
|
156
156
|
: "\uC131\uC778 ".concat(RoomPaxMaleCount + RoomPaxFemaleCount, "\uBA85"),
|
|
157
|
-
RoomChildA70Count ? "\uD559\uC0DD ".concat(RoomChildA70Count, "\uBA85") :
|
|
157
|
+
RoomChildA70Count ? "\uD559\uC0DD ".concat(RoomChildA70Count, "\uBA85") : '',
|
|
158
158
|
RoomChildB50Count || RoomChildC30Count || RoomChildOtherCount
|
|
159
159
|
? "\uC544\uB3D9 ".concat(RoomChildB50Count + RoomChildC30Count + RoomChildOtherCount, "\uBA85")
|
|
160
|
-
:
|
|
161
|
-
RoomChildDNoneCount ? "\uC720\uC544 ".concat(RoomChildDNoneCount, "\uBA85") :
|
|
160
|
+
: '',
|
|
161
|
+
RoomChildDNoneCount ? "\uC720\uC544 ".concat(RoomChildDNoneCount, "\uBA85") : '',
|
|
162
162
|
]
|
|
163
163
|
.filter(Boolean)
|
|
164
|
-
.join(
|
|
164
|
+
.join(', '));
|
|
165
165
|
}
|
|
166
166
|
var _j = roomInformation, _k = _j.TotalPaxMaleCount, TotalPaxMaleCount = _k === void 0 ? 0 : _k, _l = _j.TotalPaxFemaleCount, TotalPaxFemaleCount = _l === void 0 ? 0 : _l, _m = _j.TotalChildA70Count, TotalChildA70Count = _m === void 0 ? 0 : _m, _o = _j.TotalChildB50Count, TotalChildB50Count = _o === void 0 ? 0 : _o, _p = _j.TotalChildC30Count, TotalChildC30Count = _p === void 0 ? 0 : _p, _q = _j.TotalChildDNoneCount, TotalChildDNoneCount = _q === void 0 ? 0 : _q, _r = _j.TotalChildOtherCount, TotalChildOtherCount = _r === void 0 ? 0 : _r;
|
|
167
167
|
return "".concat([
|
|
168
168
|
genderDivision
|
|
169
169
|
? "\uB0A8 ".concat(TotalPaxMaleCount, "\uBA85, \uC5EC ").concat(TotalPaxFemaleCount, "\uBA85")
|
|
170
170
|
: "\uC131\uC778 ".concat(TotalPaxMaleCount + TotalPaxFemaleCount, "\uBA85"),
|
|
171
|
-
TotalChildA70Count ? "\uD559\uC0DD ".concat(TotalChildA70Count, "\uBA85") :
|
|
171
|
+
TotalChildA70Count ? "\uD559\uC0DD ".concat(TotalChildA70Count, "\uBA85") : '',
|
|
172
172
|
TotalChildB50Count || TotalChildC30Count || TotalChildOtherCount
|
|
173
173
|
? "\uC544\uB3D9 ".concat(TotalChildB50Count + TotalChildC30Count + TotalChildOtherCount, "\uBA85")
|
|
174
|
-
:
|
|
175
|
-
TotalChildDNoneCount ? "\uC720\uC544 ".concat(TotalChildDNoneCount, "\uBA85") :
|
|
174
|
+
: '',
|
|
175
|
+
TotalChildDNoneCount ? "\uC720\uC544 ".concat(TotalChildDNoneCount, "\uBA85") : '',
|
|
176
176
|
]
|
|
177
177
|
.filter(Boolean)
|
|
178
|
-
.join(
|
|
178
|
+
.join(', '));
|
|
179
179
|
};
|
|
180
180
|
exports.formattedPaxCountText = formattedPaxCountText;
|
|
181
181
|
function formatPhoneNumber(text) {
|
|
182
|
-
var onlyNumberText = text === null || text === void 0 ? void 0 : text.replace(/[
|
|
182
|
+
var onlyNumberText = text === null || text === void 0 ? void 0 : text.replace(/[^0-9+]/g, '');
|
|
183
|
+
var safeNumberRegex = /^0?50[0-9]{8,9}$/;
|
|
184
|
+
// +로 시작하는 경우 처리
|
|
185
|
+
if (text === null || text === void 0 ? void 0 : text.startsWith('+')) {
|
|
186
|
+
// +82로 시작하는 경우
|
|
187
|
+
if (text.startsWith('+82')) {
|
|
188
|
+
return onlyNumberText ? "0".concat(onlyNumberText.slice(3)) : '';
|
|
189
|
+
}
|
|
190
|
+
// 그 외 국제번호의 경우
|
|
191
|
+
return text.replace(/[+\s]/g, '');
|
|
192
|
+
}
|
|
193
|
+
if (safeNumberRegex.test(onlyNumberText || '')) {
|
|
194
|
+
if (onlyNumberText === null || onlyNumberText === void 0 ? void 0 : onlyNumberText.startsWith('50')) {
|
|
195
|
+
return "0".concat(onlyNumberText);
|
|
196
|
+
}
|
|
197
|
+
return onlyNumberText;
|
|
198
|
+
}
|
|
183
199
|
return onlyNumberText;
|
|
184
200
|
}
|
|
185
201
|
var makePaymentInfo = function (_a) {
|
|
@@ -201,16 +217,16 @@ var makePaymentInfo = function (_a) {
|
|
|
201
217
|
(_b = paymentInput.segments) === null || _b === void 0 ? void 0 : _b.push({
|
|
202
218
|
amount: roomAmount,
|
|
203
219
|
servedAt: RoomRateInformation.RoomDate,
|
|
204
|
-
referenceType:
|
|
220
|
+
referenceType: 'RESERVATION',
|
|
205
221
|
referenceSubType: reservationType,
|
|
206
222
|
});
|
|
207
|
-
if (basicInformation.MealCondition !==
|
|
208
|
-
basicInformation.MealCondition !==
|
|
223
|
+
if (basicInformation.MealCondition !== 'Other' &&
|
|
224
|
+
basicInformation.MealCondition !== 'WithoutMeal') {
|
|
209
225
|
paymentInput.amount += (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomServiceFee) || 0;
|
|
210
226
|
(_c = paymentInput.segments) === null || _c === void 0 ? void 0 : _c.push({
|
|
211
227
|
amount: (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomServiceFee) || 0,
|
|
212
228
|
servedAt: RoomRateInformation.RoomDate,
|
|
213
|
-
referenceType:
|
|
229
|
+
referenceType: 'SERVICE',
|
|
214
230
|
referenceSubType: (0, exports.formattedNameForMealCondition)(basicInformation.MealCondition, basicInformation.SpecificMealCondition),
|
|
215
231
|
});
|
|
216
232
|
}
|
|
@@ -218,47 +234,47 @@ var makePaymentInfo = function (_a) {
|
|
|
218
234
|
(_d = paymentInput.segments) === null || _d === void 0 ? void 0 : _d.push.apply(_d, OptionList.map(function (option) { return ({
|
|
219
235
|
amount: 0,
|
|
220
236
|
servedAt: option.OptionDate,
|
|
221
|
-
referenceType:
|
|
237
|
+
referenceType: 'SERVICE',
|
|
222
238
|
referenceSubType: option.Name,
|
|
223
239
|
}); }));
|
|
224
240
|
}
|
|
225
241
|
return Object.assign(paymentInput, {
|
|
226
242
|
reservationType: reservationType,
|
|
227
|
-
type:
|
|
243
|
+
type: 'platform',
|
|
228
244
|
externalRoomTypeCode: datas[0].RoomInformation.NetRmTypeGroupCode,
|
|
229
245
|
externalRoomTypeName: datas[0].RoomInformation.RoomTypeName,
|
|
230
246
|
useStartAt: "".concat(datas[0].RoomRateInformation.RoomDate).concat((basicInformation === null || basicInformation === void 0 ? void 0 : basicInformation.CheckInTime)
|
|
231
247
|
? " ".concat(basicInformation === null || basicInformation === void 0 ? void 0 : basicInformation.CheckInTime)
|
|
232
|
-
:
|
|
248
|
+
: ''),
|
|
233
249
|
});
|
|
234
250
|
}, {
|
|
235
251
|
amount: 0,
|
|
236
252
|
commissionAmount: 0,
|
|
237
|
-
reservationType:
|
|
253
|
+
reservationType: 'lodge',
|
|
238
254
|
segments: [],
|
|
239
|
-
externalRoomTypeCode:
|
|
240
|
-
externalRoomTypeName:
|
|
241
|
-
type:
|
|
242
|
-
useStartAt:
|
|
255
|
+
externalRoomTypeCode: '',
|
|
256
|
+
externalRoomTypeName: '',
|
|
257
|
+
type: 'platform',
|
|
258
|
+
useStartAt: '',
|
|
243
259
|
});
|
|
244
260
|
};
|
|
245
261
|
var refineReservationData = function (infoTravelXML) {
|
|
246
262
|
var _a, _b;
|
|
247
263
|
var _c = infoTravelXML.AllotmentBookingReport, TransactionType = _c.TransactionType, RisaplsInformation = _c.RisaplsInformation, BasicInformation = _c.BasicInformation, BasicRateInformation = _c.BasicRateInformation, SalesOfficeInformation = _c.SalesOfficeInformation;
|
|
248
|
-
var _d = TransactionType.DataID.split(
|
|
264
|
+
var _d = TransactionType.DataID.split('-'), ID = _d[0], REVISION = _d[1];
|
|
249
265
|
var isGroupReservation = BasicInformation.TotalRoomCount > 1;
|
|
250
266
|
var RisaplsCommonInformation = RisaplsInformation.RisaplsCommonInformation, AgentNativeInformation = RisaplsInformation.AgentNativeInformation;
|
|
251
267
|
var RoomAndRoomRateInformation = RisaplsCommonInformation.RoomAndRoomRateInformation, Allotment = RisaplsCommonInformation.Allotment, Member = RisaplsCommonInformation.Member, OtherInfo = RisaplsCommonInformation.OtherInfo, Basic = RisaplsCommonInformation.Basic, BasicRate = RisaplsCommonInformation.BasicRate, Option = RisaplsCommonInformation.Option;
|
|
252
268
|
var isFullyPaid = !!((_a = AgentNativeInformation === null || AgentNativeInformation === void 0 ? void 0 : AgentNativeInformation.Extendmytrip) === null || _a === void 0 ? void 0 : _a.SettlementDiv) &&
|
|
253
269
|
!((_b = AgentNativeInformation === null || AgentNativeInformation === void 0 ? void 0 : AgentNativeInformation.Extend) === null || _b === void 0 ? void 0 : _b.AmountClaimed) &&
|
|
254
|
-
(BasicRateInformation === null || BasicRateInformation === void 0 ? void 0 : BasicRateInformation.Payment) !==
|
|
270
|
+
(BasicRateInformation === null || BasicRateInformation === void 0 ? void 0 : BasicRateInformation.Payment) !== 'Hotel Collect';
|
|
255
271
|
var roomAndRoomRateInformations = (0, tl_lincoln_types_1.makeArray)(RoomAndRoomRateInformation);
|
|
256
272
|
var groupedRooms = groupByRoomWithTotalCounts(roomAndRoomRateInformations, BasicInformation.TotalRoomCount);
|
|
257
273
|
var status = getReservationStatusFromDataClassification(TransactionType.DataClassification);
|
|
258
|
-
var useStartAt = "".concat(BasicInformation.CheckInDate).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime) ? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime) :
|
|
274
|
+
var useStartAt = "".concat(BasicInformation.CheckInDate).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime) ? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime) : '');
|
|
259
275
|
var useExpireAt = "".concat((0, moment_1.default)(BasicInformation.CheckInDate)
|
|
260
|
-
.add(BasicInformation.Nights,
|
|
261
|
-
.format(
|
|
276
|
+
.add(BasicInformation.Nights, 'days')
|
|
277
|
+
.format('YYYY-MM-DD')).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime) ? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime) : '');
|
|
262
278
|
var PointDiscountList = [];
|
|
263
279
|
if (BasicRate === null || BasicRate === void 0 ? void 0 : BasicRate.PointsDiscountList) {
|
|
264
280
|
PointDiscountList = (0, tl_lincoln_types_1.makeArray)(BasicRate.PointsDiscountList);
|
|
@@ -276,28 +292,28 @@ var refineReservationData = function (infoTravelXML) {
|
|
|
276
292
|
(Member === null || Member === void 0 ? void 0 : Member.UserName) ||
|
|
277
293
|
"".concat(BasicInformation.GuestOrGroupNameKanjiName), " ").concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.PackagePlanName, "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.GuestRequest)
|
|
278
294
|
? "[\uC694\uCCAD\uC0AC\uD56D]\n".concat(OtherInfo.GuestRequest)
|
|
279
|
-
:
|
|
295
|
+
: '', "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.AdditionalInformation)
|
|
280
296
|
? "[\uCD94\uAC00\uC815\uBCF4]\n".concat(OtherInfo.AdditionalInformation)
|
|
281
|
-
:
|
|
297
|
+
: '', "\n").concat((0, exports.formattedPaxCountText)(BasicInformation), "\n[\uACB0\uC81C\uC815\uBCF4]\n\uC9C0\uBD88\uC218\uB2E8: ").concat(BasicRateInformation.Payment || '정보 없음', "\n").concat(BasicRateInformation.Payment === 'CreditCard'
|
|
282
298
|
? "\uCE74\uB4DC\uC0AC\uBA85: ".concat(BasicRateInformation.CreditCardAuthority, "\n\uCE74\uB4DC\uBC88\uD638: ").concat(BasicRateInformation.CreditCardNumber, "\n\uC720\uD6A8\uAE30\uAC04: ").concat(BasicRateInformation.ExpireDate, "\n\uC18C\uC9C0\uC790\uBA85: ").concat(BasicRateInformation.CardHolderName, "\n\uC774\uC804 \uCDE8\uC18C\uAE08\uC561: ").concat(BasicRateInformation.CancellationCharge, "\n")
|
|
283
|
-
:
|
|
299
|
+
: '', "\n\uC218\uC218\uB8CC\uC728: ").concat(BasicRateInformation.CommissionPercentage
|
|
284
300
|
? "".concat(BasicRateInformation.CommissionPercentage, "%")
|
|
285
|
-
:
|
|
301
|
+
: '정보 없음', "\n\uC218\uC218\uB8CC \uCD1D\uC561: ").concat(BasicRateInformation.TotalAccommodationCommissionAmount
|
|
286
302
|
? "".concat(BasicRateInformation.TotalAccommodationCommissionAmount, "\uC6D0")
|
|
287
|
-
:
|
|
288
|
-
? "".concat(PointDiscountList.map(function (point) { return "".concat(point.PointsDiscountName, ": ").concat(point.PointsDiscount); }).join(
|
|
289
|
-
:
|
|
290
|
-
status:
|
|
291
|
-
phone: formatPhoneNumber("".concat((Member === null || Member === void 0 ? void 0 : Member.UserTel) || Basic.PhoneNumber ||
|
|
303
|
+
: '정보 없음', "\n[\uD560\uC778\uC815\uBCF4]\n").concat((PointDiscountList === null || PointDiscountList === void 0 ? void 0 : PointDiscountList.length) > 0
|
|
304
|
+
? "".concat(PointDiscountList.map(function (point) { return "".concat(point.PointsDiscountName, ": ").concat(point.PointsDiscount); }).join('\n'))
|
|
305
|
+
: ''),
|
|
306
|
+
status: 'reserved',
|
|
307
|
+
phone: formatPhoneNumber("".concat((Member === null || Member === void 0 ? void 0 : Member.UserTel) || Basic.PhoneNumber || '')),
|
|
292
308
|
useExpireAt: useExpireAt,
|
|
293
309
|
useStartAt: useStartAt,
|
|
294
|
-
platform: tl_lincoln_ota_1.TL_LINCOLN_TO_VENDIT_OTA_MAP[(SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) ||
|
|
310
|
+
platform: tl_lincoln_ota_1.TL_LINCOLN_TO_VENDIT_OTA_MAP[(SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) || 'ANONYMOUS'] || (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName),
|
|
295
311
|
externalPlatformCode: SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCode,
|
|
296
312
|
externalPlatformName: (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) ||
|
|
297
313
|
(SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeName),
|
|
298
314
|
},
|
|
299
315
|
reservations: groupedRooms.map(function (key, index) {
|
|
300
|
-
var _a, _b, _c, _d
|
|
316
|
+
var _a, _b, _c, _d;
|
|
301
317
|
var datas = groupedRooms[index];
|
|
302
318
|
var roomsSortedByDate = datas.sort(function (a, b) {
|
|
303
319
|
return new Date(a.RoomRateInformation.RoomDate).valueOf() -
|
|
@@ -305,11 +321,11 @@ var refineReservationData = function (infoTravelXML) {
|
|
|
305
321
|
});
|
|
306
322
|
var reservationType = Number(Allotment.UseDiv) === 1 &&
|
|
307
323
|
BasicInformation.CheckInDate === BasicInformation.CheckOutDate
|
|
308
|
-
?
|
|
309
|
-
:
|
|
324
|
+
? 'rent'
|
|
325
|
+
: 'lodge';
|
|
310
326
|
var CheckInDate = roomsSortedByDate[0].RoomRateInformation.RoomDate;
|
|
311
327
|
var CheckOutDate = (_a = (0, moment_1.default)(CheckInDate)
|
|
312
|
-
.add(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.Nights,
|
|
328
|
+
.add(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.Nights, 'days')) === null || _a === void 0 ? void 0 : _a.format('YYYY-MM-DD');
|
|
313
329
|
var OptionList = Option ? (0, tl_lincoln_types_1.makeArray)(Option) : [];
|
|
314
330
|
var DepositList = (BasicRate === null || BasicRate === void 0 ? void 0 : BasicRate.DepositList) && (0, tl_lincoln_types_1.makeArray)(BasicRate.DepositList);
|
|
315
331
|
var paymentInfo = makePaymentInfo({
|
|
@@ -322,10 +338,10 @@ var refineReservationData = function (infoTravelXML) {
|
|
|
322
338
|
return {
|
|
323
339
|
useStartAt: "".concat(CheckInDate).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime)
|
|
324
340
|
? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime)
|
|
325
|
-
:
|
|
341
|
+
: ''),
|
|
326
342
|
useExpireAt: "".concat(CheckOutDate).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime)
|
|
327
343
|
? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime)
|
|
328
|
-
:
|
|
344
|
+
: ''),
|
|
329
345
|
sleeps: isGroupReservation
|
|
330
346
|
? (BasicInformation.GrandTotalPaxCount || 0) /
|
|
331
347
|
BasicInformation.TotalRoomCount ||
|
|
@@ -333,30 +349,30 @@ var refineReservationData = function (infoTravelXML) {
|
|
|
333
349
|
: (_d = (_c = roomsSortedByDate[0]) === null || _c === void 0 ? void 0 : _c.RoomInformation) === null || _d === void 0 ? void 0 : _d.PerRoomPaxCount,
|
|
334
350
|
guestName: "".concat(BasicInformation.GuestOrGroupNameSingleByte ||
|
|
335
351
|
BasicInformation.GuestOrGroupNameKanjiName ||
|
|
336
|
-
|
|
352
|
+
'Anonymous').concat(isGroupReservation ? " ".concat(index + 1) : ''),
|
|
337
353
|
externalPlatformCode: SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCode,
|
|
338
354
|
externalPlatformName: (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) ||
|
|
339
355
|
(SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeName),
|
|
340
|
-
cmsOtaNumber: "".concat(BasicInformation.TravelAgencyBookingNumber).concat(isGroupReservation ? "v".concat(index + 1) :
|
|
356
|
+
cmsOtaNumber: "".concat(BasicInformation.TravelAgencyBookingNumber).concat(isGroupReservation ? "v".concat(index + 1) : ''),
|
|
341
357
|
cmsProductName: roomsSortedByDate[0].RoomInformation.RoomTypeName ||
|
|
342
358
|
BasicInformation.PackagePlanName,
|
|
343
|
-
platform: tl_lincoln_ota_1.TL_LINCOLN_TO_VENDIT_OTA_MAP[(SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) ||
|
|
344
|
-
otaNumber: "".concat(tl_lincoln_ota_1.TL_LINCOLN_TO_VENDIT_OTA_MAP[(SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) ||
|
|
359
|
+
platform: tl_lincoln_ota_1.TL_LINCOLN_TO_VENDIT_OTA_MAP[(SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) || 'ANONYMOUS'] || (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName),
|
|
360
|
+
otaNumber: "".concat(tl_lincoln_ota_1.TL_LINCOLN_TO_VENDIT_OTA_MAP[(SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) || 'ANONYMOUS'] || (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName), "|").concat("".concat(BasicInformation.TravelAgencyBookingNumber)),
|
|
345
361
|
externalRoomTypeCode: roomsSortedByDate[0].RoomInformation.NetRmTypeGroupCode,
|
|
346
362
|
externalRoomTypeName: roomsSortedByDate[0].RoomInformation.RoomTypeName,
|
|
347
363
|
type: reservationType,
|
|
348
|
-
phone: formatPhoneNumber("".concat((Member === null || Member === void 0 ? void 0 : Member.UserTel) || Basic.PhoneNumber ||
|
|
364
|
+
phone: formatPhoneNumber("".concat((Member === null || Member === void 0 ? void 0 : Member.UserTel) || Basic.PhoneNumber || '')),
|
|
349
365
|
status: status,
|
|
350
366
|
memoContent: "".concat((Member === null || Member === void 0 ? void 0 : Member.UserKana) ||
|
|
351
367
|
(Member === null || Member === void 0 ? void 0 : Member.UserName) ||
|
|
352
368
|
"".concat(BasicInformation.GuestOrGroupNameKanjiName), " ").concat(roomsSortedByDate[0].RoomInformation.RoomTypeName ||
|
|
353
369
|
BasicInformation.PackagePlanName, "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.GuestRequest)
|
|
354
370
|
? "[\uC694\uCCAD\uC0AC\uD56D]\n".concat(OtherInfo.GuestRequest)
|
|
355
|
-
:
|
|
371
|
+
: '', "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.AdditionalInformation)
|
|
356
372
|
? "[\uCD94\uAC00\uC815\uBCF4]\n".concat(OtherInfo.AdditionalInformation)
|
|
357
|
-
:
|
|
358
|
-
? "[\uC635\uC158]\n".concat(OptionList.map(function (option) { return "".concat(option.Name, ": ").concat(option.OptionCount, "(").concat(option.OptionDate, ")"); }).join(
|
|
359
|
-
:
|
|
373
|
+
: '', "\n[\uC778\uC6D0\uC815\uBCF4]\n").concat((0, exports.formattedPaxCountText)(roomsSortedByDate[0].RoomInformation), "\n").concat((OptionList === null || OptionList === void 0 ? void 0 : OptionList.length) > 0
|
|
374
|
+
? "[\uC635\uC158]\n".concat(OptionList.map(function (option) { return "".concat(option.Name, ": ").concat(option.OptionCount, "(").concat(option.OptionDate, ")"); }).join('\n'))
|
|
375
|
+
: ''),
|
|
360
376
|
paymentInfo: Object.assign(paymentInfo, !isFullyPaid && {
|
|
361
377
|
amount: (DepositList === null || DepositList === void 0 ? void 0 : DepositList.reduce(function (acc, deposit) { return acc + ((deposit === null || deposit === void 0 ? void 0 : deposit.DepositAmount) || 0); }, 0)) || 0,
|
|
362
378
|
isFullyPaid: false,
|
|
@@ -372,7 +388,7 @@ exports.refineReservationData = refineReservationData;
|
|
|
372
388
|
var withAsyncBandwidth = function (array, asyncMapper, _a) {
|
|
373
389
|
var _b = _a === void 0 ? {} : _a, _c = _b.bandwidth, bandwidth = _c === void 0 ? 5 : _c;
|
|
374
390
|
if (bandwidth < 2)
|
|
375
|
-
throw new Error(
|
|
391
|
+
throw new Error('Bandwidth must bigger than 1');
|
|
376
392
|
var entries = __spreadArray([], array, true);
|
|
377
393
|
var chainedResponses = new Array(bandwidth)
|
|
378
394
|
.fill(undefined)
|