@chevre/domain 28.0.0-alpha.3 → 28.0.0-alpha.5
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/eventEmitter/transaction.d.ts +2 -2
- package/lib/chevre/eventEmitter/transaction.js +1 -1
- package/lib/chevre/repo/adminEvent.d.ts +0 -6
- package/lib/chevre/repo/adminEvent.js +3 -9
- package/lib/chevre/repo/adminTransaction.js +0 -98
- package/lib/chevre/repo/aggregateEvent.js +0 -1
- package/lib/chevre/repo/aggregateTransaction.d.ts +0 -1
- package/lib/chevre/repo/aggregateTransaction.js +0 -1
- package/lib/chevre/repo/event.d.ts +2 -2
- package/lib/chevre/repo/event.js +71 -110
- package/lib/chevre/repo/mongoose/schemas/transaction.js +54 -43
- package/lib/chevre/repo/orderInTransaction.js +0 -6
- package/lib/chevre/repo/transaction/placeOrder.d.ts +1 -6
- package/lib/chevre/repo/transaction/placeOrder.js +25 -84
- package/lib/chevre/repo/transaction.js +0 -1
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
- package/lib/chevre/service/aggregation/system.js +1 -3
- package/lib/chevre/service/assetTransaction/pay/start/preStart/validateAcceptedPaymentMethodIfNeeded.js +1 -2
- package/lib/chevre/service/event.js +0 -1
- package/lib/chevre/service/offer/event/authorize.js +1 -4
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +1 -1
- package/lib/chevre/service/offer/event/voidTransaction.js +2 -5
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -9
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -4
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -4
- package/lib/chevre/service/offer/onEventChanged.js +2 -4
- package/lib/chevre/service/offer.js +1 -2
- package/lib/chevre/service/payment/any/authorize.js +1 -1
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +1 -4
- package/lib/chevre/service/payment/any/processVoidPayTransaction.js +2 -2
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -2
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -4
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +1 -4
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -2
- package/package.json +2 -2
|
@@ -5,12 +5,12 @@ interface IListenArgsOnTransactionStatusChanged {
|
|
|
5
5
|
* 取引ID
|
|
6
6
|
*/
|
|
7
7
|
id: string;
|
|
8
|
-
typeOf: factory.transactionType;
|
|
8
|
+
typeOf: factory.transactionType.PlaceOrder;
|
|
9
9
|
status: factory.transactionStatusType;
|
|
10
10
|
}
|
|
11
11
|
type IOnTransactionStatusChangedListener = (listenArgs: IListenArgsOnTransactionStatusChanged) => void;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 注文取引イベントエミッター
|
|
14
14
|
*/
|
|
15
15
|
declare class TransactionEventEmitter extends EventEmitter {
|
|
16
16
|
onTransactionStatusChanged(listner: IOnTransactionStatusChangedListener): void;
|
|
@@ -7,7 +7,7 @@ var EventName;
|
|
|
7
7
|
EventName["OnTransactionStatusChanged"] = "OnTransactionStatusChanged";
|
|
8
8
|
})(EventName || (EventName = {}));
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 注文取引イベントエミッター
|
|
11
11
|
*/
|
|
12
12
|
class TransactionEventEmitter extends events_1.EventEmitter {
|
|
13
13
|
onTransactionStatusChanged(listner) {
|
|
@@ -170,9 +170,6 @@ export declare class AdminEventRepo {
|
|
|
170
170
|
};
|
|
171
171
|
}): Promise<mongo.DeleteResult>;
|
|
172
172
|
deleteManyEventsEndedByProject(params: {
|
|
173
|
-
typeOf: {
|
|
174
|
-
$in: factory.eventType.ScreeningEvent[];
|
|
175
|
-
};
|
|
176
173
|
project: {
|
|
177
174
|
id: string;
|
|
178
175
|
};
|
|
@@ -181,9 +178,6 @@ export declare class AdminEventRepo {
|
|
|
181
178
|
};
|
|
182
179
|
}): Promise<mongo.DeleteResult>;
|
|
183
180
|
deleteManyEventsEnded(params: {
|
|
184
|
-
typeOf: {
|
|
185
|
-
$eq: factory.eventType.ScreeningEvent;
|
|
186
|
-
};
|
|
187
181
|
endDate: {
|
|
188
182
|
$lte: Date;
|
|
189
183
|
};
|
|
@@ -155,8 +155,7 @@ class AdminEventRepo {
|
|
|
155
155
|
}
|
|
156
156
|
const doc = await this.eventModel.findOneAndUpdate({
|
|
157
157
|
_id: { $eq: params.id },
|
|
158
|
-
'project.id': { $eq: params.project.id }
|
|
159
|
-
typeOf: { $eq: typeOf }
|
|
158
|
+
'project.id': { $eq: params.project.id }
|
|
160
159
|
}, {
|
|
161
160
|
$set: updateFields
|
|
162
161
|
}, { upsert: false, new: false, projection: { _id: 1 } })
|
|
@@ -187,8 +186,7 @@ class AdminEventRepo {
|
|
|
187
186
|
}
|
|
188
187
|
try {
|
|
189
188
|
doc = await this.eventModel.findOneAndUpdate({
|
|
190
|
-
_id: { $eq: params.id }
|
|
191
|
-
typeOf: { $eq: typeOf }
|
|
189
|
+
_id: { $eq: params.id }
|
|
192
190
|
}, {
|
|
193
191
|
// 編集のためのみのメソッドになったので、setOnInsertは廃止(2025-10-27~)
|
|
194
192
|
// 上書き禁止属性を除外(2022-08-24~)
|
|
@@ -231,8 +229,7 @@ class AdminEventRepo {
|
|
|
231
229
|
bulkWriteOps.push({
|
|
232
230
|
updateOne: {
|
|
233
231
|
filter: {
|
|
234
|
-
_id: p.id
|
|
235
|
-
typeOf: p.attributes.typeOf
|
|
232
|
+
_id: p.id
|
|
236
233
|
},
|
|
237
234
|
update: {
|
|
238
235
|
$setOnInsert: {
|
|
@@ -279,7 +276,6 @@ class AdminEventRepo {
|
|
|
279
276
|
async syncScreeningEventSeries2screeningEvents(params) {
|
|
280
277
|
const superEvent = EventFactory.minimizeSuperEvent({ superEventFromDB: params.superEventFromDB });
|
|
281
278
|
await this.eventModel.updateMany({
|
|
282
|
-
typeOf: { $eq: factory_1.factory.eventType.ScreeningEvent },
|
|
283
279
|
'project.id': { $eq: params.project.id },
|
|
284
280
|
'superEvent.id': { $exists: true, $eq: params.superEventFromDB.id },
|
|
285
281
|
startDate: { $gte: params.startDate.$gte }
|
|
@@ -338,7 +334,6 @@ class AdminEventRepo {
|
|
|
338
334
|
}
|
|
339
335
|
async deleteManyEventsEndedByProject(params) {
|
|
340
336
|
return this.eventModel.deleteMany({
|
|
341
|
-
typeOf: { $in: params.typeOf.$in },
|
|
342
337
|
'project.id': { $eq: params.project.id },
|
|
343
338
|
endDate: { $lte: params.endDate.$lte }
|
|
344
339
|
})
|
|
@@ -346,7 +341,6 @@ class AdminEventRepo {
|
|
|
346
341
|
}
|
|
347
342
|
async deleteManyEventsEnded(params) {
|
|
348
343
|
return this.eventModel.deleteMany({
|
|
349
|
-
typeOf: { $eq: params.typeOf.$eq },
|
|
350
344
|
endDate: { $lte: params.endDate.$lte }
|
|
351
345
|
})
|
|
352
346
|
.exec();
|
|
@@ -68,51 +68,6 @@ class AdminTransactionRepo {
|
|
|
68
68
|
})
|
|
69
69
|
.exec();
|
|
70
70
|
}
|
|
71
|
-
// /**
|
|
72
|
-
// * タスクエクスポートの遅延している取引について明示的にemitTransactionStatusChangedを実行する
|
|
73
|
-
// */
|
|
74
|
-
// public async exportTasksMany(params: {
|
|
75
|
-
// now: Date;
|
|
76
|
-
// delayInSeconds: number;
|
|
77
|
-
// status: {
|
|
78
|
-
// $in: factory.transactionStatusType[];
|
|
79
|
-
// };
|
|
80
|
-
// limit: number;
|
|
81
|
-
// }) {
|
|
82
|
-
// const delayedTransactions = await this.transactionModel.find({
|
|
83
|
-
// status: { $in: params.status.$in },
|
|
84
|
-
// 'tasksExportAction.actionStatus': {
|
|
85
|
-
// $exists: true,
|
|
86
|
-
// $eq: factory.actionStatusType.PotentialActionStatus
|
|
87
|
-
// },
|
|
88
|
-
// endDate: {
|
|
89
|
-
// $exists: true,
|
|
90
|
-
// $lt: moment(params.now)
|
|
91
|
-
// .add(-params.delayInSeconds, 'seconds')
|
|
92
|
-
// .toDate()
|
|
93
|
-
// }
|
|
94
|
-
// })
|
|
95
|
-
// .select({
|
|
96
|
-
// _id: 0,
|
|
97
|
-
// id: { $toString: '$_id' },
|
|
98
|
-
// typeOf: 1,
|
|
99
|
-
// status: 1
|
|
100
|
-
// })
|
|
101
|
-
// .limit(params.limit)
|
|
102
|
-
// .setOptions({ maxTimeMS: MONGO_MAX_TIME_MS })
|
|
103
|
-
// .lean<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'status' | 'typeOf'>[]>()
|
|
104
|
-
// .exec();
|
|
105
|
-
// if (delayedTransactions.length > 0) {
|
|
106
|
-
// delayedTransactions.forEach((delayedTransaction) => {
|
|
107
|
-
// transactionEventEmitter.emitTransactionStatusChanged({
|
|
108
|
-
// id: delayedTransaction.id,
|
|
109
|
-
// typeOf: delayedTransaction.typeOf,
|
|
110
|
-
// status: delayedTransaction.status
|
|
111
|
-
// });
|
|
112
|
-
// });
|
|
113
|
-
// }
|
|
114
|
-
// return delayedTransactions;
|
|
115
|
-
// }
|
|
116
71
|
/**
|
|
117
72
|
* add(2025-03-13~)
|
|
118
73
|
*/
|
|
@@ -167,59 +122,6 @@ class AdminTransactionRepo {
|
|
|
167
122
|
return doc;
|
|
168
123
|
}
|
|
169
124
|
}
|
|
170
|
-
// /**
|
|
171
|
-
// * 取引を期限切れにする
|
|
172
|
-
// */
|
|
173
|
-
// public async makeExpired(params: {
|
|
174
|
-
// expires: { $lt: Date };
|
|
175
|
-
// limit: number; // add limit(2025-02-27~)
|
|
176
|
-
// }): Promise<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'>[]> {
|
|
177
|
-
// if (typeof params.limit !== 'number' || params.limit === 0) {
|
|
178
|
-
// throw new factory.errors.ArgumentNull('limit');
|
|
179
|
-
// }
|
|
180
|
-
// const sort: { [key in keyof factory.transaction.ITransaction<factory.transactionType>]?: factory.sortType } = {
|
|
181
|
-
// expires: factory.sortType.Ascending
|
|
182
|
-
// };
|
|
183
|
-
// // IDをemitしたいのでまずリスト検索(2023-04-27~)
|
|
184
|
-
// const expiringTransactions =
|
|
185
|
-
// await this.transactionModel.find({
|
|
186
|
-
// status: { $eq: factory.transactionStatusType.InProgress },
|
|
187
|
-
// expires: { $lt: params.expires.$lt }
|
|
188
|
-
// })
|
|
189
|
-
// .select({
|
|
190
|
-
// _id: 0,
|
|
191
|
-
// id: { $toString: '$_id' },
|
|
192
|
-
// typeOf: 1
|
|
193
|
-
// })
|
|
194
|
-
// .limit(params.limit)
|
|
195
|
-
// .sort(sort) // sort(2025-03-03~)
|
|
196
|
-
// .setOptions({ maxTimeMS: MONGO_MAX_TIME_MS })
|
|
197
|
-
// .lean<Pick<factory.transaction.ITransaction<factory.transactionType>, 'id' | 'typeOf'>[]>()
|
|
198
|
-
// .exec();
|
|
199
|
-
// if (expiringTransactions.length > 0) {
|
|
200
|
-
// // ステータスと期限を見て更新
|
|
201
|
-
// await this.transactionModel.updateMany(
|
|
202
|
-
// {
|
|
203
|
-
// _id: { $in: expiringTransactions.map((t) => t.id) },
|
|
204
|
-
// status: { $eq: factory.transactionStatusType.InProgress },
|
|
205
|
-
// expires: { $lt: params.expires.$lt }
|
|
206
|
-
// },
|
|
207
|
-
// {
|
|
208
|
-
// status: factory.transactionStatusType.Expired,
|
|
209
|
-
// endDate: new Date()
|
|
210
|
-
// }
|
|
211
|
-
// )
|
|
212
|
-
// .exec();
|
|
213
|
-
// expiringTransactions.forEach((expiringTransaction) => {
|
|
214
|
-
// transactionEventEmitter.emitTransactionStatusChanged({
|
|
215
|
-
// id: expiringTransaction.id,
|
|
216
|
-
// typeOf: expiringTransaction.typeOf,
|
|
217
|
-
// status: factory.transactionStatusType.Expired
|
|
218
|
-
// });
|
|
219
|
-
// });
|
|
220
|
-
// }
|
|
221
|
-
// return expiringTransactions;
|
|
222
|
-
// }
|
|
223
125
|
async findByIdAndDelete(params) {
|
|
224
126
|
await this.transactionModel.findByIdAndDelete(params.id)
|
|
225
127
|
.exec();
|
|
@@ -22,7 +22,6 @@ class AggregateEventRepo {
|
|
|
22
22
|
$gte: params.startFrom,
|
|
23
23
|
$lte: params.startThrough
|
|
24
24
|
},
|
|
25
|
-
typeOf: { $eq: params.typeOf },
|
|
26
25
|
eventStatus: { $eq: eventStatus },
|
|
27
26
|
...(typeof params.project?.id?.$ne === 'string')
|
|
28
27
|
? { 'project.id': { $ne: params.project.id.$ne } }
|
|
@@ -22,7 +22,6 @@ class AggregateTransactionRepo {
|
|
|
22
22
|
$gte: params.startFrom,
|
|
23
23
|
$lte: params.startThrough
|
|
24
24
|
},
|
|
25
|
-
typeOf: { $eq: params.typeOf },
|
|
26
25
|
status: { $eq: transactionStatus },
|
|
27
26
|
...(typeof params.project?.id?.$ne === 'string')
|
|
28
27
|
? { 'project.id': { $ne: params.project.id.$ne } }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Connection, FilterQuery } from 'mongoose';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
3
|
import * as EventFactory from '../factory/event';
|
|
4
|
-
export type ISearchConditions = factory.event.screeningEvent.ISearchConditions;
|
|
4
|
+
export type ISearchConditions = Pick<factory.event.screeningEvent.ISearchConditions, 'additionalProperty' | 'endFrom' | 'endThrough' | 'eventStatuses' | 'id' | 'identifiers' | 'inSessionFrom' | 'inSessionThrough' | 'limit' | 'location' | 'offers' | 'organizer' | 'page' | 'project' | 'sort' | 'startFrom' | 'startThrough' | 'superEvent'> & {};
|
|
5
5
|
export import IMinimizedIndividualEvent = EventFactory.IMinimizedIndividualEvent;
|
|
6
6
|
type IKeyOfProjection = Exclude<keyof factory.event.screeningEvent.IEvent, 'id'> | 'aggregateOffer' | 'superEvent.location.id' | 'offers.itemOffered' | 'offers.itemOffered.id' | 'offers.typeOf';
|
|
7
7
|
type IKeyOfProjection4publicFields = Exclude<keyof factory.event.screeningEvent.IEvent, 'id' | 'offers'>;
|
|
@@ -60,7 +60,7 @@ export declare class EventRepo {
|
|
|
60
60
|
/**
|
|
61
61
|
* COAイベントキャンセル時に使用
|
|
62
62
|
*/
|
|
63
|
-
searchEventIds(params: Pick<ISearchConditions, 'project' | '
|
|
63
|
+
searchEventIds(params: Pick<ISearchConditions, 'project' | 'superEvent' | 'startFrom' | 'startThrough'>): Promise<string[]>;
|
|
64
64
|
/**
|
|
65
65
|
* 特定イベントから指定フィールドのみ取得する
|
|
66
66
|
* イベント IDは必ず返ります
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -22,18 +22,18 @@ class EventRepo {
|
|
|
22
22
|
}
|
|
23
23
|
static CREATE_MONGO_CONDITIONS(conditions) {
|
|
24
24
|
const andConditions = [];
|
|
25
|
-
const typeOfEq = conditions.typeOf;
|
|
26
|
-
if (typeof typeOfEq === 'string') {
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
const typeOfIn = conditions.typeOfIn;
|
|
30
|
-
if (Array.isArray(typeOfIn)) {
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
// typeOf条件必須検証(2023-07-13~)
|
|
34
|
-
if (typeof typeOfEq !== 'string' && !Array.isArray(typeOfIn)) {
|
|
35
|
-
|
|
36
|
-
}
|
|
25
|
+
// const typeOfEq = conditions.typeOf;
|
|
26
|
+
// if (typeof typeOfEq === 'string') {
|
|
27
|
+
// andConditions.push({ typeOf: { $eq: typeOfEq } });
|
|
28
|
+
// }
|
|
29
|
+
// const typeOfIn = conditions.typeOfIn;
|
|
30
|
+
// if (Array.isArray(typeOfIn)) {
|
|
31
|
+
// andConditions.push({ typeOf: { $in: typeOfIn } });
|
|
32
|
+
// }
|
|
33
|
+
// // typeOf条件必須検証(2023-07-13~)
|
|
34
|
+
// if (typeof typeOfEq !== 'string' && !Array.isArray(typeOfIn)) {
|
|
35
|
+
// throw new factory.errors.ArgumentNull('typeOf');
|
|
36
|
+
// }
|
|
37
37
|
const projectIdEq = conditions.project?.id?.$eq;
|
|
38
38
|
if (typeof projectIdEq === 'string') {
|
|
39
39
|
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
@@ -113,110 +113,72 @@ class EventRepo {
|
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
// $or: [
|
|
124
|
-
// {
|
|
125
|
-
// 'name.ja': {
|
|
126
|
-
// $exists: true,
|
|
127
|
-
// $regex: new RegExp(params.name)
|
|
128
|
-
// }
|
|
129
|
-
// },
|
|
130
|
-
// {
|
|
131
|
-
// 'name.en': {
|
|
132
|
-
// $exists: true,
|
|
133
|
-
// $regex: new RegExp(params.name)
|
|
134
|
-
// }
|
|
135
|
-
// }
|
|
136
|
-
// ]
|
|
137
|
-
// });
|
|
138
|
-
// }
|
|
139
|
-
/* istanbul ignore else */
|
|
140
|
-
const superEventLocationIdEq = params.superEvent?.location?.id?.$eq;
|
|
141
|
-
if (typeof superEventLocationIdEq === 'string') {
|
|
142
|
-
andConditions.push({
|
|
143
|
-
'superEvent.location.id': {
|
|
144
|
-
$exists: true,
|
|
145
|
-
$eq: superEventLocationIdEq
|
|
146
|
-
}
|
|
147
|
-
});
|
|
116
|
+
/* istanbul ignore else */
|
|
117
|
+
const superEventLocationIdEq = conditions.superEvent?.location?.id?.$eq;
|
|
118
|
+
if (typeof superEventLocationIdEq === 'string') {
|
|
119
|
+
andConditions.push({
|
|
120
|
+
'superEvent.location.id': {
|
|
121
|
+
$exists: true,
|
|
122
|
+
$eq: superEventLocationIdEq
|
|
148
123
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/* istanbul ignore else */
|
|
127
|
+
if (conditions.superEvent !== undefined) {
|
|
128
|
+
/* istanbul ignore else */
|
|
129
|
+
if (Array.isArray(conditions.superEvent.ids)) {
|
|
130
|
+
andConditions.push({
|
|
131
|
+
'superEvent.id': {
|
|
132
|
+
$exists: true,
|
|
133
|
+
$in: conditions.superEvent.ids
|
|
159
134
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/* istanbul ignore else */
|
|
138
|
+
if (Array.isArray(conditions.superEvent.locationBranchCodes)) {
|
|
139
|
+
andConditions.push({
|
|
140
|
+
'superEvent.location.branchCode': {
|
|
141
|
+
$exists: true,
|
|
142
|
+
$in: conditions.superEvent.locationBranchCodes
|
|
168
143
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/* istanbul ignore else */
|
|
147
|
+
if (Array.isArray(conditions.superEvent.workPerformedIdentifiers)) {
|
|
148
|
+
andConditions.push({
|
|
149
|
+
'superEvent.workPerformed.identifier': {
|
|
150
|
+
$exists: true,
|
|
151
|
+
$in: conditions.superEvent.workPerformedIdentifiers
|
|
177
152
|
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
const itemOfferedIdIn = conditions.offers?.itemOffered?.id?.$in;
|
|
157
|
+
if (Array.isArray(itemOfferedIdIn)) {
|
|
158
|
+
andConditions.push({
|
|
159
|
+
'offers.itemOffered.id': {
|
|
160
|
+
$exists: true,
|
|
161
|
+
$in: itemOfferedIdIn
|
|
178
162
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
const itemOfferedTicketedSeatTypeOfIn = params.offers?.itemOffered?.serviceOutput?.reservedTicket?.ticketedSeat?.typeOfs;
|
|
189
|
-
if (Array.isArray(itemOfferedTicketedSeatTypeOfIn)) {
|
|
190
|
-
andConditions.push({
|
|
191
|
-
'offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat.typeOf': {
|
|
192
|
-
$exists: true,
|
|
193
|
-
$in: itemOfferedTicketedSeatTypeOfIn
|
|
194
|
-
}
|
|
195
|
-
});
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
const itemOfferedTicketedSeatTypeOfIn = conditions.offers?.itemOffered?.serviceOutput?.reservedTicket?.ticketedSeat?.typeOfs;
|
|
166
|
+
if (Array.isArray(itemOfferedTicketedSeatTypeOfIn)) {
|
|
167
|
+
andConditions.push({
|
|
168
|
+
'offers.itemOffered.serviceOutput.reservedTicket.ticketedSeat.typeOf': {
|
|
169
|
+
$exists: true,
|
|
170
|
+
$in: itemOfferedTicketedSeatTypeOfIn
|
|
196
171
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
// }
|
|
206
|
-
const sellerMakesOfferElemMatch = params.offers?.seller?.makesOffer?.$elemMatch;
|
|
207
|
-
if (typeof sellerMakesOfferElemMatch?.['availableAtOrFrom.id']?.$eq === 'string') {
|
|
208
|
-
andConditions.push({
|
|
209
|
-
'offers.seller.makesOffer': {
|
|
210
|
-
$exists: true,
|
|
211
|
-
$elemMatch: sellerMakesOfferElemMatch
|
|
212
|
-
}
|
|
213
|
-
});
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
const sellerMakesOfferElemMatch = conditions.offers?.seller?.makesOffer?.$elemMatch;
|
|
175
|
+
if (typeof sellerMakesOfferElemMatch?.['availableAtOrFrom.id']?.$eq === 'string') {
|
|
176
|
+
andConditions.push({
|
|
177
|
+
'offers.seller.makesOffer': {
|
|
178
|
+
$exists: true,
|
|
179
|
+
$elemMatch: sellerMakesOfferElemMatch
|
|
214
180
|
}
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
case factory_1.factory.eventType.ScreeningEventSeries: // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
218
|
-
throw new factory_1.factory.errors.Internal('typeOf: ScreeningEventSeries discontinued');
|
|
219
|
-
default:
|
|
181
|
+
});
|
|
220
182
|
}
|
|
221
183
|
return andConditions;
|
|
222
184
|
}
|
|
@@ -339,7 +301,6 @@ class EventRepo {
|
|
|
339
301
|
const doc = await this.eventModel.findOne({
|
|
340
302
|
_id: { $eq: params.id.$eq },
|
|
341
303
|
'project.id': { $eq: params.project.id.$eq },
|
|
342
|
-
typeOf: { $in: [factory_1.factory.eventType.ScreeningEvent] },
|
|
343
304
|
...(typeof params.organizer?.id.$eq === 'string')
|
|
344
305
|
? { 'organizer.id': { $exists: true, $eq: params.organizer.id.$eq } }
|
|
345
306
|
: undefined
|
|
@@ -4,22 +4,21 @@ exports.modelName = exports.indexes = void 0;
|
|
|
4
4
|
exports.createSchema = createSchema;
|
|
5
5
|
const mongoose_1 = require("mongoose");
|
|
6
6
|
const writeConcern_1 = require("../writeConcern");
|
|
7
|
-
const factory_1 = require("../../../factory");
|
|
8
7
|
const settings_1 = require("../../../settings");
|
|
9
8
|
const modelName = 'Transaction';
|
|
10
9
|
exports.modelName = modelName;
|
|
11
10
|
const schemaDefinition = {
|
|
12
|
-
project: mongoose_1.SchemaTypes.Mixed,
|
|
13
|
-
status: String,
|
|
14
|
-
typeOf: String,
|
|
11
|
+
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
|
+
status: { type: String, required: true },
|
|
13
|
+
typeOf: { type: String, required: true },
|
|
15
14
|
agent: mongoose_1.SchemaTypes.Mixed,
|
|
15
|
+
expires: { type: Date, required: true },
|
|
16
|
+
startDate: { type: Date, required: true },
|
|
16
17
|
// recipient: SchemaTypes.Mixed, // discontinue(2026-09-09~)
|
|
17
18
|
seller: mongoose_1.SchemaTypes.Mixed,
|
|
18
19
|
error: mongoose_1.SchemaTypes.Mixed,
|
|
19
20
|
result: mongoose_1.SchemaTypes.Mixed,
|
|
20
21
|
object: mongoose_1.SchemaTypes.Mixed,
|
|
21
|
-
expires: Date,
|
|
22
|
-
startDate: Date,
|
|
23
22
|
endDate: Date,
|
|
24
23
|
tasksExportAction: mongoose_1.SchemaTypes.Mixed,
|
|
25
24
|
potentialActions: mongoose_1.SchemaTypes.Mixed,
|
|
@@ -66,19 +65,6 @@ const indexes = [
|
|
|
66
65
|
{ startDate: -1 },
|
|
67
66
|
{ name: 'searchByStartDateDescending' }
|
|
68
67
|
],
|
|
69
|
-
[
|
|
70
|
-
{ endDate: 1, startDate: -1 },
|
|
71
|
-
{
|
|
72
|
-
name: 'searchByEndDateAndStartDate',
|
|
73
|
-
partialFilterExpression: {
|
|
74
|
-
endDate: { $exists: true }
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
[
|
|
79
|
-
{ expires: 1, startDate: -1 },
|
|
80
|
-
{ name: 'searchByExpiresAndStartDate' }
|
|
81
|
-
],
|
|
82
68
|
[
|
|
83
69
|
{ 'object.confirmationNumber': 1, startDate: -1 },
|
|
84
70
|
{
|
|
@@ -99,19 +85,31 @@ const indexes = [
|
|
|
99
85
|
],
|
|
100
86
|
[
|
|
101
87
|
// 注文取引のobject.orderNumberも発行されている場合ユニークなはず(2026-02-21~)
|
|
88
|
+
// 返品取引廃止につきuniquePlacingOrderNumberをreIndex
|
|
89
|
+
{ 'object.orderNumber': 1 },
|
|
102
90
|
{
|
|
103
|
-
|
|
104
|
-
'object.orderNumber': 1
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'uniquePlacingOrderNumber',
|
|
91
|
+
name: 'uniqueOrderNumber',
|
|
108
92
|
unique: true,
|
|
109
93
|
partialFilterExpression: {
|
|
110
|
-
typeOf: factory_1.factory.transactionType.PlaceOrder,
|
|
111
94
|
'object.orderNumber': { $exists: true }
|
|
112
95
|
}
|
|
113
96
|
}
|
|
114
97
|
],
|
|
98
|
+
// [
|
|
99
|
+
// // 注文取引のobject.orderNumberも発行されている場合ユニークなはず(2026-02-21~)
|
|
100
|
+
// {
|
|
101
|
+
// typeOf: 1,
|
|
102
|
+
// 'object.orderNumber': 1
|
|
103
|
+
// },
|
|
104
|
+
// {
|
|
105
|
+
// name: 'uniquePlacingOrderNumber',
|
|
106
|
+
// unique: true,
|
|
107
|
+
// partialFilterExpression: {
|
|
108
|
+
// typeOf: factory.transactionType.PlaceOrder,
|
|
109
|
+
// 'object.orderNumber': { $exists: true }
|
|
110
|
+
// }
|
|
111
|
+
// }
|
|
112
|
+
// ],
|
|
115
113
|
[
|
|
116
114
|
{ 'agent.typeOf': 1, startDate: -1 },
|
|
117
115
|
{
|
|
@@ -171,24 +169,6 @@ const indexes = [
|
|
|
171
169
|
}
|
|
172
170
|
}
|
|
173
171
|
],
|
|
174
|
-
[
|
|
175
|
-
{ 'tasksExportAction.actionStatus': 1, startDate: -1 },
|
|
176
|
-
{
|
|
177
|
-
name: 'searchByTasksExportActionActionStatus',
|
|
178
|
-
partialFilterExpression: {
|
|
179
|
-
'tasksExportAction.actionStatus': { $exists: true }
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
],
|
|
183
|
-
[
|
|
184
|
-
{ 'tasksExportAction.startDate': 1, startDate: -1 },
|
|
185
|
-
{
|
|
186
|
-
name: 'searchByTasksExportActionActionStartDate',
|
|
187
|
-
partialFilterExpression: {
|
|
188
|
-
'tasksExportAction.startDate': { $exists: true }
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
],
|
|
192
172
|
// typeOf: ReturnOrder廃止につき以下廃止(2026-09-08~)
|
|
193
173
|
// [
|
|
194
174
|
// { 'object.order.orderNumber': 1, startDate: -1 },
|
|
@@ -212,6 +192,37 @@ const indexes = [
|
|
|
212
192
|
// }
|
|
213
193
|
// }
|
|
214
194
|
// ],
|
|
195
|
+
// [
|
|
196
|
+
// { endDate: 1, startDate: -1 },
|
|
197
|
+
// {
|
|
198
|
+
// name: 'searchByEndDateAndStartDate',
|
|
199
|
+
// partialFilterExpression: {
|
|
200
|
+
// endDate: { $exists: true }
|
|
201
|
+
// }
|
|
202
|
+
// }
|
|
203
|
+
// ],
|
|
204
|
+
// [
|
|
205
|
+
// { expires: 1, startDate: -1 },
|
|
206
|
+
// { name: 'searchByExpiresAndStartDate' }
|
|
207
|
+
// ],
|
|
208
|
+
// [
|
|
209
|
+
// { 'tasksExportAction.startDate': 1, startDate: -1 },
|
|
210
|
+
// {
|
|
211
|
+
// name: 'searchByTasksExportActionActionStartDate',
|
|
212
|
+
// partialFilterExpression: {
|
|
213
|
+
// 'tasksExportAction.startDate': { $exists: true }
|
|
214
|
+
// }
|
|
215
|
+
// }
|
|
216
|
+
// ],
|
|
217
|
+
// [
|
|
218
|
+
// { 'tasksExportAction.actionStatus': 1, startDate: -1 },
|
|
219
|
+
// {
|
|
220
|
+
// name: 'searchByTasksExportActionActionStatus',
|
|
221
|
+
// partialFilterExpression: {
|
|
222
|
+
// 'tasksExportAction.actionStatus': { $exists: true }
|
|
223
|
+
// }
|
|
224
|
+
// }
|
|
225
|
+
// ],
|
|
215
226
|
];
|
|
216
227
|
exports.indexes = indexes;
|
|
217
228
|
/**
|
|
@@ -5,11 +5,6 @@ exports.OrderInTransactionRepo = void 0;
|
|
|
5
5
|
const errorHandler_1 = require("../errorHandler");
|
|
6
6
|
const factory_1 = require("../factory");
|
|
7
7
|
const order_1 = require("./mongoose/schemas/order");
|
|
8
|
-
// import {
|
|
9
|
-
// createSchema as createTransactionSchema,
|
|
10
|
-
// IModel as ITransactionModel, modelName as transactionModelName,
|
|
11
|
-
// IDocType as ITransactionDocType
|
|
12
|
-
// } from './mongoose/schemas/transaction';
|
|
13
8
|
const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
14
9
|
// const debug = createDebug('chevre-domain:repo:orderInTransaction');
|
|
15
10
|
/**
|
|
@@ -17,7 +12,6 @@ const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
|
17
12
|
*/
|
|
18
13
|
class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveRepo {
|
|
19
14
|
orderModel;
|
|
20
|
-
// private readonly transactionModel: ITransactionModel;
|
|
21
15
|
constructor(connection) {
|
|
22
16
|
super(connection);
|
|
23
17
|
this.orderModel = connection.model(order_1.modelName, (0, order_1.createSchema)());
|