@chevre/domain 21.2.0-alpha.99 → 21.2.0
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/example/src/chevre/aggregateEventReservation.ts +1 -1
- package/example/src/chevre/aggregateSellerPaymentAccepted.ts +27 -0
- package/example/src/chevre/aggregation/aggregateSystem.ts +53 -22
- package/example/src/chevre/countDelayedTasks.ts +7 -2
- package/example/src/chevre/createManyEventsIfNotExist.ts +199 -46
- package/example/src/chevre/findScreeningRoomsByBranchCode.ts +4 -3
- package/example/src/chevre/giveUpStartDatePassedCertainPeriod.ts +56 -0
- package/example/src/chevre/lockStockHolder.ts +5 -2
- package/example/src/chevre/migrateCategoryCodeAdditionalProperties.ts +116 -0
- package/example/src/chevre/migrateScreeningEventSeriesVersion.ts +79 -0
- package/example/src/chevre/processRegisterMembership.ts +8 -4
- package/example/src/chevre/processRegisterPaymentCard.ts +8 -4
- package/example/src/chevre/processReserve.ts +1 -1
- package/example/src/chevre/searchAbortedTasks.ts +4 -6
- package/example/src/chevre/searchEventSeats.ts +5 -2
- package/example/src/chevre/searchHoldReservations.ts +38 -0
- package/example/src/chevre/searchPermissions.ts +54 -0
- package/example/src/chevre/searchScreeningRooms.ts +35 -0
- package/example/src/chevre/sendEmailMessage.ts +1 -2
- package/example/src/chevre/syncScreeningRooms.ts +22 -0
- package/example/src/chevre/syncScreeningRoomsAll.ts +44 -0
- package/example/src/chevre/unsetContainsInPlaceFromMovieTheater.ts +41 -0
- package/lib/chevre/factory/order.d.ts +4 -1
- package/lib/chevre/factory/order.js +19 -6
- package/lib/chevre/repo/account.js +3 -2
- package/lib/chevre/repo/accountTransaction.js +2 -1
- package/lib/chevre/repo/accountingReport.d.ts +1 -3
- package/lib/chevre/repo/action.d.ts +50 -1
- package/lib/chevre/repo/action.js +53 -2
- package/lib/chevre/repo/additionalProperty.js +2 -1
- package/lib/chevre/repo/aggregation.d.ts +3 -0
- package/lib/chevre/repo/aggregation.js +3 -0
- package/lib/chevre/repo/assetTransaction.js +6 -5
- package/lib/chevre/repo/categoryCode.d.ts +1 -1
- package/lib/chevre/repo/categoryCode.js +37 -25
- package/lib/chevre/repo/code.js +3 -2
- package/lib/chevre/repo/comment.js +2 -1
- package/lib/chevre/repo/creativeWork.d.ts +1 -1
- package/lib/chevre/repo/creativeWork.js +35 -12
- package/lib/chevre/repo/customer.js +2 -1
- package/lib/chevre/repo/emailMessage.js +2 -1
- package/lib/chevre/repo/event.d.ts +30 -2
- package/lib/chevre/repo/event.js +87 -36
- package/lib/chevre/repo/member.d.ts +14 -0
- package/lib/chevre/repo/member.js +31 -3
- package/lib/chevre/repo/merchantReturnPolicy.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +3 -3
- package/lib/chevre/repo/mongoose/schemas/holdReservation.d.ts +75 -0
- package/lib/chevre/repo/mongoose/schemas/holdReservation.js +93 -0
- package/lib/chevre/repo/mongoose/schemas/offer.d.ts +3 -3
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +21 -21
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +6 -0
- package/lib/chevre/repo/mongoose/schemas/place.js +16 -1
- package/lib/chevre/repo/mongoose/schemas/product.js +6 -0
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +9 -9
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +3 -3
- package/lib/chevre/repo/offer.js +3 -2
- package/lib/chevre/repo/offerCatalog.js +0 -27
- package/lib/chevre/repo/offerItemCondition.js +2 -1
- package/lib/chevre/repo/order.js +8 -7
- package/lib/chevre/repo/ownershipInfo.js +2 -7
- package/lib/chevre/repo/paymentServiceProvider.d.ts +65 -0
- package/lib/chevre/repo/paymentServiceProvider.js +156 -0
- package/lib/chevre/repo/place.d.ts +203 -27
- package/lib/chevre/repo/place.js +1726 -694
- package/lib/chevre/repo/priceSpecification.js +3 -2
- package/lib/chevre/repo/product.d.ts +5 -3
- package/lib/chevre/repo/product.js +92 -5
- package/lib/chevre/repo/project.js +2 -1
- package/lib/chevre/repo/reservation.d.ts +9 -1
- package/lib/chevre/repo/reservation.js +29 -20
- package/lib/chevre/repo/role.d.ts +7 -0
- package/lib/chevre/repo/role.js +39 -2
- package/lib/chevre/repo/seller.d.ts +21 -1
- package/lib/chevre/repo/seller.js +59 -4
- package/lib/chevre/repo/serviceOutput.js +2 -1
- package/lib/chevre/repo/stockHolder.d.ts +143 -7
- package/lib/chevre/repo/stockHolder.js +622 -104
- package/lib/chevre/repo/task.d.ts +12 -1
- package/lib/chevre/repo/task.js +17 -7
- package/lib/chevre/repo/transaction.js +6 -5
- package/lib/chevre/repo/trip.js +2 -1
- package/lib/chevre/repository.d.ts +6 -0
- package/lib/chevre/repository.js +8 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +18 -8
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +19 -8
- package/lib/chevre/service/aggregation/system.d.ts +43 -1
- package/lib/chevre/service/aggregation/system.js +112 -2
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/account/validation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay.js +2 -2
- package/lib/chevre/service/assetTransaction/refund.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve.js +10 -3
- package/lib/chevre/service/event.d.ts +3 -0
- package/lib/chevre/service/event.js +52 -21
- package/lib/chevre/service/iam.d.ts +6 -2
- package/lib/chevre/service/iam.js +23 -9
- package/lib/chevre/service/offer/event/factory.js +22 -13
- package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +15 -8
- package/lib/chevre/service/offer/eventServiceByCOA.js +7 -9
- package/lib/chevre/service/offer/product/factory.js +13 -6
- package/lib/chevre/service/offer/product.js +2 -2
- package/lib/chevre/service/offer.d.ts +16 -8
- package/lib/chevre/service/offer.js +71 -8
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +31 -17
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged.js +2 -2
- package/lib/chevre/service/order/placeOrder.js +4 -4
- package/lib/chevre/service/order/returnOrder.js +1 -1
- package/lib/chevre/service/order/sendOrder.js +3 -3
- package/lib/chevre/service/payment/any/onPaymentStatusChanged.js +4 -6
- package/lib/chevre/service/payment/any/onRefund.js +46 -42
- package/lib/chevre/service/payment/creditCard.js +2 -2
- package/lib/chevre/service/payment/movieTicket/checkByIdentifier.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/factory.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/getCredentials.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/getCredentials.js +1 -1
- package/lib/chevre/service/payment/movieTicket/validation.js +16 -9
- package/lib/chevre/service/payment/movieTicket.js +2 -2
- package/lib/chevre/service/reserve/cancelReservation.js +15 -3
- package/lib/chevre/service/reserve/confirmReservation.js +19 -11
- package/lib/chevre/service/task/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/task/cancelPendingReservation.js +1 -1
- package/lib/chevre/service/task/cancelReservation.js +1 -1
- package/lib/chevre/service/task/deleteTransaction.js +2 -0
- package/lib/chevre/service/task/onEventChanged.d.ts +7 -0
- package/lib/chevre/service/task/onEventChanged.js +29 -0
- package/lib/chevre/service/task/onResourceUpdated.d.ts +7 -0
- package/lib/chevre/service/task/onResourceUpdated.js +396 -0
- package/lib/chevre/service/task/syncScreeningRooms.d.ts +7 -0
- package/lib/chevre/service/task/syncScreeningRooms.js +24 -0
- package/lib/chevre/service/task/voidReserveTransaction.js +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +2 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +129 -1
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +1 -0
- package/lib/chevre/service/transaction/moneyTransfer/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/moneyTransfer.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership/findCreditCard.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership/findPaymentCardPermit.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +1 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/givePointAward.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/moneyTransfer.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/registerService.js +1 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions/sendEmailMessage.js +4 -4
- package/lib/chevre/service/transaction/placeOrderInProgress/potentialActions.js +3 -4
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +8 -12
- package/lib/chevre/service/transaction/placeOrderInProgress.js +6 -4
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +1 -0
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnMoneyTransfer.js +2 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +5 -5
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +2 -2
- package/lib/chevre/service/transaction/returnOrder/potentialActions/sendEmailMessage.js +3 -3
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +3 -1
- package/lib/chevre/settings.d.ts +11 -0
- package/lib/chevre/settings.js +44 -2
- package/package.json +3 -3
- package/example/src/chevre/eventCatalog2eventService.ts +0 -123
- package/example/src/chevre/migrateOrderAdditionalProperties.ts +0 -85
- package/example/src/chevre/migrateStockHolderKeys.ts +0 -89
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { Connection } from 'mongoose';
|
|
1
2
|
import { RedisClientType } from 'redis';
|
|
3
|
+
import * as factory from '../factory';
|
|
2
4
|
export interface IOffer {
|
|
3
5
|
itemOffered?: {
|
|
4
6
|
serviceOutput?: {
|
|
@@ -12,18 +14,70 @@ export interface IOffer {
|
|
|
12
14
|
seatNumber: string;
|
|
13
15
|
}
|
|
14
16
|
export interface ILockKey {
|
|
17
|
+
project: {
|
|
18
|
+
id: string;
|
|
19
|
+
};
|
|
15
20
|
eventId: string;
|
|
16
21
|
startDate: Date;
|
|
22
|
+
hasTicketedSeat: boolean;
|
|
17
23
|
offers: IOffer[];
|
|
18
24
|
expires: Date;
|
|
19
25
|
holder: string;
|
|
20
26
|
}
|
|
21
27
|
export interface IUnlockKey {
|
|
28
|
+
project: {
|
|
29
|
+
id: string;
|
|
30
|
+
};
|
|
22
31
|
eventId: string;
|
|
23
32
|
startDate: Date;
|
|
33
|
+
hasTicketedSeat: boolean;
|
|
24
34
|
offer: IOffer;
|
|
35
|
+
holder: string;
|
|
25
36
|
}
|
|
26
37
|
export type IGetHolderResult = string | null;
|
|
38
|
+
export interface ISubReservation {
|
|
39
|
+
id?: string;
|
|
40
|
+
identifier: string;
|
|
41
|
+
reservedTicket?: {
|
|
42
|
+
ticketedSeat?: Pick<factory.reservation.ISeat<factory.reservationType>, 'seatNumber' | 'seatSection'>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface IReservationPackage {
|
|
46
|
+
reservationNumber: string;
|
|
47
|
+
subReservation: ISubReservation[];
|
|
48
|
+
}
|
|
49
|
+
export interface IAggregateReservation {
|
|
50
|
+
project: {
|
|
51
|
+
id: string;
|
|
52
|
+
typeOf: factory.organizationType.Project;
|
|
53
|
+
};
|
|
54
|
+
typeOf: 'AggregateReservation';
|
|
55
|
+
reservationCount: number;
|
|
56
|
+
reservationFor: {
|
|
57
|
+
id: string;
|
|
58
|
+
startDate: Date;
|
|
59
|
+
};
|
|
60
|
+
reservations: IReservationPackage[];
|
|
61
|
+
}
|
|
62
|
+
export interface ISearchSubReservationResult {
|
|
63
|
+
reservationNumber: string;
|
|
64
|
+
identifier: string;
|
|
65
|
+
}
|
|
66
|
+
export interface ISearchResult {
|
|
67
|
+
reservationNumber: string;
|
|
68
|
+
identifier: string;
|
|
69
|
+
reservationFor: {
|
|
70
|
+
id: string;
|
|
71
|
+
startDate: Date;
|
|
72
|
+
aggregateReservation: {
|
|
73
|
+
reservationCount: number;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
reservedTicket?: {
|
|
77
|
+
ticketedSeat?: Pick<factory.reservation.ISeat<factory.reservationType>, 'seatNumber' | 'seatSection'>;
|
|
78
|
+
};
|
|
79
|
+
objectSize?: number;
|
|
80
|
+
}
|
|
27
81
|
/**
|
|
28
82
|
* イベントストックホルダーリポジトリ
|
|
29
83
|
*/
|
|
@@ -31,9 +85,15 @@ export declare class StockHolderRepository {
|
|
|
31
85
|
static KEY_PREFIX_NEW: string;
|
|
32
86
|
static KEY_PREFIX: string;
|
|
33
87
|
private readonly redisClient;
|
|
34
|
-
|
|
88
|
+
private readonly holdReservationModel;
|
|
89
|
+
constructor(redisClient: RedisClientType, connection: Connection);
|
|
35
90
|
private static offer2field;
|
|
91
|
+
private static offer2subReservation;
|
|
36
92
|
private static createKey;
|
|
93
|
+
/**
|
|
94
|
+
* 新リポジトリを使用するかどうか
|
|
95
|
+
*/
|
|
96
|
+
private static useMongoose;
|
|
37
97
|
/**
|
|
38
98
|
* 座席をロックする(maxキャパシティチェック有)
|
|
39
99
|
*/
|
|
@@ -41,7 +101,12 @@ export declare class StockHolderRepository {
|
|
|
41
101
|
/**
|
|
42
102
|
* 座席をロックする
|
|
43
103
|
*/
|
|
44
|
-
lock(lockKey: ILockKey
|
|
104
|
+
lock(lockKey: ILockKey & {
|
|
105
|
+
/**
|
|
106
|
+
* テスト目的の強制オプション
|
|
107
|
+
*/
|
|
108
|
+
useMongooseForcibly?: boolean;
|
|
109
|
+
}): Promise<void>;
|
|
45
110
|
/**
|
|
46
111
|
* 座席ロックを解除する
|
|
47
112
|
*/
|
|
@@ -49,10 +114,6 @@ export declare class StockHolderRepository {
|
|
|
49
114
|
/**
|
|
50
115
|
* 空席でない座席を検索する
|
|
51
116
|
*/
|
|
52
|
-
findUnavailableOffersByEventId(params: {
|
|
53
|
-
eventId: string;
|
|
54
|
-
startDate: Date;
|
|
55
|
-
}): Promise<IOffer[]>;
|
|
56
117
|
/**
|
|
57
118
|
* 空席でない座席をカウントする
|
|
58
119
|
*/
|
|
@@ -60,20 +121,95 @@ export declare class StockHolderRepository {
|
|
|
60
121
|
event: {
|
|
61
122
|
id: string;
|
|
62
123
|
startDate: Date;
|
|
124
|
+
hasTicketedSeat: boolean;
|
|
63
125
|
};
|
|
64
126
|
}): Promise<number>;
|
|
65
127
|
/**
|
|
66
128
|
* 保持者を取得する
|
|
67
129
|
*/
|
|
68
|
-
getHolder(params: IUnlockKey): Promise<string | null | undefined>;
|
|
130
|
+
getHolder(params: Omit<IUnlockKey, 'holder'>): Promise<string | null | undefined>;
|
|
69
131
|
/**
|
|
70
132
|
* 在庫状況を検索する
|
|
71
133
|
* offers.lengthが0だと"ERR wrong number of arguments for 'hmget' command"となるので注意
|
|
72
134
|
*/
|
|
73
135
|
searchHolders(params: {
|
|
136
|
+
project: {
|
|
137
|
+
id: string;
|
|
138
|
+
};
|
|
74
139
|
eventId: string;
|
|
75
140
|
startDate: Date;
|
|
141
|
+
hasTicketedSeat: boolean;
|
|
76
142
|
offers: IOffer[];
|
|
77
143
|
}): Promise<IGetHolderResult[]>;
|
|
144
|
+
/**
|
|
145
|
+
* 汎用的な検索(mongooseのみ対応)
|
|
146
|
+
*/
|
|
147
|
+
search(params: {
|
|
148
|
+
limit?: number;
|
|
149
|
+
page?: number;
|
|
150
|
+
sort?: {
|
|
151
|
+
'reservationFor.startDate': factory.sortType;
|
|
152
|
+
};
|
|
153
|
+
project?: {
|
|
154
|
+
id?: {
|
|
155
|
+
$eq?: string;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
reservationFor?: {
|
|
159
|
+
id?: {
|
|
160
|
+
$eq?: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
reservationNumber?: {
|
|
164
|
+
$eq?: string;
|
|
165
|
+
};
|
|
166
|
+
id?: {
|
|
167
|
+
$eq?: string;
|
|
168
|
+
};
|
|
169
|
+
identifier?: {
|
|
170
|
+
$eq?: string;
|
|
171
|
+
};
|
|
172
|
+
reservedTicket?: {
|
|
173
|
+
ticketedSeat?: {
|
|
174
|
+
seatNumber?: {
|
|
175
|
+
$eq?: string;
|
|
176
|
+
};
|
|
177
|
+
seatSection?: {
|
|
178
|
+
$eq?: string;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
}): Promise<ISearchResult[]>;
|
|
183
|
+
/**
|
|
184
|
+
* 汎用的な集計(mongooseのみ対応)
|
|
185
|
+
*/
|
|
186
|
+
aggregateByReservationFor(params: {
|
|
187
|
+
limit?: number;
|
|
188
|
+
page?: number;
|
|
189
|
+
project?: {
|
|
190
|
+
id?: {
|
|
191
|
+
$eq?: string;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
reservationFor?: {
|
|
195
|
+
id?: {
|
|
196
|
+
$eq?: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
}): Promise<{
|
|
200
|
+
typeOf: 'AggregateReservation';
|
|
201
|
+
reservationCount: number;
|
|
202
|
+
reservationFor: {
|
|
203
|
+
id: string;
|
|
204
|
+
startDate: Date;
|
|
205
|
+
};
|
|
206
|
+
reservationPackageCount: number;
|
|
207
|
+
objectSize: number;
|
|
208
|
+
}[]>;
|
|
78
209
|
private checkIfConflicted;
|
|
210
|
+
private initializeHoldReservation;
|
|
211
|
+
/**
|
|
212
|
+
* 仮で追加したholdReservationsが重複していないかどうか検証する
|
|
213
|
+
*/
|
|
214
|
+
private checkIfAlreadyInUse;
|
|
79
215
|
}
|