@vendit-dev/thirdparty-adapters 0.7.17 → 0.7.19

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.
@@ -122,11 +122,11 @@ function groupByRoomWithTotalCounts(roomAndRoomRateInformations, totalRoomCount)
122
122
  var groupedRooms = Array(totalRoomCount).fill([]);
123
123
  return roomAndRoomRateInformations.reduce(function (acc, curr) {
124
124
  var RoomTypeCode = curr.RoomInformation.RoomTypeCode, RoomDate = curr.RoomRateInformation.RoomDate;
125
- var existingRooms = acc.find(function (groupedRooms) {
125
+ var existingRooms = acc.find(function (groupedRoom) {
126
126
  var _a, _b;
127
- return groupedRooms.length > 0 &&
128
- ((_b = (_a = groupedRooms[0]) === null || _a === void 0 ? void 0 : _a.RoomInformation) === null || _b === void 0 ? void 0 : _b.RoomTypeCode) === RoomTypeCode &&
129
- !groupedRooms.some(function (room) { return room.RoomRateInformation.RoomDate === RoomDate; });
127
+ return groupedRoom.length > 0 &&
128
+ ((_b = (_a = groupedRoom[0]) === null || _a === void 0 ? void 0 : _a.RoomInformation) === null || _b === void 0 ? void 0 : _b.RoomTypeCode) === RoomTypeCode &&
129
+ !groupedRoom.some(function (room) { return room.RoomRateInformation.RoomDate === RoomDate; });
130
130
  });
131
131
  if (existingRooms) {
132
132
  existingRooms.push(curr);
@@ -181,6 +181,15 @@ exports.formattedPaxCountText = formattedPaxCountText;
181
181
  function formatPhoneNumber(text) {
182
182
  var onlyNumberText = text === null || text === void 0 ? void 0 : text.replace(/[^0-9]/g, '');
183
183
  var safeNumberRegex = /^050{1}[0-9]{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
+ }
184
193
  if (safeNumberRegex.test(onlyNumberText || '')) {
185
194
  return onlyNumberText;
186
195
  }
@@ -341,7 +350,7 @@ var refineReservationData = function (infoTravelXML) {
341
350
  externalPlatformCode: SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCode,
342
351
  externalPlatformName: (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeCompanyName) ||
343
352
  (SalesOfficeInformation === null || SalesOfficeInformation === void 0 ? void 0 : SalesOfficeInformation.SalesOfficeName),
344
- cmsOtaNumber: "".concat(BasicInformation.TravelAgencyBookingNumber).concat(isGroupReservation ? "-v".concat(index + 1) : ''),
353
+ cmsOtaNumber: "".concat(BasicInformation.TravelAgencyBookingNumber).concat(isGroupReservation ? "v".concat(index + 1) : ''),
345
354
  cmsProductName: roomsSortedByDate[0].RoomInformation.RoomTypeName ||
346
355
  BasicInformation.PackagePlanName,
347
356
  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),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vendit-dev/thirdparty-adapters",
3
- "version": "0.7.17",
3
+ "version": "0.7.19",
4
4
  "description": "Third party adapters between v-cloud and other PMS/CMS providers.",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {