@vendit-dev/thirdparty-adapters 0.7.23 → 0.7.24
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.
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"editor.formatOnSave": true,
|
|
3
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
4
|
+
"editor.codeActionsOnSave": {
|
|
5
|
+
"source.fixAll": "explicit",
|
|
6
|
+
"source.organizeImports": "explicit"
|
|
7
|
+
},
|
|
8
|
+
"editor.tabSize": 2,
|
|
9
|
+
"editor.indentSize": "tabSize",
|
|
10
|
+
"editor.insertSpaces": true,
|
|
11
|
+
"editor.detectIndentation": false,
|
|
12
|
+
"editor.formatOnSaveMode": "modifications",
|
|
13
|
+
"prettier.singleQuote": true,
|
|
14
|
+
"prettier.trailingComma": "all",
|
|
15
|
+
"prettier.arrowParens": "avoid",
|
|
16
|
+
"prettier.useEditorConfig": true
|
|
17
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExternalReservation, ExternalReservationType, ReservationStatus } from './externalChannelManager.type';
|
|
2
|
-
import { type
|
|
2
|
+
import { type DataClassificationType, type InfoTravelXML, type MealConditionType, type RoomInformation, type SpecificMealConditionType, type BasicInformation as TBasicInformation } from './tl-lincoln.types';
|
|
3
3
|
interface CommonRequest {
|
|
4
4
|
systemId: string;
|
|
5
5
|
pmsUserId: string;
|
|
@@ -26,8 +26,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.withAsyncBandwidth = exports.refineReservationData = exports.formattedPaxCountText = exports.formattedNameForMealCondition = exports.getExternalReservationTypeFromDataClassification = exports.getReservationStatusFromDataClassification = exports.xmlToJson = exports.jsonToXml = void 0;
|
|
27
27
|
var fast_xml_parser_1 = require("fast-xml-parser");
|
|
28
28
|
var moment_1 = __importDefault(require("moment"));
|
|
29
|
-
var tl_lincoln_types_1 = require("./tl-lincoln.types");
|
|
30
29
|
var tl_lincoln_ota_1 = require("../../types/tl-lincoln.ota");
|
|
30
|
+
var tl_lincoln_types_1 = require("./tl-lincoln.types");
|
|
31
31
|
function jsonToXml(json) {
|
|
32
32
|
var options = {
|
|
33
33
|
ignoreAttributes: false,
|
|
@@ -199,22 +199,19 @@ function formatPhoneNumber(text) {
|
|
|
199
199
|
return onlyNumberText;
|
|
200
200
|
}
|
|
201
201
|
var makePaymentInfo = function (_a) {
|
|
202
|
-
var datas = _a.datas,
|
|
202
|
+
var datas = _a.datas, basicInformation = _a.basicInformation, reservationType = _a.reservationType, OptionList = _a.OptionList;
|
|
203
203
|
return datas.reduce(function (paymentInput, _a) {
|
|
204
|
-
var _b, _c, _d;
|
|
204
|
+
var _b, _c, _d, _e;
|
|
205
205
|
var RoomInfo = _a.RoomInformation, RoomRateInformation = _a.RoomRateInformation;
|
|
206
|
-
var roomAmount = (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomRate) ||
|
|
207
|
-
(
|
|
208
|
-
|
|
209
|
-
(
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
(RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomRate) ||
|
|
214
|
-
basicRateInformation.TotalAccommodationCharge ||
|
|
215
|
-
0;
|
|
206
|
+
var roomAmount = (_b = RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomRate) !== null && _b !== void 0 ? _b : (((RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerMaleRate) || 0) *
|
|
207
|
+
(RoomInfo.RoomPaxMaleCount || 0) +
|
|
208
|
+
((RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerFemaleRate) ||
|
|
209
|
+
(RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.PerMaleRate) ||
|
|
210
|
+
0) *
|
|
211
|
+
(RoomInfo.RoomPaxFemaleCount || 0) ||
|
|
212
|
+
0);
|
|
216
213
|
paymentInput.amount += roomAmount;
|
|
217
|
-
(
|
|
214
|
+
(_c = paymentInput.segments) === null || _c === void 0 ? void 0 : _c.push({
|
|
218
215
|
amount: roomAmount,
|
|
219
216
|
servedAt: RoomRateInformation.RoomDate,
|
|
220
217
|
referenceType: 'RESERVATION',
|
|
@@ -223,7 +220,7 @@ var makePaymentInfo = function (_a) {
|
|
|
223
220
|
if (basicInformation.MealCondition !== 'Other' &&
|
|
224
221
|
basicInformation.MealCondition !== 'WithoutMeal') {
|
|
225
222
|
paymentInput.amount += (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomServiceFee) || 0;
|
|
226
|
-
(
|
|
223
|
+
(_d = paymentInput.segments) === null || _d === void 0 ? void 0 : _d.push({
|
|
227
224
|
amount: (RoomRateInformation === null || RoomRateInformation === void 0 ? void 0 : RoomRateInformation.TotalPerRoomServiceFee) || 0,
|
|
228
225
|
servedAt: RoomRateInformation.RoomDate,
|
|
229
226
|
referenceType: 'SERVICE',
|
|
@@ -231,7 +228,7 @@ var makePaymentInfo = function (_a) {
|
|
|
231
228
|
});
|
|
232
229
|
}
|
|
233
230
|
if ((OptionList === null || OptionList === void 0 ? void 0 : OptionList.length) > 0) {
|
|
234
|
-
(
|
|
231
|
+
(_e = paymentInput.segments) === null || _e === void 0 ? void 0 : _e.push.apply(_e, OptionList.map(function (option) { return ({
|
|
235
232
|
amount: 0,
|
|
236
233
|
servedAt: option.OptionDate,
|
|
237
234
|
referenceType: 'SERVICE',
|
|
@@ -330,7 +327,6 @@ var refineReservationData = function (infoTravelXML) {
|
|
|
330
327
|
var DepositList = (BasicRate === null || BasicRate === void 0 ? void 0 : BasicRate.DepositList) && (0, tl_lincoln_types_1.makeArray)(BasicRate.DepositList);
|
|
331
328
|
var paymentInfo = makePaymentInfo({
|
|
332
329
|
datas: datas,
|
|
333
|
-
basicRateInformation: BasicRateInformation,
|
|
334
330
|
basicInformation: BasicInformation,
|
|
335
331
|
reservationType: reservationType,
|
|
336
332
|
OptionList: OptionList,
|
|
@@ -60,9 +60,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
60
60
|
};
|
|
61
61
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
62
|
exports.TlLincoln = void 0;
|
|
63
|
+
var moment_1 = __importDefault(require("moment"));
|
|
63
64
|
/* eslint-disable no-await-in-loop */
|
|
64
65
|
var node_fetch_1 = __importDefault(require("node-fetch"));
|
|
65
|
-
var moment_1 = __importDefault(require("moment"));
|
|
66
66
|
var externalChannelManager_type_1 = require("./externalChannelManager.type");
|
|
67
67
|
var tl_lincoln_helper_1 = require("./tl-lincoln.helper");
|
|
68
68
|
var tl_lincoln_types_1 = require("./tl-lincoln.types");
|
package/package.json
CHANGED
|
@@ -1,52 +1,50 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"uuid": "^8.3.2"
|
|
51
|
-
}
|
|
2
|
+
"name": "@vendit-dev/thirdparty-adapters",
|
|
3
|
+
"version": "0.7.24",
|
|
4
|
+
"description": "Third party adapters between v-cloud and other PMS/CMS providers.",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"dev": "node ./test/tl-lincoln.test.js",
|
|
9
|
+
"npm-login": "npm login",
|
|
10
|
+
"publish": "npm publish"
|
|
11
|
+
},
|
|
12
|
+
"keywords": ["vendit"],
|
|
13
|
+
"author": "Vendit <dev@vendit.co.kr> (https://vendit.co.kr)",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@babel/cli": "^7.10.5",
|
|
17
|
+
"@babel/core": "^7.10.5",
|
|
18
|
+
"@babel/node": "^7.10.5",
|
|
19
|
+
"@babel/plugin-proposal-class-properties": "^7.10.4",
|
|
20
|
+
"@babel/plugin-proposal-optional-chaining": "^7.10.4",
|
|
21
|
+
"@babel/preset-env": "^7.10.4",
|
|
22
|
+
"@babel/preset-flow": "^7.10.4",
|
|
23
|
+
"@types/ioredis": "^5.0.0",
|
|
24
|
+
"@types/node": "^20.4.5",
|
|
25
|
+
"@types/node-fetch": "^2.6.1",
|
|
26
|
+
"@types/npm": "^7.19.1",
|
|
27
|
+
"@types/sequelize": "^4.28.15",
|
|
28
|
+
"@types/tedious": "^4.0.9",
|
|
29
|
+
"@types/validator": "^13.7.17",
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "^3.6.1",
|
|
31
|
+
"@typescript-eslint/parser": "^3.6.1",
|
|
32
|
+
"@vendit-dev/utility-modules": "^0.20.1",
|
|
33
|
+
"babel-eslint": "^10.1.0",
|
|
34
|
+
"babel-plugin-module-resolver": "^4.0.0",
|
|
35
|
+
"cross-env": "^7.0.2",
|
|
36
|
+
"eslint": "^7.4.0",
|
|
37
|
+
"eslint-config-airbnb-base": "^13.1.0",
|
|
38
|
+
"eslint-plugin-import": "^2.16.0",
|
|
39
|
+
"typescript": "4.9.3"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"fast-xml-parser": "^4.4.0",
|
|
43
|
+
"moment": "^2.29.2",
|
|
44
|
+
"node-fetch": "2",
|
|
45
|
+
"npm": "6",
|
|
46
|
+
"sequelize": "^6.32.1",
|
|
47
|
+
"tedious": "6.2.1",
|
|
48
|
+
"uuid": "^8.3.2"
|
|
49
|
+
}
|
|
52
50
|
}
|