@chevre/domain 24.0.0-alpha.47 → 24.0.0-alpha.48
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/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +1 -1
- package/lib/chevre/repo/factory/reservation/createMongoConditions.js +2 -2
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +1 -1
- package/lib/chevre/repo/reservation.d.ts +13 -8
- package/lib/chevre/repo/reservation.js +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/confirm/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/reserve/cancelReservation.d.ts +1 -1
- package/lib/chevre/service/reserve/cancelReservation.js +12 -8
- package/lib/chevre/service/reserve/confirmReservation.js +9 -5
- package/lib/chevre/service/reserve/factory.d.ts +2 -2
- package/lib/chevre/service/reserve/findByCode.d.ts +1 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +5 -2
- package/lib/chevre/service/reserve/searchByOrder.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FilterQuery } from 'mongoose';
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
|
-
export declare function CREATE_MONGO_CONDITIONS(params: factory.reservation.ISearchConditions
|
|
3
|
+
export declare function CREATE_MONGO_CONDITIONS(params: factory.reservation.eventReservation.ISearchConditions): FilterQuery<import("@chevre/factory/lib/reservation/event").IReservation>[];
|
|
@@ -407,8 +407,8 @@ function CREATE_MONGO_CONDITIONS(params) {
|
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
409
|
break;
|
|
410
|
-
case factory.reservationType.ReservationPackage:
|
|
411
|
-
|
|
410
|
+
// case factory.reservationType.ReservationPackage:
|
|
411
|
+
// break;
|
|
412
412
|
default:
|
|
413
413
|
}
|
|
414
414
|
/* istanbul ignore else */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../virtuals';
|
|
3
3
|
import * as factory from '../../../factory';
|
|
4
|
-
type IDocType = (Omit<factory.reservation.IReservation
|
|
4
|
+
type IDocType = (Omit<factory.reservation.eventReservation.IReservation, 'id'>) & {
|
|
5
5
|
_id: string;
|
|
6
6
|
bookingAgent?: any;
|
|
7
7
|
previousReservationStatus?: factory.reservationStatusType;
|
|
@@ -7,16 +7,21 @@ export interface IUpdatePartiallyParams {
|
|
|
7
7
|
}
|
|
8
8
|
export type ICancelResult = UpdateWriteOpResult;
|
|
9
9
|
export type ICheckedInResult = UpdateWriteOpResult;
|
|
10
|
-
export type ICreatingReservation
|
|
10
|
+
export type ICreatingReservation = Omit<factory.reservation.eventReservation.IReservation, 'id' | 'price' | 'reservedTicket'> & {
|
|
11
11
|
_id: string;
|
|
12
|
-
|
|
12
|
+
/**
|
|
13
|
+
* priceは廃止予定だが、互換性維持対応としてひとまず型を強制的に合わせる
|
|
14
|
+
*/
|
|
15
|
+
price?: factory.reservation.eventReservation.IPrice;
|
|
16
|
+
reservedTicket: factory.assetTransaction.reserve.ISubReservationReservedTicket;
|
|
17
|
+
};
|
|
13
18
|
/**
|
|
14
19
|
* 廃止予定の予約属性
|
|
15
20
|
*/
|
|
16
21
|
export type IDeprecatedField = 'price' | 'underName';
|
|
17
22
|
export type IKeyOfProjection = Exclude<keyof factory.reservation.eventReservation.IReservation, IDeprecatedField> | 'reservedTicket.dateUsed' | 'reservationFor.id' | 'reservationFor.typeOf';
|
|
18
|
-
export type IAttendedReservation = Pick<factory.reservation.IReservation
|
|
19
|
-
reservationFor: Pick<factory.reservation.IReservationFor
|
|
23
|
+
export type IAttendedReservation = Pick<factory.reservation.eventReservation.IReservation, 'id' | 'typeOf' | 'project' | 'modifiedTime'> & {
|
|
24
|
+
reservationFor: Pick<factory.reservation.eventReservation.IReservationFor, 'id' | 'typeOf'>;
|
|
20
25
|
reservedTicket: Pick<factory.reservation.eventReservation.IReservedTicket, 'dateUsed'>;
|
|
21
26
|
};
|
|
22
27
|
export type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, IDeprecatedField> & {
|
|
@@ -38,7 +43,7 @@ export declare class ReservationRepo {
|
|
|
38
43
|
/**
|
|
39
44
|
* 汎用予約カウント
|
|
40
45
|
*/
|
|
41
|
-
count
|
|
46
|
+
count(params: factory.reservation.eventReservation.ISearchConditions): Promise<number>;
|
|
42
47
|
/**
|
|
43
48
|
* 予約検索
|
|
44
49
|
*/
|
|
@@ -57,13 +62,13 @@ export declare class ReservationRepo {
|
|
|
57
62
|
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
58
63
|
reservationFor: factory.assetTransaction.reserve.IReservationFor;
|
|
59
64
|
reservationNumber: string;
|
|
60
|
-
underName?: factory.reservation.IUnderName
|
|
61
|
-
broker?: factory.reservation.IBroker
|
|
65
|
+
underName?: factory.reservation.IUnderName;
|
|
66
|
+
broker?: factory.reservation.IBroker;
|
|
62
67
|
}): Promise<BulkWriteResult | undefined>;
|
|
63
68
|
/**
|
|
64
69
|
* 予約取消
|
|
65
70
|
*/
|
|
66
|
-
cancelById
|
|
71
|
+
cancelById(params: {
|
|
67
72
|
id: string;
|
|
68
73
|
previousReservationStatus?: factory.reservationStatusType;
|
|
69
74
|
modifiedTime: Date;
|
|
@@ -140,7 +140,7 @@ class ReservationRepo {
|
|
|
140
140
|
switch (subReservation.typeOf) {
|
|
141
141
|
case factory.reservationType.EventReservation:
|
|
142
142
|
setOnInsert = {
|
|
143
|
-
...subReservation,
|
|
143
|
+
...subReservation,
|
|
144
144
|
_id: subReservation.id,
|
|
145
145
|
bookingTime: params.bookingTime,
|
|
146
146
|
checkedIn: false,
|
|
@@ -9,8 +9,8 @@ export declare function createStartParams(params: {
|
|
|
9
9
|
project: factory.assetTransaction.IProject;
|
|
10
10
|
transactionNumber: string;
|
|
11
11
|
transaction?: factory.assetTransaction.ITransaction<factory.assetTransactionType.Reserve>;
|
|
12
|
-
reservations?: (Pick<factory.reservation.IReservation
|
|
13
|
-
reservationFor: Pick<factory.reservation.IReservationFor
|
|
12
|
+
reservations?: (Pick<factory.reservation.eventReservation.IReservation, 'id' | 'issuedThrough' | 'typeOf' | 'reservationNumber'> & {
|
|
13
|
+
reservationFor: Pick<factory.reservation.eventReservation.IReservationFor, 'id' | 'typeOf'>;
|
|
14
14
|
})[];
|
|
15
15
|
}): factory.assetTransaction.IStartParams<factory.assetTransactionType.CancelReservation>;
|
|
16
16
|
export declare function createPotentialActions(params: {
|
|
@@ -19,7 +19,7 @@ export declare function validateStartParams(params: IStartParams): (repos: {
|
|
|
19
19
|
}) => Promise<{
|
|
20
20
|
reserveTransaction: import("@chevre/factory/lib/assetTransaction/reserve").ITransaction | undefined;
|
|
21
21
|
reservations: (Pick<import("@chevre/factory/lib/reservation/event").IReservation, "id" | "typeOf" | "issuedThrough" | "reservationNumber"> & {
|
|
22
|
-
reservationFor: Pick<factory.reservation.IReservationFor
|
|
22
|
+
reservationFor: Pick<factory.reservation.eventReservation.IReservationFor, "id" | "typeOf">;
|
|
23
23
|
})[] | undefined;
|
|
24
24
|
}>;
|
|
25
25
|
/**
|
|
@@ -3,6 +3,6 @@ declare function createPotentialActions(params: {
|
|
|
3
3
|
order?: Pick<factory.order.IOrder, 'orderNumber' | 'customer' | 'typeOf'>;
|
|
4
4
|
}): {
|
|
5
5
|
potentialActions: factory.assetTransaction.reserve.IPotentialActions;
|
|
6
|
-
underName?: factory.reservation.IUnderName
|
|
6
|
+
underName?: factory.reservation.IUnderName;
|
|
7
7
|
};
|
|
8
8
|
export { createPotentialActions };
|
|
@@ -46,8 +46,8 @@ declare function createReservation(params: {
|
|
|
46
46
|
ticketOffer: factory.product.ITicketOffer;
|
|
47
47
|
seatPriceComponent: factory.place.seat.IPriceComponent[];
|
|
48
48
|
acceptedAddOns: IAcceptedAddOn[];
|
|
49
|
-
subReservation?: factory.reservation.ISubReservation
|
|
50
|
-
programMembershipUsed?: factory.reservation.IProgramMembershipUsed
|
|
49
|
+
subReservation?: factory.reservation.eventReservation.ISubReservation[];
|
|
50
|
+
programMembershipUsed?: factory.reservation.IProgramMembershipUsed;
|
|
51
51
|
availableOffer: factory.unitPriceOffer.IUnitPriceOffer;
|
|
52
52
|
appliesToMovieTicket?: factory.assetTransaction.reserve.IAcceptedAppliesToMovieTicket;
|
|
53
53
|
validateAppliesToMovieTicket: boolean;
|
|
@@ -8,7 +8,7 @@ declare function createReserveTransactionStartParams(params: {
|
|
|
8
8
|
event: {
|
|
9
9
|
id: string;
|
|
10
10
|
};
|
|
11
|
-
broker?: factory.reservation.IBroker
|
|
11
|
+
broker?: factory.reservation.IBroker;
|
|
12
12
|
transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'expires' | 'seller'>;
|
|
13
13
|
transactionNumber: string;
|
|
14
14
|
}): factory.assetTransaction.reserve.IStartParamsWithoutDetail;
|
|
@@ -32,7 +32,7 @@ declare function processStartReserve4chevre(params: {
|
|
|
32
32
|
identifier?: string;
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
|
-
broker?: factory.reservation.IBroker
|
|
35
|
+
broker?: factory.reservation.IBroker;
|
|
36
36
|
transactionNumber: string;
|
|
37
37
|
transaction: Pick<factory.transaction.ITransaction<factory.transactionType.PlaceOrder>, 'agent' | 'expires' | 'id' | 'project' | 'seller' | 'typeOf'>;
|
|
38
38
|
availableAtOrFrom: {
|
|
@@ -36,7 +36,7 @@ declare function processUnlockOfferRateLimit(params: {
|
|
|
36
36
|
};
|
|
37
37
|
reservation: {
|
|
38
38
|
reservationNumber: string;
|
|
39
|
-
reservedTicket: factory.
|
|
39
|
+
reservedTicket: Pick<factory.assetTransaction.reserve.ISubReservationReservedTicket, 'ticketType'>;
|
|
40
40
|
};
|
|
41
41
|
reservationFor: factory.assetTransaction.reserve.IReservationFor;
|
|
42
42
|
}): (repos: {
|
|
@@ -276,14 +276,18 @@ function cancelReservation(actionAttributesList) {
|
|
|
276
276
|
expectedHolder
|
|
277
277
|
})(repos);
|
|
278
278
|
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
279
|
+
const subReservationByTransaction = reserveTransaction?.object.subReservation?.find((s) => s.id === reservation.id);
|
|
280
|
+
if (subReservationByTransaction !== undefined) {
|
|
281
|
+
await processUnlockOfferRateLimit({
|
|
282
|
+
project: { id: reservation.project.id },
|
|
283
|
+
reservation: {
|
|
284
|
+
reservationNumber: reservation.reservationNumber,
|
|
285
|
+
// reservedTicket: reservation.reservedTicket
|
|
286
|
+
reservedTicket: subReservationByTransaction.reservedTicket
|
|
287
|
+
},
|
|
288
|
+
reservationFor: reservation.reservationFor
|
|
289
|
+
})(repos);
|
|
290
|
+
}
|
|
287
291
|
// 予約をキャンセル状態に変更する
|
|
288
292
|
await repos.reservation.cancelById({
|
|
289
293
|
id: reservation.id,
|
|
@@ -65,17 +65,21 @@ function confirmReservation(params) {
|
|
|
65
65
|
// price,underName,ticketTypeは予約取引から補完する(2026-03-25~)
|
|
66
66
|
confirmedReservations = rawReservations.map((rawReservation) => {
|
|
67
67
|
const subReservationByTransaction = reserveTransaction.object.subReservation?.find((s) => s.id === rawReservation.id);
|
|
68
|
-
|
|
68
|
+
// 予約取引内にsubReservationは必ず存在するはず
|
|
69
|
+
if (subReservationByTransaction === undefined) {
|
|
70
|
+
throw new factory.errors.NotFound('reserveTransaction.object.subReservation');
|
|
71
|
+
}
|
|
72
|
+
const priceByTransaction = subReservationByTransaction.price;
|
|
69
73
|
const underNameByTransaction = reserveTransaction.object.underName;
|
|
70
|
-
const ticketTypeByTransaction = subReservationByTransaction
|
|
74
|
+
const ticketTypeByTransaction = subReservationByTransaction.reservedTicket.ticketType;
|
|
71
75
|
// console.log('creating confirmedReservation...', rawReservation, priceByTransaction, underNameByTransaction, ticketTypeByTransaction);
|
|
72
76
|
return {
|
|
73
77
|
...rawReservation,
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
price: priceByTransaction,
|
|
79
|
+
underName: underNameByTransaction,
|
|
76
80
|
reservedTicket: {
|
|
77
81
|
...rawReservation.reservedTicket,
|
|
78
|
-
|
|
82
|
+
ticketType: ticketTypeByTransaction
|
|
79
83
|
}
|
|
80
84
|
};
|
|
81
85
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
2
|
export declare function optimizeUnderName4inform(params: {
|
|
3
|
-
underName: factory.reservation.IUnderName
|
|
3
|
+
underName: factory.reservation.IUnderName;
|
|
4
4
|
}): factory.notification.reservation.IMaskedUnderName;
|
|
5
5
|
export type IPotentialInformReservationAction = factory.task.triggerWebhook.IPotentialInformReservationAction;
|
|
6
6
|
export declare const NUM_TRY_INFORM_RESERVATION = 10;
|
|
@@ -8,7 +8,7 @@ export declare function createMoneyTransferActions(params: {
|
|
|
8
8
|
acceptedOffer?: factory.assetTransaction.reserve.IAcceptedOffer4object;
|
|
9
9
|
reservation: Pick<factory.assetTransaction.reserve.IObjectSubReservation, 'reservedTicket'>;
|
|
10
10
|
transaction: factory.assetTransaction.ITransaction<factory.assetTransactionType.Reserve>;
|
|
11
|
-
underName?: factory.reservation.IUnderName
|
|
11
|
+
underName?: factory.reservation.IUnderName;
|
|
12
12
|
}): import("@chevre/factory/lib/action/transfer/moneyTransfer").IAttributes[];
|
|
13
13
|
export interface IPotentialCancelAction extends factory.action.cancel.reservation.IAttributes {
|
|
14
14
|
purpose: {
|
|
@@ -3,8 +3,7 @@ import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
|
3
3
|
import type { AuthorizationRepo } from '../../repo/authorization';
|
|
4
4
|
import type { OrderRepo } from '../../repo/order';
|
|
5
5
|
import type { ReservationRepo } from '../../repo/reservation';
|
|
6
|
-
type
|
|
7
|
-
type IReservationResult = Pick<factory.reservation.IReservation<AvailableReservationType>, 'id' | 'additionalTicketText' | 'checkedIn' | 'reservationStatus'> & {
|
|
6
|
+
type IReservationResult = Pick<factory.reservation.eventReservation.IReservation, 'id' | 'additionalTicketText' | 'checkedIn' | 'reservationStatus'> & {
|
|
8
7
|
reservedTicket: {
|
|
9
8
|
ticketType: Pick<factory.reservation.eventReservation.ITicketType, 'identifier'> & {
|
|
10
9
|
name: {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import * as factory from '../../../factory';
|
|
5
5
|
import type { SettingRepo } from '../../../repo/setting';
|
|
6
6
|
import type { TaskRepo } from '../../../repo/task';
|
|
7
|
-
export type ICanceledEventReservation = Pick<factory.reservation.IReservation
|
|
7
|
+
export type ICanceledEventReservation = Pick<factory.reservation.eventReservation.IReservation, 'project' | 'id' | 'typeOf' | 'modifiedTime' | 'reservationNumber'>;
|
|
8
8
|
export declare function onReservationCanceled(
|
|
9
9
|
/**
|
|
10
10
|
* ステータス変更された予約リスト
|
|
@@ -5,9 +5,12 @@ import * as factory from '../../../factory';
|
|
|
5
5
|
import { AuthorizationRepo } from '../../../repo/authorization';
|
|
6
6
|
import type { SettingRepo } from '../../../repo/setting';
|
|
7
7
|
import type { TaskRepo } from '../../../repo/task';
|
|
8
|
-
export type IConfirmedReservation = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName'> & {
|
|
8
|
+
export type IConfirmedReservation = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName' | 'reservedTicket'> & {
|
|
9
9
|
price?: factory.reservation.eventReservation.IPrice;
|
|
10
|
-
underName?: factory.reservation.IUnderName
|
|
10
|
+
underName?: factory.reservation.IUnderName;
|
|
11
|
+
reservedTicket: Omit<factory.assetTransaction.reserve.ISubReservationReservedTicket, 'ticketType'> & {
|
|
12
|
+
ticketType: factory.reservation.eventReservation.ITicketType;
|
|
13
|
+
};
|
|
11
14
|
};
|
|
12
15
|
/**
|
|
13
16
|
* 予約確定後のアクション
|
|
@@ -3,7 +3,7 @@ import * as factory from '../../factory';
|
|
|
3
3
|
import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
|
|
4
4
|
import type { OrderRepo } from '../../repo/order';
|
|
5
5
|
import type { ReservationRepo } from '../../repo/reservation';
|
|
6
|
-
type IReservationResult = Pick<factory.reservation.IReservation
|
|
6
|
+
type IReservationResult = Pick<factory.reservation.eventReservation.IReservation, 'id' | 'additionalTicketText' | 'reservationStatus'>;
|
|
7
7
|
declare function searchByOrder(params: {
|
|
8
8
|
limit: number;
|
|
9
9
|
page: number;
|
package/package.json
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "6.0.0
|
|
15
|
-
"@cinerino/sdk": "13.3.
|
|
14
|
+
"@chevre/factory": "6.0.0",
|
|
15
|
+
"@cinerino/sdk": "13.3.1",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
18
18
|
"@sendgrid/client": "8.1.4",
|
|
@@ -99,5 +99,5 @@
|
|
|
99
99
|
"postversion": "git push origin --tags",
|
|
100
100
|
"prepublishOnly": "npm run clean && npm run build"
|
|
101
101
|
},
|
|
102
|
-
"version": "24.0.0-alpha.
|
|
102
|
+
"version": "24.0.0-alpha.48"
|
|
103
103
|
}
|