@vendit-dev/thirdparty-adapters 0.7.20 → 0.7.21

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.
@@ -1,5 +1,5 @@
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';
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
- 'soapenv:Envelope': {
40
- '@_xmlns:soapenv': 'http://schemas.xmlsoap.org/soap/envelope/',
41
- '@_xmlns:pms': json.pmsUrl,
42
- 'soapenv:Body': {
43
- 'pms:execute': {
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 'NewBookReport':
67
- case 'ModificationReport':
68
- return 'RESERVED';
69
- case 'CancellationReport':
70
- return 'CANCELLED';
66
+ case "NewBookReport":
67
+ case "ModificationReport":
68
+ return "RESERVED";
69
+ case "CancellationReport":
70
+ return "CANCELLED";
71
71
  default:
72
- return 'RESERVED';
72
+ return "RESERVED";
73
73
  }
74
74
  }
75
75
  exports.getReservationStatusFromDataClassification = getReservationStatusFromDataClassification;
76
76
  function getExternalReservationTypeFromDataClassification(dataClassification) {
77
77
  switch (dataClassification) {
78
- case 'NewBookReport':
79
- return 'CREATED';
80
- case 'ModificationReport':
81
- return 'UPDATED';
82
- case 'CancellationReport':
83
- return 'CANCELLED';
78
+ case "NewBookReport":
79
+ return "CREATED";
80
+ case "ModificationReport":
81
+ return "UPDATED";
82
+ case "CancellationReport":
83
+ return "CANCELLED";
84
84
  default:
85
- return 'CREATED';
85
+ return "CREATED";
86
86
  }
87
87
  }
88
88
  exports.getExternalReservationTypeFromDataClassification = getExternalReservationTypeFromDataClassification;
89
89
  var getSpecificMealConditionText = function (_specificType) {
90
90
  switch (_specificType) {
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':
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 '1night2meals':
114
- return '1박2식';
115
- case '1nightBreakfast':
116
- return '1박조식';
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,60 +143,44 @@ 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 ('RoomPaxMaleCount' in roomInformation) {
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(/[^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
- }
199
- return onlyNumberText ? "010".concat(onlyNumberText.slice(-8)) : '';
182
+ var onlyNumberText = text === null || text === void 0 ? void 0 : text.replace(/[^+0-9]/g, "");
183
+ return onlyNumberText;
200
184
  }
201
185
  var makePaymentInfo = function (_a) {
202
186
  var datas = _a.datas, basicRateInformation = _a.basicRateInformation, basicInformation = _a.basicInformation, reservationType = _a.reservationType, OptionList = _a.OptionList;
@@ -217,16 +201,16 @@ var makePaymentInfo = function (_a) {
217
201
  (_b = paymentInput.segments) === null || _b === void 0 ? void 0 : _b.push({
218
202
  amount: roomAmount,
219
203
  servedAt: RoomRateInformation.RoomDate,
220
- referenceType: 'RESERVATION',
204
+ referenceType: "RESERVATION",
221
205
  referenceSubType: reservationType,
222
206
  });
223
- if (basicInformation.MealCondition !== 'Other' &&
224
- basicInformation.MealCondition !== 'WithoutMeal') {
207
+ if (basicInformation.MealCondition !== "Other" &&
208
+ basicInformation.MealCondition !== "WithoutMeal") {
225
209
  paymentInput.amount += (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomServiceFee) || 0;
226
210
  (_c = paymentInput.segments) === null || _c === void 0 ? void 0 : _c.push({
227
211
  amount: (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomServiceFee) || 0,
228
212
  servedAt: RoomRateInformation.RoomDate,
229
- referenceType: 'SERVICE',
213
+ referenceType: "SERVICE",
230
214
  referenceSubType: (0, exports.formattedNameForMealCondition)(basicInformation.MealCondition, basicInformation.SpecificMealCondition),
231
215
  });
232
216
  }
@@ -234,47 +218,47 @@ var makePaymentInfo = function (_a) {
234
218
  (_d = paymentInput.segments) === null || _d === void 0 ? void 0 : _d.push.apply(_d, OptionList.map(function (option) { return ({
235
219
  amount: 0,
236
220
  servedAt: option.OptionDate,
237
- referenceType: 'SERVICE',
221
+ referenceType: "SERVICE",
238
222
  referenceSubType: option.Name,
239
223
  }); }));
240
224
  }
241
225
  return Object.assign(paymentInput, {
242
226
  reservationType: reservationType,
243
- type: 'platform',
227
+ type: "platform",
244
228
  externalRoomTypeCode: datas[0].RoomInformation.NetRmTypeGroupCode,
245
229
  externalRoomTypeName: datas[0].RoomInformation.RoomTypeName,
246
230
  useStartAt: "".concat(datas[0].RoomRateInformation.RoomDate).concat((basicInformation === null || basicInformation === void 0 ? void 0 : basicInformation.CheckInTime)
247
231
  ? " ".concat(basicInformation === null || basicInformation === void 0 ? void 0 : basicInformation.CheckInTime)
248
- : ''),
232
+ : ""),
249
233
  });
250
234
  }, {
251
235
  amount: 0,
252
236
  commissionAmount: 0,
253
- reservationType: 'lodge',
237
+ reservationType: "lodge",
254
238
  segments: [],
255
- externalRoomTypeCode: '',
256
- externalRoomTypeName: '',
257
- type: 'platform',
258
- useStartAt: '',
239
+ externalRoomTypeCode: "",
240
+ externalRoomTypeName: "",
241
+ type: "platform",
242
+ useStartAt: "",
259
243
  });
260
244
  };
261
245
  var refineReservationData = function (infoTravelXML) {
262
246
  var _a, _b;
263
247
  var _c = infoTravelXML.AllotmentBookingReport, TransactionType = _c.TransactionType, RisaplsInformation = _c.RisaplsInformation, BasicInformation = _c.BasicInformation, BasicRateInformation = _c.BasicRateInformation, SalesOfficeInformation = _c.SalesOfficeInformation;
264
- var _d = TransactionType.DataID.split('-'), ID = _d[0], REVISION = _d[1];
248
+ var _d = TransactionType.DataID.split("-"), ID = _d[0], REVISION = _d[1];
265
249
  var isGroupReservation = BasicInformation.TotalRoomCount > 1;
266
250
  var RisaplsCommonInformation = RisaplsInformation.RisaplsCommonInformation, AgentNativeInformation = RisaplsInformation.AgentNativeInformation;
267
251
  var RoomAndRoomRateInformation = RisaplsCommonInformation.RoomAndRoomRateInformation, Allotment = RisaplsCommonInformation.Allotment, Member = RisaplsCommonInformation.Member, OtherInfo = RisaplsCommonInformation.OtherInfo, Basic = RisaplsCommonInformation.Basic, BasicRate = RisaplsCommonInformation.BasicRate, Option = RisaplsCommonInformation.Option;
268
252
  var isFullyPaid = !!((_a = AgentNativeInformation === null || AgentNativeInformation === void 0 ? void 0 : AgentNativeInformation.Extendmytrip) === null || _a === void 0 ? void 0 : _a.SettlementDiv) &&
269
253
  !((_b = AgentNativeInformation === null || AgentNativeInformation === void 0 ? void 0 : AgentNativeInformation.Extend) === null || _b === void 0 ? void 0 : _b.AmountClaimed) &&
270
- (BasicRateInformation === null || BasicRateInformation === void 0 ? void 0 : BasicRateInformation.Payment) !== 'Hotel Collect';
254
+ (BasicRateInformation === null || BasicRateInformation === void 0 ? void 0 : BasicRateInformation.Payment) !== "Hotel Collect";
271
255
  var roomAndRoomRateInformations = (0, tl_lincoln_types_1.makeArray)(RoomAndRoomRateInformation);
272
256
  var groupedRooms = groupByRoomWithTotalCounts(roomAndRoomRateInformations, BasicInformation.TotalRoomCount);
273
257
  var status = getReservationStatusFromDataClassification(TransactionType.DataClassification);
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) : '');
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) : "");
275
259
  var useExpireAt = "".concat((0, moment_1.default)(BasicInformation.CheckInDate)
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) : '');
260
+ .add(BasicInformation.Nights, "days")
261
+ .format("YYYY-MM-DD")).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime) ? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime) : "");
278
262
  var PointDiscountList = [];
279
263
  if (BasicRate === null || BasicRate === void 0 ? void 0 : BasicRate.PointsDiscountList) {
280
264
  PointDiscountList = (0, tl_lincoln_types_1.makeArray)(BasicRate.PointsDiscountList);
@@ -292,22 +276,22 @@ var refineReservationData = function (infoTravelXML) {
292
276
  (Member === null || Member === void 0 ? void 0 : Member.UserName) ||
293
277
  "".concat(BasicInformation.GuestOrGroupNameKanjiName), " ").concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.PackagePlanName, "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.GuestRequest)
294
278
  ? "[\uC694\uCCAD\uC0AC\uD56D]\n".concat(OtherInfo.GuestRequest)
295
- : '', "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.AdditionalInformation)
279
+ : "", "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.AdditionalInformation)
296
280
  ? "[\uCD94\uAC00\uC815\uBCF4]\n".concat(OtherInfo.AdditionalInformation)
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'
281
+ : "", "\n").concat((0, exports.formattedPaxCountText)(BasicInformation), "\n[\uACB0\uC81C\uC815\uBCF4]\n\uC9C0\uBD88\uC218\uB2E8: ").concat(BasicRateInformation.Payment || "정보 없음", "\n").concat(BasicRateInformation.Payment === "CreditCard"
298
282
  ? "\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")
299
- : '', "\n\uC218\uC218\uB8CC\uC728: ").concat(BasicRateInformation.CommissionPercentage
283
+ : "", "\n\uC218\uC218\uB8CC\uC728: ").concat(BasicRateInformation.CommissionPercentage
300
284
  ? "".concat(BasicRateInformation.CommissionPercentage, "%")
301
- : '정보 없음', "\n\uC218\uC218\uB8CC \uCD1D\uC561: ").concat(BasicRateInformation.TotalAccommodationCommissionAmount
285
+ : "정보 없음", "\n\uC218\uC218\uB8CC \uCD1D\uC561: ").concat(BasicRateInformation.TotalAccommodationCommissionAmount
302
286
  ? "".concat(BasicRateInformation.TotalAccommodationCommissionAmount, "\uC6D0")
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 || '')),
287
+ : "정보 없음", "\n[\uD560\uC778\uC815\uBCF4]\n").concat((PointDiscountList === null || PointDiscountList === void 0 ? void 0 : PointDiscountList.length) > 0
288
+ ? "".concat(PointDiscountList.map(function (point) { return "".concat(point.PointsDiscountName, ": ").concat(point.PointsDiscount); }).join("\n"))
289
+ : ""),
290
+ status: "reserved",
291
+ phone: formatPhoneNumber("".concat((Member === null || Member === void 0 ? void 0 : Member.UserTel) || Basic.PhoneNumber || "")),
308
292
  useExpireAt: useExpireAt,
309
293
  useStartAt: useStartAt,
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),
294
+ 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),
311
295
  externalPlatformCode: SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCode,
312
296
  externalPlatformName: (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) ||
313
297
  (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeName),
@@ -321,11 +305,11 @@ var refineReservationData = function (infoTravelXML) {
321
305
  });
322
306
  var reservationType = Number(Allotment.UseDiv) === 1 &&
323
307
  BasicInformation.CheckInDate === BasicInformation.CheckOutDate
324
- ? 'rent'
325
- : 'lodge';
308
+ ? "rent"
309
+ : "lodge";
326
310
  var CheckInDate = roomsSortedByDate[0].RoomRateInformation.RoomDate;
327
311
  var CheckOutDate = (_a = (0, moment_1.default)(CheckInDate)
328
- .add(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.Nights, 'days')) === null || _a === void 0 ? void 0 : _a.format('YYYY-MM-DD');
312
+ .add(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.Nights, "days")) === null || _a === void 0 ? void 0 : _a.format("YYYY-MM-DD");
329
313
  var OptionList = Option ? (0, tl_lincoln_types_1.makeArray)(Option) : [];
330
314
  var DepositList = (BasicRate === null || BasicRate === void 0 ? void 0 : BasicRate.DepositList) && (0, tl_lincoln_types_1.makeArray)(BasicRate.DepositList);
331
315
  var paymentInfo = makePaymentInfo({
@@ -338,10 +322,10 @@ var refineReservationData = function (infoTravelXML) {
338
322
  return {
339
323
  useStartAt: "".concat(CheckInDate).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime)
340
324
  ? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime)
341
- : ''),
325
+ : ""),
342
326
  useExpireAt: "".concat(CheckOutDate).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime)
343
327
  ? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime)
344
- : ''),
328
+ : ""),
345
329
  sleeps: isGroupReservation
346
330
  ? (BasicInformation.GrandTotalPaxCount || 0) /
347
331
  BasicInformation.TotalRoomCount ||
@@ -349,30 +333,30 @@ var refineReservationData = function (infoTravelXML) {
349
333
  : (_d = (_c = roomsSortedByDate[0]) === null || _c === void 0 ? void 0 : _c.RoomInformation) === null || _d === void 0 ? void 0 : _d.PerRoomPaxCount,
350
334
  guestName: "".concat(BasicInformation.GuestOrGroupNameSingleByte ||
351
335
  BasicInformation.GuestOrGroupNameKanjiName ||
352
- 'Anonymous').concat(isGroupReservation ? " ".concat(index + 1) : ''),
336
+ "Anonymous").concat(isGroupReservation ? " ".concat(index + 1) : ""),
353
337
  externalPlatformCode: SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCode,
354
338
  externalPlatformName: (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) ||
355
339
  (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeName),
356
- cmsOtaNumber: "".concat(BasicInformation.TravelAgencyBookingNumber).concat(isGroupReservation ? "v".concat(index + 1) : ''),
340
+ cmsOtaNumber: "".concat(BasicInformation.TravelAgencyBookingNumber).concat(isGroupReservation ? "v".concat(index + 1) : ""),
357
341
  cmsProductName: roomsSortedByDate[0].RoomInformation.RoomTypeName ||
358
342
  BasicInformation.PackagePlanName,
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((_e = "".concat(BasicInformation.TravelAgencyBookingNumber)) === null || _e === void 0 ? void 0 : _e.slice(-4)),
343
+ 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),
344
+ 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((_e = "".concat(BasicInformation.TravelAgencyBookingNumber)) === null || _e === void 0 ? void 0 : _e.slice(-4)),
361
345
  externalRoomTypeCode: roomsSortedByDate[0].RoomInformation.NetRmTypeGroupCode,
362
346
  externalRoomTypeName: roomsSortedByDate[0].RoomInformation.RoomTypeName,
363
347
  type: reservationType,
364
- phone: formatPhoneNumber("".concat((Member === null || Member === void 0 ? void 0 : Member.UserTel) || Basic.PhoneNumber || '')),
348
+ phone: formatPhoneNumber("".concat((Member === null || Member === void 0 ? void 0 : Member.UserTel) || Basic.PhoneNumber || "")),
365
349
  status: status,
366
350
  memoContent: "".concat((Member === null || Member === void 0 ? void 0 : Member.UserKana) ||
367
351
  (Member === null || Member === void 0 ? void 0 : Member.UserName) ||
368
352
  "".concat(BasicInformation.GuestOrGroupNameKanjiName), " ").concat(roomsSortedByDate[0].RoomInformation.RoomTypeName ||
369
353
  BasicInformation.PackagePlanName, "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.GuestRequest)
370
354
  ? "[\uC694\uCCAD\uC0AC\uD56D]\n".concat(OtherInfo.GuestRequest)
371
- : '', "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.AdditionalInformation)
355
+ : "", "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.AdditionalInformation)
372
356
  ? "[\uCD94\uAC00\uC815\uBCF4]\n".concat(OtherInfo.AdditionalInformation)
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
- : ''),
357
+ : "", "\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
358
+ ? "[\uC635\uC158]\n".concat(OptionList.map(function (option) { return "".concat(option.Name, ": ").concat(option.OptionCount, "(").concat(option.OptionDate, ")"); }).join("\n"))
359
+ : ""),
376
360
  paymentInfo: Object.assign(paymentInfo, !isFullyPaid && {
377
361
  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,
378
362
  isFullyPaid: false,
@@ -388,7 +372,7 @@ exports.refineReservationData = refineReservationData;
388
372
  var withAsyncBandwidth = function (array, asyncMapper, _a) {
389
373
  var _b = _a === void 0 ? {} : _a, _c = _b.bandwidth, bandwidth = _c === void 0 ? 5 : _c;
390
374
  if (bandwidth < 2)
391
- throw new Error('Bandwidth must bigger than 1');
375
+ throw new Error("Bandwidth must bigger than 1");
392
376
  var entries = __spreadArray([], array, true);
393
377
  var chainedResponses = new Array(bandwidth)
394
378
  .fill(undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendit-dev/thirdparty-adapters",
3
- "version": "0.7.20",
3
+ "version": "0.7.21",
4
4
  "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -1,50 +0,0 @@
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>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
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>
@@ -1,12 +0,0 @@
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 DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>