@vendit-dev/thirdparty-adapters 0.7.8 → 0.7.10

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.
@@ -51,9 +51,10 @@ function jsonToXml(json) {
51
51
  }
52
52
  exports.jsonToXml = jsonToXml;
53
53
  function xmlToJson(xml) {
54
+ // 
 문자는 제거하고 파싱합니다.
54
55
  try {
55
56
  var parser = new fast_xml_parser_1.XMLParser();
56
- return parser.parse(xml);
57
+ return parser.parse(xml.replace(/
/g, ''));
57
58
  }
58
59
  catch (e) {
59
60
  console.error("xmlToJson failed: ".concat(e));
@@ -120,33 +121,48 @@ var getMealConditionText = function (_mealCondition) {
120
121
  };
121
122
  var formattedNameForMealCondition = function (mealCondition, specificMealCondition) {
122
123
  var _a;
123
- return "".concat(getMealConditionText(mealCondition)).concat(((_a = getSpecificMealConditionText(specificMealCondition)) === null || _a === void 0 ? void 0 : _a.length) > 0 ? "(".concat(getSpecificMealConditionText(specificMealCondition)
124
- .join(', '), ")") : '');
124
+ return "".concat(getMealConditionText(mealCondition)).concat(((_a = getSpecificMealConditionText(specificMealCondition)) === null || _a === void 0 ? void 0 : _a.length) > 0
125
+ ? "(".concat(getSpecificMealConditionText(specificMealCondition).join(', '), ")")
126
+ : '');
125
127
  };
126
128
  exports.formattedNameForMealCondition = formattedNameForMealCondition;
127
129
  var formattedPaxCountText = function (roomInformation, genderDivision) {
128
130
  if ('RoomPaxMaleCount' in roomInformation) {
129
131
  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;
130
132
  return "".concat([
131
- // RoomPaxMaleCount ? `성인남성 ${RoomPaxMaleCount}명` : '',
132
- // RoomPaxFemaleCount ? `성인여성 ${RoomPaxFemaleCount}명` : '',
133
- genderDivision ? "\uB0A8 ".concat(RoomPaxMaleCount, "\uBA85, \uC5EC ").concat(RoomPaxFemaleCount, "\uBA85") : "\uC131\uC778 ".concat((RoomPaxMaleCount) + (RoomPaxFemaleCount), "\uBA85"),
133
+ genderDivision
134
+ ? "\uB0A8 ".concat(RoomPaxMaleCount, "\uBA85, \uC5EC ").concat(RoomPaxFemaleCount, "\uBA85")
135
+ : "\uC131\uC778 ".concat(RoomPaxMaleCount + RoomPaxFemaleCount, "\uBA85"),
134
136
  RoomChildA70Count ? "\uD559\uC0DD ".concat(RoomChildA70Count, "\uBA85") : '',
135
- RoomChildB50Count || RoomChildC30Count || RoomChildOtherCount ? "\uC544\uB3D9 ".concat(RoomChildB50Count + RoomChildC30Count + RoomChildOtherCount, "\uBA85") : '',
137
+ RoomChildB50Count || RoomChildC30Count || RoomChildOtherCount
138
+ ? "\uC544\uB3D9 ".concat(RoomChildB50Count + RoomChildC30Count + RoomChildOtherCount, "\uBA85")
139
+ : '',
136
140
  RoomChildDNoneCount ? "\uC720\uC544 ".concat(RoomChildDNoneCount, "\uBA85") : '',
137
- ].filter(Boolean).join(', '));
141
+ ]
142
+ .filter(Boolean)
143
+ .join(', '));
138
144
  }
139
145
  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;
140
146
  return "".concat([
141
- genderDivision ? "\uB0A8 ".concat(TotalPaxMaleCount, "\uBA85, \uC5EC ").concat(TotalPaxFemaleCount, "\uBA85") : "\uC131\uC778 ".concat((TotalPaxMaleCount) + (TotalPaxFemaleCount), "\uBA85"),
147
+ genderDivision
148
+ ? "\uB0A8 ".concat(TotalPaxMaleCount, "\uBA85, \uC5EC ").concat(TotalPaxFemaleCount, "\uBA85")
149
+ : "\uC131\uC778 ".concat(TotalPaxMaleCount + TotalPaxFemaleCount, "\uBA85"),
142
150
  TotalChildA70Count ? "\uD559\uC0DD ".concat(TotalChildA70Count, "\uBA85") : '',
143
- TotalChildB50Count || TotalChildC30Count || TotalChildOtherCount ? "\uC544\uB3D9 ".concat(TotalChildB50Count + TotalChildC30Count + TotalChildOtherCount, "\uBA85") : '',
151
+ TotalChildB50Count || TotalChildC30Count || TotalChildOtherCount
152
+ ? "\uC544\uB3D9 ".concat(TotalChildB50Count + TotalChildC30Count + TotalChildOtherCount, "\uBA85")
153
+ : '',
144
154
  TotalChildDNoneCount ? "\uC720\uC544 ".concat(TotalChildDNoneCount, "\uBA85") : '',
145
- ].filter(Boolean).join(', '));
155
+ ]
156
+ .filter(Boolean)
157
+ .join(', '));
146
158
  };
147
159
  exports.formattedPaxCountText = formattedPaxCountText;
148
160
  function formatPhoneNumber(text) {
149
161
  var onlyNumberText = text === null || text === void 0 ? void 0 : text.replace(/[^0-9]/g, '');
162
+ var safeNumberRegex = /^050{1}[0-9]{8}$/;
163
+ if (safeNumberRegex.test(onlyNumberText || '')) {
164
+ return onlyNumberText;
165
+ }
150
166
  return onlyNumberText ? "010".concat(onlyNumberText.slice(-8)) : '';
151
167
  }
152
168
  var makePaymentInfo = function (_a) {
@@ -154,7 +170,16 @@ var makePaymentInfo = function (_a) {
154
170
  return datas.reduce(function (paymentInput, _a) {
155
171
  var _b, _c, _d;
156
172
  var RoomInfo = _a.RoomInformation, RoomRateInformation = _a.RoomRateInformation;
157
- var roomAmount = (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomRate) || (((RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerMaleRate) || 0) * (RoomInfo.RoomPaxMaleCount || 0) + ((RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerFemaleRate) || (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerMaleRate) || 0) * (RoomInfo.RoomPaxFemaleCount || 0)) || (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomRate) || basicRateInformation.TotalAccommodationCharge || 0;
173
+ var roomAmount = (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomRate)
174
+ || ((RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerMaleRate) || 0)
175
+ * (RoomInfo.RoomPaxMaleCount || 0)
176
+ + ((RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerFemaleRate)
177
+ || (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerMaleRate)
178
+ || 0)
179
+ * (RoomInfo.RoomPaxFemaleCount || 0)
180
+ || (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomRate)
181
+ || basicRateInformation.TotalAccommodationCharge
182
+ || 0;
158
183
  paymentInput.amount += roomAmount;
159
184
  (_b = paymentInput.segments) === null || _b === void 0 ? void 0 : _b.push({
160
185
  amount: roomAmount,
@@ -162,7 +187,8 @@ var makePaymentInfo = function (_a) {
162
187
  referenceType: 'RESERVATION',
163
188
  referenceSubType: reservationType,
164
189
  });
165
- if (basicInformation.MealCondition !== 'Other' && basicInformation.MealCondition !== 'WithoutMeal') {
190
+ if (basicInformation.MealCondition !== 'Other'
191
+ && basicInformation.MealCondition !== 'WithoutMeal') {
166
192
  paymentInput.amount += (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomServiceFee) || 0;
167
193
  (_c = paymentInput.segments) === null || _c === void 0 ? void 0 : _c.push({
168
194
  amount: (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomServiceFee) || 0,
@@ -184,7 +210,9 @@ var makePaymentInfo = function (_a) {
184
210
  type: 'platform',
185
211
  externalRoomTypeCode: roomsSortedByDate[0].RoomInformation.NetRmTypeGroupCode,
186
212
  externalRoomTypeName: roomsSortedByDate[0].RoomInformation.RoomTypeName,
187
- useStartAt: "".concat(CheckInDate).concat((basicInformation === null || basicInformation === void 0 ? void 0 : basicInformation.CheckInTime) ? " ".concat(basicInformation === null || basicInformation === void 0 ? void 0 : basicInformation.CheckInTime) : ''),
213
+ useStartAt: "".concat(CheckInDate).concat((basicInformation === null || basicInformation === void 0 ? void 0 : basicInformation.CheckInTime)
214
+ ? " ".concat(basicInformation === null || basicInformation === void 0 ? void 0 : basicInformation.CheckInTime)
215
+ : ''),
188
216
  });
189
217
  }, {
190
218
  amount: 0,
@@ -204,7 +232,9 @@ var refineReservationData = function (infoTravelXML) {
204
232
  var isGroupReservation = BasicInformation.TotalRoomCount > 1;
205
233
  var RisaplsCommonInformation = RisaplsInformation.RisaplsCommonInformation, AgentNativeInformation = RisaplsInformation.AgentNativeInformation;
206
234
  var RoomAndRoomRateInformation = RisaplsCommonInformation.RoomAndRoomRateInformation, Allotment = RisaplsCommonInformation.Allotment, Member = RisaplsCommonInformation.Member, OtherInfo = RisaplsCommonInformation.OtherInfo, Basic = RisaplsCommonInformation.Basic, BasicRate = RisaplsCommonInformation.BasicRate, Option = RisaplsCommonInformation.Option;
207
- var isFullyPaid = !!((_a = AgentNativeInformation === null || AgentNativeInformation === void 0 ? void 0 : AgentNativeInformation.Extendmytrip) === null || _a === void 0 ? void 0 : _a.SettlementDiv) && !((_b = AgentNativeInformation === null || AgentNativeInformation === void 0 ? void 0 : AgentNativeInformation.Extend) === null || _b === void 0 ? void 0 : _b.AmountClaimed) && (BasicRateInformation === null || BasicRateInformation === void 0 ? void 0 : BasicRateInformation.Payment) !== 'Hotel Collect';
235
+ var isFullyPaid = !!((_a = AgentNativeInformation === null || AgentNativeInformation === void 0 ? void 0 : AgentNativeInformation.Extendmytrip) === null || _a === void 0 ? void 0 : _a.SettlementDiv)
236
+ && !((_b = AgentNativeInformation === null || AgentNativeInformation === void 0 ? void 0 : AgentNativeInformation.Extend) === null || _b === void 0 ? void 0 : _b.AmountClaimed)
237
+ && (BasicRateInformation === null || BasicRateInformation === void 0 ? void 0 : BasicRateInformation.Payment) !== 'Hotel Collect';
208
238
  var roomAndRoomRateInformations = (0, tl_lincoln_types_1.makeArray)(RoomAndRoomRateInformation);
209
239
  var groupedRooms = (0, function_1.groupBy)(roomAndRoomRateInformations, 'RoomInformation.RoomByRoomConfirmationNumber');
210
240
  var status = getReservationStatusFromDataClassification(TransactionType.DataClassification);
@@ -225,25 +255,47 @@ var refineReservationData = function (infoTravelXML) {
225
255
  name: BasicInformation.GuestOrGroupNameKanjiName,
226
256
  email: Member === null || Member === void 0 ? void 0 : Member.UserMailAddr,
227
257
  reservedBy: SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName,
228
- memo: "".concat((Member === null || Member === void 0 ? void 0 : Member.UserKana) || (Member === null || Member === void 0 ? void 0 : Member.UserName) || "".concat(BasicInformation.GuestOrGroupNameKanjiName), " ").concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.PackagePlanName, "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.GuestRequest) ? "[\uC694\uCCAD\uC0AC\uD56D]\n".concat(OtherInfo.GuestRequest) : '', "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.AdditionalInformation) ? "[\uCD94\uAC00\uC815\uBCF4]\n".concat(OtherInfo.AdditionalInformation) : '', "\n").concat((0, exports.formattedPaxCountText)(BasicInformation), "\n[\uACB0\uC81C\uC815\uBCF4]\n\uC9C0\uBD88\uC218\uB2E8: ").concat(BasicRateInformation.Payment || '정보 없음', "\n").concat(BasicRateInformation.Payment === 'CreditCard' ? "\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") : '', "\n\uC218\uC218\uB8CC\uC728: ").concat(BasicRateInformation.CommissionPercentage ? "".concat(BasicRateInformation.CommissionPercentage, "%") : '정보 없음', "\n\uC218\uC218\uB8CC \uCD1D\uC561: ").concat(BasicRateInformation.TotalAccommodationCommissionAmount ? "".concat(BasicRateInformation.TotalAccommodationCommissionAmount, "\uC6D0") : '정보 없음', "\n[\uD560\uC778\uC815\uBCF4]\n").concat((PointDiscountList === null || PointDiscountList === void 0 ? void 0 : PointDiscountList.length) > 0 ? "".concat(PointDiscountList.map(function (point) { return "".concat(point.PointsDiscountName, ": ").concat(point.PointsDiscount); }).join('\n')) : ''),
258
+ memo: "".concat((Member === null || Member === void 0 ? void 0 : Member.UserKana)
259
+ || (Member === null || Member === void 0 ? void 0 : Member.UserName)
260
+ || "".concat(BasicInformation.GuestOrGroupNameKanjiName), " ").concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.PackagePlanName, "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.GuestRequest)
261
+ ? "[\uC694\uCCAD\uC0AC\uD56D]\n".concat(OtherInfo.GuestRequest)
262
+ : '', "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.AdditionalInformation)
263
+ ? "[\uCD94\uAC00\uC815\uBCF4]\n".concat(OtherInfo.AdditionalInformation)
264
+ : '', "\n").concat((0, exports.formattedPaxCountText)(BasicInformation), "\n[\uACB0\uC81C\uC815\uBCF4]\n\uC9C0\uBD88\uC218\uB2E8: ").concat(BasicRateInformation.Payment || '정보 없음', "\n").concat(BasicRateInformation.Payment === 'CreditCard'
265
+ ? "\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")
266
+ : '', "\n\uC218\uC218\uB8CC\uC728: ").concat(BasicRateInformation.CommissionPercentage
267
+ ? "".concat(BasicRateInformation.CommissionPercentage, "%")
268
+ : '정보 없음', "\n\uC218\uC218\uB8CC \uCD1D\uC561: ").concat(BasicRateInformation.TotalAccommodationCommissionAmount
269
+ ? "".concat(BasicRateInformation.TotalAccommodationCommissionAmount, "\uC6D0")
270
+ : '정보 없음', "\n[\uD560\uC778\uC815\uBCF4]\n").concat((PointDiscountList === null || PointDiscountList === void 0 ? void 0 : PointDiscountList.length) > 0
271
+ ? "".concat(PointDiscountList.map(function (point) { return "".concat(point.PointsDiscountName, ": ").concat(point.PointsDiscount); }).join('\n'))
272
+ : ''),
229
273
  status: 'reserved',
230
274
  phone: formatPhoneNumber("".concat((Member === null || Member === void 0 ? void 0 : Member.UserTel) || Basic.PhoneNumber || '')),
231
275
  useExpireAt: useExpireAt,
232
276
  useStartAt: useStartAt,
233
277
  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),
234
278
  externalPlatformCode: SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCode,
235
- externalPlatformName: (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) || (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeName),
279
+ externalPlatformName: (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName)
280
+ || (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeName),
236
281
  },
237
- reservations: Object.keys(groupedRooms)
238
- .map(function (key, index) {
282
+ reservations: Object.keys(groupedRooms).map(function (key, index) {
239
283
  var _a, _b, _c, _d;
240
284
  var datas = groupedRooms[key];
241
- var roomsSortedByDate = datas.sort(function (a, b) { return new Date(a.RoomRateInformation.RoomDate).valueOf() - new Date(b.RoomRateInformation.RoomDate).valueOf(); });
242
- var reservationType = (Number(Allotment.UseDiv) === 1 && BasicInformation.CheckInDate === BasicInformation.CheckOutDate) ? 'rent' : 'lodge';
285
+ var roomsSortedByDate = datas.sort(function (a, b) {
286
+ return new Date(a.RoomRateInformation.RoomDate).valueOf()
287
+ - new Date(b.RoomRateInformation.RoomDate).valueOf();
288
+ });
289
+ var reservationType = Number(Allotment.UseDiv) === 1
290
+ && BasicInformation.CheckInDate === BasicInformation.CheckOutDate
291
+ ? 'rent'
292
+ : 'lodge';
243
293
  var CheckInDate = roomsSortedByDate[0].RoomRateInformation.RoomDate;
244
294
  var CheckOutDate = (_a = (0, moment_1.default)(CheckInDate)
245
295
  .add(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.Nights, 'days')) === null || _a === void 0 ? void 0 : _a.format('YYYY-MM-DD');
246
- var OptionList = Option ? (0, tl_lincoln_types_1.makeArray)(Option) : [];
296
+ var OptionList = Option
297
+ ? (0, tl_lincoln_types_1.makeArray)(Option)
298
+ : [];
247
299
  var DepositList = (BasicRate === null || BasicRate === void 0 ? void 0 : BasicRate.DepositList) && (0, tl_lincoln_types_1.makeArray)(BasicRate.DepositList);
248
300
  var paymentInfo = makePaymentInfo({
249
301
  datas: datas,
@@ -255,14 +307,22 @@ var refineReservationData = function (infoTravelXML) {
255
307
  roomsSortedByDate: roomsSortedByDate,
256
308
  });
257
309
  return {
258
- useStartAt: "".concat(CheckInDate).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime) ? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime) : ''),
259
- useExpireAt: "".concat(CheckOutDate).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime) ? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime) : ''),
310
+ useStartAt: "".concat(CheckInDate).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime)
311
+ ? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckInTime)
312
+ : ''),
313
+ useExpireAt: "".concat(CheckOutDate).concat((BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime)
314
+ ? " ".concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.CheckOutTime)
315
+ : ''),
260
316
  sleeps: (_c = (_b = roomsSortedByDate[0]) === null || _b === void 0 ? void 0 : _b.RoomInformation) === null || _c === void 0 ? void 0 : _c.PerRoomPaxCount,
261
- guestName: "".concat(BasicInformation.GuestOrGroupNameSingleByte || BasicInformation.GuestOrGroupNameKanjiName || 'Anonymous').concat(isGroupReservation ? " ".concat(index + 1) : ''),
317
+ guestName: "".concat(BasicInformation.GuestOrGroupNameSingleByte
318
+ || BasicInformation.GuestOrGroupNameKanjiName
319
+ || 'Anonymous').concat(isGroupReservation ? " ".concat(index + 1) : ''),
262
320
  externalPlatformCode: SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCode,
263
- externalPlatformName: (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) || (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeName),
321
+ externalPlatformName: (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName)
322
+ || (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeName),
264
323
  cmsOtaNumber: "".concat(BasicInformation.TravelAgencyBookingNumber).concat(isGroupReservation ? "-v".concat(index + 1) : ''),
265
- cmsProductName: roomsSortedByDate[0].RoomInformation.RoomTypeName || BasicInformation.PackagePlanName,
324
+ cmsProductName: roomsSortedByDate[0].RoomInformation.RoomTypeName
325
+ || BasicInformation.PackagePlanName,
266
326
  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),
267
327
  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((_d = "".concat(BasicInformation.TravelAgencyBookingNumber)) === null || _d === void 0 ? void 0 : _d.slice(-4)),
268
328
  externalRoomTypeCode: roomsSortedByDate[0].RoomInformation.NetRmTypeGroupCode,
@@ -270,11 +330,21 @@ var refineReservationData = function (infoTravelXML) {
270
330
  type: reservationType,
271
331
  phone: formatPhoneNumber("".concat((Member === null || Member === void 0 ? void 0 : Member.UserTel) || Basic.PhoneNumber || '')),
272
332
  status: status,
273
- memoContent: "".concat((Member === null || Member === void 0 ? void 0 : Member.UserKana) || (Member === null || Member === void 0 ? void 0 : Member.UserName) || "".concat(BasicInformation.GuestOrGroupNameKanjiName), " ").concat(BasicInformation === null || BasicInformation === void 0 ? void 0 : BasicInformation.PackagePlanName, "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.GuestRequest) ? "[\uC694\uCCAD\uC0AC\uD56D]\n".concat(OtherInfo.GuestRequest) : '', "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.AdditionalInformation) ? "[\uCD94\uAC00\uC815\uBCF4]\n".concat(OtherInfo.AdditionalInformation) : '', "\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 ? "[\uC635\uC158]\n".concat(OptionList.map(function (option) { return "".concat(option.Name, ": ").concat(option.OptionCount, "(").concat(option.OptionDate, ")"); }).join('\n')) : ''),
333
+ memoContent: "".concat((Member === null || Member === void 0 ? void 0 : Member.UserKana)
334
+ || (Member === null || Member === void 0 ? void 0 : Member.UserName)
335
+ || "".concat(BasicInformation.GuestOrGroupNameKanjiName), " ").concat(roomsSortedByDate[0].RoomInformation.RoomTypeName
336
+ || BasicInformation.PackagePlanName, "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.GuestRequest)
337
+ ? "[\uC694\uCCAD\uC0AC\uD56D]\n".concat(OtherInfo.GuestRequest)
338
+ : '', "\n").concat((OtherInfo === null || OtherInfo === void 0 ? void 0 : OtherInfo.AdditionalInformation)
339
+ ? "[\uCD94\uAC00\uC815\uBCF4]\n".concat(OtherInfo.AdditionalInformation)
340
+ : '', "\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
341
+ ? "[\uC635\uC158]\n".concat(OptionList.map(function (option) { return "".concat(option.Name, ": ").concat(option.OptionCount, "(").concat(option.OptionDate, ")"); }).join('\n'))
342
+ : ''),
274
343
  paymentInfo: Object.assign(paymentInfo, !isFullyPaid && {
275
344
  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,
276
345
  isFullyPaid: false,
277
- outstandingAmount: paymentInfo.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),
346
+ outstandingAmount: paymentInfo.amount
347
+ - ((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),
278
348
  }),
279
349
  };
280
350
  }),
@@ -296,7 +366,9 @@ var withAsyncBandwidth = function (array, asyncMapper, _a) {
296
366
  var currentEntry = entries.pop();
297
367
  var currentIndex = index;
298
368
  var beforeResponse = chainedResponses[iterator];
299
- chainedResponses[iterator] = beforeResponse.then(function () { return asyncMapper(currentEntry, currentIndex); });
369
+ chainedResponses[iterator] = beforeResponse.then(function () {
370
+ return asyncMapper(currentEntry, currentIndex);
371
+ });
300
372
  index += 1;
301
373
  if (iterator < bandwidth - 1) {
302
374
  iterator += 1;
@@ -59,6 +59,7 @@ var TlLincolnOta;
59
59
  TlLincolnOta["MYREALTRIP"] = "Myrealtrip";
60
60
  TlLincolnOta["YANOLJA"] = "Yanolja";
61
61
  TlLincolnOta["T_MON"] = "T-mon";
62
+ TlLincolnOta["TRIPDOTCOM"] = "Trip.com Group(new)";
62
63
  })(TlLincolnOta || (TlLincolnOta = {}));
63
64
  exports.TL_LINCOLN_TO_VENDIT_OTA_MAP = (_a = {},
64
65
  _a[TlLincolnOta.JEJU_COM] = 'Jeju.com',
@@ -116,4 +117,5 @@ exports.TL_LINCOLN_TO_VENDIT_OTA_MAP = (_a = {},
116
117
  _a[TlLincolnOta.MYREALTRIP] = 'MYREALTRIP',
117
118
  _a[TlLincolnOta.YANOLJA] = 'YANOLJA',
118
119
  _a[TlLincolnOta.T_MON] = 'TMON',
120
+ _a[TlLincolnOta.TRIPDOTCOM] = 'TRIPDOTCOM',
119
121
  _a);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendit-dev/thirdparty-adapters",
3
- "version": "0.7.8",
3
+ "version": "0.7.10",
4
4
  "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {