@escapenavigator/services 1.4.37 → 1.4.39
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/dist/api/certificatesales-api/index.d.ts +0 -2
- package/dist/api/certificatesales-api/index.js +0 -2
- package/dist/api/certificatesales-api/legacy/update-delivery-info.d.ts +0 -0
- package/dist/api/certificatesales-api/legacy/update-delivery-info.js +16 -0
- package/dist/api/certificatesales-api/resend.d.ts +2 -3
- package/dist/api/certificatesales-api/resend.js +5 -7
- package/dist/api/certificatesales-api/update-tracking-info.d.ts +2 -2
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/serialize-slot.js +10 -1
- package/dist/utils/tz-date.d.ts +9 -0
- package/dist/utils/tz-date.js +17 -0
- package/package.json +5 -3
- package/dist/api/certificatesales-api/update-delivery-info.d.ts +0 -10
- package/dist/api/certificatesales-api/update-delivery-info.js +0 -12
|
@@ -4,13 +4,11 @@ import { getOneByCode } from './get-one-by-code';
|
|
|
4
4
|
import { query } from './query';
|
|
5
5
|
import { resend } from './resend';
|
|
6
6
|
import { ship } from './ship';
|
|
7
|
-
import { updateDeliveryInfo } from './update-delivery-info';
|
|
8
7
|
import { updateExpireDate } from './update-expire-date';
|
|
9
8
|
import { updateTrackingInfo } from './update-tracking-info';
|
|
10
9
|
export type { CertificateSaleRO } from '@escapenavigator/types/dist/certificate-sale/certificate-sale.ro';
|
|
11
10
|
declare type ApiDeclaration = {
|
|
12
11
|
create: typeof create;
|
|
13
|
-
updateDeliveryInfo: typeof updateDeliveryInfo;
|
|
14
12
|
query: typeof query;
|
|
15
13
|
getOne: typeof getOne;
|
|
16
14
|
ship: typeof ship;
|
|
@@ -7,12 +7,10 @@ var get_one_by_code_1 = require("./get-one-by-code");
|
|
|
7
7
|
var query_1 = require("./query");
|
|
8
8
|
var resend_1 = require("./resend");
|
|
9
9
|
var ship_1 = require("./ship");
|
|
10
|
-
var update_delivery_info_1 = require("./update-delivery-info");
|
|
11
10
|
var update_expire_date_1 = require("./update-expire-date");
|
|
12
11
|
var update_tracking_info_1 = require("./update-tracking-info");
|
|
13
12
|
exports.certificateSalesApiDeclaration = {
|
|
14
13
|
create: create_1.create,
|
|
15
|
-
updateDeliveryInfo: update_delivery_info_1.updateDeliveryInfo,
|
|
16
14
|
query: query_1.query,
|
|
17
15
|
getOne: get_one_1.getOne,
|
|
18
16
|
ship: ship_1.ship,
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// import { CertificateSaleRO } from '@escapenavigator/types/dist/certificate-sale/certificate-sale.ro';
|
|
2
|
+
// import { UpdateCertificatesaleDeliveryInfoDto } from '@escapenavigator/types/dist/certificate-sale/update-certificatesale-delivery-info.dto';
|
|
3
|
+
// import { ApiMethodDeclaration } from '../..';
|
|
4
|
+
// type ParamsData = {
|
|
5
|
+
// id: number;
|
|
6
|
+
// data: UpdateCertificatesaleDeliveryInfoDto;
|
|
7
|
+
// };
|
|
8
|
+
// type ResponseData = CertificateSaleRO;
|
|
9
|
+
// export const updateDeliveryInfo: ApiMethodDeclaration<ParamsData, ResponseData> = ({
|
|
10
|
+
// id,
|
|
11
|
+
// data,
|
|
12
|
+
// }) => ({
|
|
13
|
+
// url: `/certificatesales/delivery-info/${id}`,
|
|
14
|
+
// method: 'PATCH',
|
|
15
|
+
// data,
|
|
16
|
+
// });
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
import { CertificatesaleResendDto } from '@escapenavigator/types/dist/certificate-sale/certificate-sale-resend.dto';
|
|
1
2
|
import { CertificateSaleRO } from '@escapenavigator/types/dist/certificate-sale/certificate-sale.ro';
|
|
2
3
|
import { ApiMethodDeclaration } from '..';
|
|
3
|
-
declare type ParamsData =
|
|
4
|
-
id: number;
|
|
5
|
-
};
|
|
4
|
+
declare type ParamsData = CertificatesaleResendDto;
|
|
6
5
|
declare type ResponseData = CertificateSaleRO;
|
|
7
6
|
export declare const resend: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
8
7
|
export {};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resend = void 0;
|
|
4
|
-
var resend = function (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
10
|
-
};
|
|
4
|
+
var resend = function (params) { return ({
|
|
5
|
+
url: '/certificatesales/resend',
|
|
6
|
+
method: 'GET',
|
|
7
|
+
params: params,
|
|
8
|
+
}); };
|
|
11
9
|
exports.resend = resend;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CertificateSaleRO } from '@escapenavigator/types/dist/certificate-sale/certificate-sale.ro';
|
|
2
|
-
import {
|
|
2
|
+
import { UpdateCertificatesaleTrackingInfoDto } from '@escapenavigator/types/dist/certificate-sale/update-certificatesale-tracking-info.dto';
|
|
3
3
|
import { ApiMethodDeclaration } from '..';
|
|
4
4
|
declare type ParamsData = {
|
|
5
5
|
id: number;
|
|
6
|
-
data:
|
|
6
|
+
data: UpdateCertificatesaleTrackingInfoDto;
|
|
7
7
|
};
|
|
8
8
|
declare type ResponseData = CertificateSaleRO;
|
|
9
9
|
export declare const updateTrackingInfo: ApiMethodDeclaration<ParamsData, ResponseData>;
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./serialize-record"), exports);
|
|
18
18
|
__exportStar(require("./validate-by-dto"), exports);
|
|
19
19
|
__exportStar(require("./get-handled-error-message"), exports);
|
|
20
|
+
__exportStar(require("./tz-date"), exports);
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.serializeSlot = exports.serializeSlotOrderData = void 0;
|
|
4
|
+
var getPayedStatus = function (order) {
|
|
5
|
+
if (!order.payed)
|
|
6
|
+
return 'not_payed';
|
|
7
|
+
if (order.total - order.payed === 0)
|
|
8
|
+
return 'payed';
|
|
9
|
+
if (order.total - order.payed > 0)
|
|
10
|
+
return 'half-payed';
|
|
11
|
+
return 'over-payed';
|
|
12
|
+
};
|
|
4
13
|
var serializeSlotOrderData = function (order) {
|
|
5
14
|
var _a, _b, _c, _d;
|
|
6
15
|
return order && {
|
|
7
16
|
id: order.id,
|
|
8
17
|
players: order.players,
|
|
9
|
-
|
|
18
|
+
status: getPayedStatus(order),
|
|
10
19
|
hasDiscounts: !!((_a = order.discounts) === null || _a === void 0 ? void 0 : _a.length),
|
|
11
20
|
hasCertificateApplies: !!((_b = order.certificates) === null || _b === void 0 ? void 0 : _b.length),
|
|
12
21
|
hasPenalties: !!((_c = order.penalties) === null || _c === void 0 ? void 0 : _c.length),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare type Props = {
|
|
2
|
+
date: string;
|
|
3
|
+
time: string;
|
|
4
|
+
timezone: 'Europe/Berlin';
|
|
5
|
+
hours: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const convertZonedToUTC: ({ date, time, timezone, hours, }: Props) => string;
|
|
8
|
+
export declare const convertUtcToZoned: ({ date, timezone }: Pick<Props, 'date' | 'timezone'>) => string;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertUtcToZoned = exports.convertZonedToUTC = void 0;
|
|
4
|
+
var date_fns_1 = require("date-fns");
|
|
5
|
+
var date_fns_tz_1 = require("date-fns-tz");
|
|
6
|
+
var convertZonedToUTC = function (_a) {
|
|
7
|
+
var date = _a.date, time = _a.time, timezone = _a.timezone, hours = _a.hours;
|
|
8
|
+
var d = (0, date_fns_tz_1.zonedTimeToUtc)(new Date("".concat(date, "T").concat(time)), timezone);
|
|
9
|
+
var u = (0, date_fns_1.addHours)(d, hours).toISOString();
|
|
10
|
+
return u.split('.')[0];
|
|
11
|
+
};
|
|
12
|
+
exports.convertZonedToUTC = convertZonedToUTC;
|
|
13
|
+
var convertUtcToZoned = function (_a) {
|
|
14
|
+
var date = _a.date, timezone = _a.timezone;
|
|
15
|
+
return (0, date_fns_1.format)((0, date_fns_tz_1.utcToZonedTime)("".concat(date, ".000Z"), timezone), 'dd.MM.yyyy, HH:mm');
|
|
16
|
+
};
|
|
17
|
+
exports.convertUtcToZoned = convertUtcToZoned;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@escapenavigator/services",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.39",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"build": "rm -rf dist && tsc --project tsconfig.json"
|
|
14
14
|
},
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "45a3e9a53b22ee703585c23a3a634ac839d4af9e",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@escapenavigator/types": "^1.4.
|
|
17
|
+
"@escapenavigator/types": "^1.4.39",
|
|
18
18
|
"axios": "^0.21.4",
|
|
19
19
|
"class-transformer": "^0.5.1",
|
|
20
20
|
"class-validator": "^0.13.1",
|
|
21
|
+
"date-fns": "^2.22.1",
|
|
22
|
+
"date-fns-tz": "^2.0.0",
|
|
21
23
|
"i18next": "^21.6.4",
|
|
22
24
|
"react": "^17.0.2",
|
|
23
25
|
"react-dom": "^17.0.2"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CertificateSaleRO } from '@escapenavigator/types/dist/certificate-sale/certificate-sale.ro';
|
|
2
|
-
import { UpdateCertificatesaleDeliveryInfoDto } from '@escapenavigator/types/dist/certificate-sale/update-certificatesale-delivery-info.dto';
|
|
3
|
-
import { ApiMethodDeclaration } from '..';
|
|
4
|
-
declare type ParamsData = {
|
|
5
|
-
id: number;
|
|
6
|
-
data: UpdateCertificatesaleDeliveryInfoDto;
|
|
7
|
-
};
|
|
8
|
-
declare type ResponseData = CertificateSaleRO;
|
|
9
|
-
export declare const updateDeliveryInfo: ApiMethodDeclaration<ParamsData, ResponseData>;
|
|
10
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateDeliveryInfo = void 0;
|
|
4
|
-
var updateDeliveryInfo = function (_a) {
|
|
5
|
-
var id = _a.id, data = _a.data;
|
|
6
|
-
return ({
|
|
7
|
-
url: "/certificatesales/delivery-info/".concat(id),
|
|
8
|
-
method: 'PATCH',
|
|
9
|
-
data: data,
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
exports.updateDeliveryInfo = updateDeliveryInfo;
|