@chevre/domain 20.1.0-alpha.41 → 20.1.0-alpha.43
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,14 +1,27 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
|
+
export declare const RESERVED_AGENT_IDENTIFIER_NAMES: string[];
|
|
2
3
|
declare type IEventReservation = factory.reservation.IReservation<factory.reservationType.EventReservation>;
|
|
3
4
|
export declare function maskUnderName(reservation: IEventReservation): IEventReservation;
|
|
4
5
|
export interface IProject {
|
|
5
6
|
id: string;
|
|
6
7
|
typeOf: factory.organizationType.Project;
|
|
7
8
|
}
|
|
9
|
+
export declare type ISubReservation = Omit<IEventReservation, 'project' | 'reservationFor' | 'reservationNumber' | 'reservationStatus' | 'underName'>;
|
|
10
|
+
/**
|
|
11
|
+
* 確定予約通知
|
|
12
|
+
*/
|
|
13
|
+
export interface IReservationPackage4informConfirmed {
|
|
14
|
+
project: IProject;
|
|
15
|
+
reservationFor: factory.reservation.IReservationFor<factory.reservationType.EventReservation>;
|
|
16
|
+
reservationNumber: string;
|
|
17
|
+
reservationStatus: factory.reservationStatusType;
|
|
18
|
+
subReservation: ISubReservation[];
|
|
19
|
+
underName?: factory.reservation.IUnderName<factory.reservationType.EventReservation>;
|
|
20
|
+
typeOf: factory.reservationType.ReservationPackage;
|
|
21
|
+
}
|
|
8
22
|
/**
|
|
9
23
|
* 確定予約通知
|
|
10
24
|
*/
|
|
11
|
-
export declare type IReservation4informConfirmed = IEventReservation;
|
|
12
25
|
/**
|
|
13
26
|
* 予約取消通知
|
|
14
27
|
*/
|
|
@@ -44,7 +57,7 @@ export interface IReservation4informUsed {
|
|
|
44
57
|
dateUsed?: Date;
|
|
45
58
|
};
|
|
46
59
|
}
|
|
47
|
-
export declare type IReservation4inform =
|
|
60
|
+
export declare type IReservation4inform = IReservationPackage4informConfirmed | IReservation4informCanceled | IReservation4informCheckedIn | IReservation4informUsed;
|
|
48
61
|
export declare type IInformObject = IReservation4inform[];
|
|
49
62
|
export declare type InformReservationActionattributes = factory.action.interact.inform.IAttributes<IInformObject, any>;
|
|
50
63
|
export declare const NUM_TRY_INFORM_RESERVATION: number;
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NUM_TRY_INFORM_RESERVATION = exports.maskUnderName = void 0;
|
|
3
|
+
exports.NUM_TRY_INFORM_RESERVATION = exports.maskUnderName = exports.RESERVED_AGENT_IDENTIFIER_NAMES = void 0;
|
|
4
|
+
exports.RESERVED_AGENT_IDENTIFIER_NAMES = [
|
|
5
|
+
'orderNumber',
|
|
6
|
+
'tokenIssuer',
|
|
7
|
+
'iss',
|
|
8
|
+
'clientId',
|
|
9
|
+
'sub',
|
|
10
|
+
'hostname',
|
|
11
|
+
'username'
|
|
12
|
+
];
|
|
4
13
|
const MASKED_PROFILE = '****';
|
|
5
14
|
function maskUnderName(reservation) {
|
|
6
|
-
var _a
|
|
15
|
+
var _a;
|
|
7
16
|
const underName = (typeof ((_a = reservation.underName) === null || _a === void 0 ? void 0 : _a.typeOf) === 'string')
|
|
8
17
|
? Object.assign(Object.assign({}, reservation.underName), { email: MASKED_PROFILE, telephone: MASKED_PROFILE, name: MASKED_PROFILE, familyName: MASKED_PROFILE, givenName: MASKED_PROFILE }) : undefined;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
// 不要なidentifierをmask(2022-12-24~)
|
|
19
|
+
const identifiers = (Array.isArray(reservation.identifier))
|
|
20
|
+
? reservation.identifier.filter((p) => {
|
|
21
|
+
return !exports.RESERVED_AGENT_IDENTIFIER_NAMES.includes(p.name);
|
|
22
|
+
})
|
|
23
|
+
: undefined;
|
|
24
|
+
return Object.assign(Object.assign(Object.assign({}, reservation), (Array.isArray(identifiers)) ? { identifier: identifiers } : undefined), (underName !== undefined) ? { underName } : undefined);
|
|
13
25
|
}
|
|
14
26
|
exports.maskUnderName = maskUnderName;
|
|
15
27
|
exports.NUM_TRY_INFORM_RESERVATION = 10;
|
|
@@ -8,6 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
11
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
23
|
exports.onReservationConfirmed = exports.onReservationConfirmedByAction = void 0;
|
|
13
24
|
/**
|
|
@@ -94,9 +105,16 @@ function onReservationConfirmed(confirmedReservations) {
|
|
|
94
105
|
// inform galobally
|
|
95
106
|
if (Array.isArray(informReservations)) {
|
|
96
107
|
taskAttributes.push(...informReservations.map((informReservation) => {
|
|
97
|
-
var _a;
|
|
108
|
+
var _a, _b;
|
|
98
109
|
const informUrl = String((_a = informReservation.recipient) === null || _a === void 0 ? void 0 : _a.url);
|
|
99
|
-
|
|
110
|
+
// ReservationPackage通知に変更(2022-12-24~)
|
|
111
|
+
// const informObject: IInformObject = confirmedReservations.map(maskUnderName);
|
|
112
|
+
const informObject = [Object.assign({ project: confirmedReservations[0].project, reservationFor: confirmedReservations[0].reservationFor, reservationNumber: confirmedReservations[0].reservationNumber, reservationStatus: confirmedReservations[0].reservationStatus, subReservation: confirmedReservations.map((r) => {
|
|
113
|
+
const { project, reservationFor, reservationNumber, reservationStatus, underName } = r, subReservation = __rest(r, ["project", "reservationFor", "reservationNumber", "reservationStatus", "underName"]);
|
|
114
|
+
return subReservation;
|
|
115
|
+
}), typeOf: factory.reservationType.ReservationPackage }, (typeof ((_b = confirmedReservations[0].underName) === null || _b === void 0 ? void 0 : _b.typeOf) === 'string')
|
|
116
|
+
? { underName: (0, factory_1.maskUnderName)(confirmedReservations[0]).underName }
|
|
117
|
+
: undefined)];
|
|
100
118
|
const informReservationAttributes = {
|
|
101
119
|
agent: confirmedReservations[0].project,
|
|
102
120
|
object: informObject,
|
package/package.json
CHANGED