@chevre/domain 28.0.0-alpha.4 → 28.0.0-alpha.6
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/adminEvent.d.ts +0 -6
- package/lib/chevre/repo/adminEvent.js +3 -9
- package/lib/chevre/repo/adminTransaction.d.ts +5 -15
- package/lib/chevre/repo/aggregateEvent.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.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.js +51 -52
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -3
- package/lib/chevre/repo/transaction/placeOrder.js +15 -36
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
- 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/eventServiceByCOA/acceptOffer.js +0 -1
- package/lib/chevre/service/offer/onEventChanged.js +2 -4
- package/lib/chevre/service/offer.js +1 -2
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -2
- package/package.json +2 -2
|
@@ -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();
|
|
@@ -52,7 +52,6 @@ export declare class AdminTransactionRepo {
|
|
|
52
52
|
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
53
53
|
getCursor(conditions: any, projection: any, sort?: factory.sortType): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, {
|
|
54
54
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
55
|
-
error?: any;
|
|
56
55
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
57
56
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
58
57
|
typeOf: factory.transactionType.PlaceOrder;
|
|
@@ -63,11 +62,9 @@ export declare class AdminTransactionRepo {
|
|
|
63
62
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
64
63
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
65
64
|
status: factory.transactionStatusType;
|
|
66
|
-
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
67
|
-
potentialActions?: undefined;
|
|
65
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
68
66
|
}, import("./mongoose/virtuals").IVirtuals, {}> & {
|
|
69
67
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
70
|
-
error?: any;
|
|
71
68
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
72
69
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
73
70
|
typeOf: factory.transactionType.PlaceOrder;
|
|
@@ -78,15 +75,13 @@ export declare class AdminTransactionRepo {
|
|
|
78
75
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
79
76
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
80
77
|
status: factory.transactionStatusType;
|
|
81
|
-
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
82
|
-
potentialActions?: undefined;
|
|
78
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
83
79
|
} & {
|
|
84
80
|
_id: import("mongoose").Types.ObjectId;
|
|
85
81
|
} & {
|
|
86
82
|
__v: number;
|
|
87
83
|
}, import("mongoose").QueryOptions<{
|
|
88
84
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
89
|
-
error?: any;
|
|
90
85
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
91
86
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
92
87
|
typeOf: factory.transactionType.PlaceOrder;
|
|
@@ -97,11 +92,9 @@ export declare class AdminTransactionRepo {
|
|
|
97
92
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
98
93
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
99
94
|
status: factory.transactionStatusType;
|
|
100
|
-
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
101
|
-
potentialActions?: undefined;
|
|
95
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
102
96
|
}>, (import("mongoose").Document<unknown, Record<string, never>, {
|
|
103
97
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
104
|
-
error?: any;
|
|
105
98
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
106
99
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
107
100
|
typeOf: factory.transactionType.PlaceOrder;
|
|
@@ -112,11 +105,9 @@ export declare class AdminTransactionRepo {
|
|
|
112
105
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
113
106
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
114
107
|
status: factory.transactionStatusType;
|
|
115
|
-
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
116
|
-
potentialActions?: undefined;
|
|
108
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
117
109
|
}, import("./mongoose/virtuals").IVirtuals, {}> & {
|
|
118
110
|
object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
|
|
119
|
-
error?: any;
|
|
120
111
|
project: import("@chevre/factory/lib/chevre/transaction").IProject;
|
|
121
112
|
seller: import("@chevre/factory/lib/chevre/transaction/placeOrder").ISeller;
|
|
122
113
|
typeOf: factory.transactionType.PlaceOrder;
|
|
@@ -127,8 +118,7 @@ export declare class AdminTransactionRepo {
|
|
|
127
118
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
128
119
|
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
129
120
|
status: factory.transactionStatusType;
|
|
130
|
-
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
131
|
-
potentialActions?: undefined;
|
|
121
|
+
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction/placeOrder").ITasksExportAction | undefined;
|
|
132
122
|
} & {
|
|
133
123
|
_id: import("mongoose").Types.ObjectId;
|
|
134
124
|
} & {
|
|
@@ -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 } }
|
|
@@ -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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../virtuals';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
type IPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'endDate' | '
|
|
4
|
+
type IPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, 'agent' | 'endDate' | 'expires' | 'instrument' | 'object' | 'project' | 'result' | 'seller' | 'startDate' | 'status' | 'tasksExportAction' | 'typeOf'>;
|
|
5
5
|
type IDocType = IPlaceOrder;
|
|
6
6
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
7
7
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
@@ -4,7 +4,6 @@ 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;
|
|
@@ -12,18 +11,18 @@ const schemaDefinition = {
|
|
|
12
11
|
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
13
12
|
status: { type: String, required: true },
|
|
14
13
|
typeOf: { type: String, required: true },
|
|
15
|
-
agent: mongoose_1.SchemaTypes.Mixed,
|
|
14
|
+
agent: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
15
|
expires: { type: Date, required: true },
|
|
17
16
|
startDate: { type: Date, required: true },
|
|
18
|
-
// recipient: SchemaTypes.Mixed, // discontinue(2026-09-09~)
|
|
19
17
|
seller: mongoose_1.SchemaTypes.Mixed,
|
|
20
|
-
error: mongoose_1.SchemaTypes.Mixed,
|
|
21
18
|
result: mongoose_1.SchemaTypes.Mixed,
|
|
22
19
|
object: mongoose_1.SchemaTypes.Mixed,
|
|
23
20
|
endDate: Date,
|
|
24
21
|
tasksExportAction: mongoose_1.SchemaTypes.Mixed,
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
instrument: mongoose_1.SchemaTypes.Mixed,
|
|
23
|
+
// recipient: SchemaTypes.Mixed, // discontinue(2026-09-09~)
|
|
24
|
+
// error: SchemaTypes.Mixed, // discontinue(2026-09-14~)
|
|
25
|
+
// potentialActions: SchemaTypes.Mixed, // discontinue(2026-09-14~)
|
|
27
26
|
};
|
|
28
27
|
const schemaOptions = {
|
|
29
28
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -54,10 +53,6 @@ const indexes = [
|
|
|
54
53
|
{ 'project.id': 1, startDate: -1 },
|
|
55
54
|
{ name: 'searchByProjectId-v20220721' }
|
|
56
55
|
],
|
|
57
|
-
[
|
|
58
|
-
{ typeOf: 1, startDate: -1 },
|
|
59
|
-
{ name: 'searchByTypeOfAndStartDate' }
|
|
60
|
-
],
|
|
61
56
|
[
|
|
62
57
|
{ status: 1, startDate: -1 },
|
|
63
58
|
{ name: 'searchByStatusAndStartDate' }
|
|
@@ -96,39 +91,21 @@ const indexes = [
|
|
|
96
91
|
}
|
|
97
92
|
}
|
|
98
93
|
],
|
|
99
|
-
[
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
],
|
|
114
|
-
[
|
|
115
|
-
{ 'agent.typeOf': 1, startDate: -1 },
|
|
116
|
-
{
|
|
117
|
-
name: 'searchByAgentTypeOfAndStartDate',
|
|
118
|
-
partialFilterExpression: {
|
|
119
|
-
'agent.typeOf': { $exists: true }
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
],
|
|
123
|
-
[
|
|
124
|
-
{ 'agent.id': 1, startDate: -1 },
|
|
125
|
-
{
|
|
126
|
-
name: 'searchByAgentIdAndStartDate',
|
|
127
|
-
partialFilterExpression: {
|
|
128
|
-
'agent.id': { $exists: true }
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
],
|
|
94
|
+
// [
|
|
95
|
+
// // 注文取引のobject.orderNumberも発行されている場合ユニークなはず(2026-02-21~)
|
|
96
|
+
// {
|
|
97
|
+
// typeOf: 1,
|
|
98
|
+
// 'object.orderNumber': 1
|
|
99
|
+
// },
|
|
100
|
+
// {
|
|
101
|
+
// name: 'uniquePlacingOrderNumber',
|
|
102
|
+
// unique: true,
|
|
103
|
+
// partialFilterExpression: {
|
|
104
|
+
// typeOf: factory.transactionType.PlaceOrder,
|
|
105
|
+
// 'object.orderNumber': { $exists: true }
|
|
106
|
+
// }
|
|
107
|
+
// }
|
|
108
|
+
// ],
|
|
132
109
|
[
|
|
133
110
|
{ 'agent.identifier': 1, startDate: -1 },
|
|
134
111
|
{
|
|
@@ -170,15 +147,6 @@ const indexes = [
|
|
|
170
147
|
}
|
|
171
148
|
}
|
|
172
149
|
],
|
|
173
|
-
[
|
|
174
|
-
{ 'tasksExportAction.actionStatus': 1, startDate: -1 },
|
|
175
|
-
{
|
|
176
|
-
name: 'searchByTasksExportActionActionStatus',
|
|
177
|
-
partialFilterExpression: {
|
|
178
|
-
'tasksExportAction.actionStatus': { $exists: true }
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
],
|
|
182
150
|
// typeOf: ReturnOrder廃止につき以下廃止(2026-09-08~)
|
|
183
151
|
// [
|
|
184
152
|
// { 'object.order.orderNumber': 1, startDate: -1 },
|
|
@@ -224,6 +192,37 @@ const indexes = [
|
|
|
224
192
|
// }
|
|
225
193
|
// }
|
|
226
194
|
// ],
|
|
195
|
+
// [
|
|
196
|
+
// { 'tasksExportAction.actionStatus': 1, startDate: -1 },
|
|
197
|
+
// {
|
|
198
|
+
// name: 'searchByTasksExportActionActionStatus',
|
|
199
|
+
// partialFilterExpression: {
|
|
200
|
+
// 'tasksExportAction.actionStatus': { $exists: true }
|
|
201
|
+
// }
|
|
202
|
+
// }
|
|
203
|
+
// ],
|
|
204
|
+
// [
|
|
205
|
+
// { typeOf: 1, startDate: -1 },
|
|
206
|
+
// { name: 'searchByTypeOfAndStartDate' }
|
|
207
|
+
// ],
|
|
208
|
+
// [
|
|
209
|
+
// { 'agent.typeOf': 1, startDate: -1 },
|
|
210
|
+
// {
|
|
211
|
+
// name: 'searchByAgentTypeOfAndStartDate',
|
|
212
|
+
// partialFilterExpression: {
|
|
213
|
+
// 'agent.typeOf': { $exists: true }
|
|
214
|
+
// }
|
|
215
|
+
// }
|
|
216
|
+
// ],
|
|
217
|
+
// [
|
|
218
|
+
// { 'agent.id': 1, startDate: -1 },
|
|
219
|
+
// {
|
|
220
|
+
// name: 'searchByAgentIdAndStartDate',
|
|
221
|
+
// partialFilterExpression: {
|
|
222
|
+
// 'agent.id': { $exists: true }
|
|
223
|
+
// }
|
|
224
|
+
// }
|
|
225
|
+
// ],
|
|
227
226
|
];
|
|
228
227
|
exports.indexes = indexes;
|
|
229
228
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
|
-
type IKeyOfProjection = 'agent' | 'endDate' | 'expires' | 'project' | 'startDate' | 'status' | 'typeOf' | 'instrument' | 'object' | 'seller' | 'result' | '
|
|
3
|
+
type IKeyOfProjection = 'agent' | 'endDate' | 'expires' | 'project' | 'startDate' | 'status' | 'typeOf' | 'instrument' | 'object' | 'seller' | 'result' | 'tasksExportAction';
|
|
4
4
|
export type ITransactionInProgress = Pick<factory.transaction.placeOrder.ITransaction, IKeyOfProjection> & {
|
|
5
5
|
/**
|
|
6
6
|
* 取引ID
|
|
@@ -17,7 +17,7 @@ export type IPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, IKey
|
|
|
17
17
|
};
|
|
18
18
|
type IStartedPlaceOrderFields = 'expires' | 'id' | 'startDate' | 'status';
|
|
19
19
|
export type IStartedPlaceOrder = Pick<factory.transaction.placeOrder.ITransaction, IStartedPlaceOrderFields>;
|
|
20
|
-
type IFindParams = Pick<factory.transaction.placeOrder.ISearchConditions, 'agent' | 'ids' | 'limit' | 'object' | 'page' | 'project' | 'seller' | 'sort' | 'startFrom' | 'startThrough' | 'status' | 'statuses'
|
|
20
|
+
type IFindParams = Pick<factory.transaction.placeOrder.ISearchConditions, 'agent' | 'ids' | 'limit' | 'object' | 'page' | 'project' | 'seller' | 'sort' | 'startFrom' | 'startThrough' | 'status' | 'statuses'> & {};
|
|
21
21
|
/**
|
|
22
22
|
* 注文取引リポジトリ
|
|
23
23
|
*/
|
|
@@ -80,7 +80,6 @@ export declare class PlaceOrderRepo {
|
|
|
80
80
|
confirmationNumber: string;
|
|
81
81
|
};
|
|
82
82
|
result: factory.transaction.placeOrder.IResult;
|
|
83
|
-
potentialActions?: factory.transaction.placeOrder.IPotentialActions;
|
|
84
83
|
}): Promise<void>;
|
|
85
84
|
/**
|
|
86
85
|
* 取引を中止する
|
|
@@ -21,9 +21,9 @@ const AVAILABLE_PROJECT_FIELDS = [
|
|
|
21
21
|
'endDate',
|
|
22
22
|
'instrument',
|
|
23
23
|
'result',
|
|
24
|
-
'potentialActions',
|
|
24
|
+
// 'potentialActions', // discontinue(2026-09-14~)
|
|
25
25
|
// 'recipient',
|
|
26
|
-
'error',
|
|
26
|
+
// 'error', // discontinue(2026-09-14~)
|
|
27
27
|
'tasksExportAction',
|
|
28
28
|
];
|
|
29
29
|
/**
|
|
@@ -84,40 +84,19 @@ class PlaceOrderRepo {
|
|
|
84
84
|
if (Array.isArray(statusIn)) {
|
|
85
85
|
andConditions.push({ status: { $in: statusIn } });
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
'agent.typeOf': {
|
|
91
|
-
$exists: true,
|
|
92
|
-
$eq: params.agent.typeOf
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
if (Array.isArray(params.agent.ids)) {
|
|
97
|
-
andConditions.push({
|
|
98
|
-
'agent.id': {
|
|
99
|
-
$exists: true,
|
|
100
|
-
$in: params.agent.ids
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
if (Array.isArray(params.agent.identifiers)) {
|
|
105
|
-
andConditions.push({
|
|
106
|
-
'agent.identifier': {
|
|
107
|
-
$exists: true,
|
|
108
|
-
$in: params.agent.identifiers
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
const tasksExportActionStatusIn = params.tasksExportAction?.actionStatus?.$in;
|
|
114
|
-
if (Array.isArray(tasksExportActionStatusIn)) {
|
|
115
|
-
andConditions.push({ 'tasksExportAction.actionStatus': { $exists: true, $in: tasksExportActionStatusIn } });
|
|
116
|
-
}
|
|
117
|
-
const tasksExportActionStatusEq = params.tasksExportAction?.actionStatus?.$eq;
|
|
118
|
-
if (typeof tasksExportActionStatusEq === 'string') {
|
|
119
|
-
andConditions.push({ 'tasksExportAction.actionStatus': { $exists: true, $eq: tasksExportActionStatusEq } });
|
|
87
|
+
const agentIdentifierIn = params.agent?.identifiers;
|
|
88
|
+
if (Array.isArray(agentIdentifierIn)) {
|
|
89
|
+
andConditions.push({ 'agent.identifier': { $exists: true, $in: agentIdentifierIn } });
|
|
120
90
|
}
|
|
91
|
+
// discontinue(2026-09-11~)
|
|
92
|
+
// const tasksExportActionStatusIn = params.tasksExportAction?.actionStatus?.$in;
|
|
93
|
+
// if (Array.isArray(tasksExportActionStatusIn)) {
|
|
94
|
+
// andConditions.push({ 'tasksExportAction.actionStatus': { $exists: true, $in: tasksExportActionStatusIn } });
|
|
95
|
+
// }
|
|
96
|
+
// const tasksExportActionStatusEq = params.tasksExportAction?.actionStatus?.$eq;
|
|
97
|
+
// if (typeof tasksExportActionStatusEq === 'string') {
|
|
98
|
+
// andConditions.push({ 'tasksExportAction.actionStatus': { $exists: true, $eq: tasksExportActionStatusEq } });
|
|
99
|
+
// }
|
|
121
100
|
const sellerIdIn = params.seller?.ids;
|
|
122
101
|
if (Array.isArray(sellerIdIn)) {
|
|
123
102
|
andConditions.push({ 'seller.id': { $exists: true, $in: sellerIdIn } });
|
|
@@ -331,7 +310,7 @@ class PlaceOrderRepo {
|
|
|
331
310
|
'object.orderNumber': params.object.orderNumber, // add(2026-06-27~)
|
|
332
311
|
'object.confirmationNumber': params.object.confirmationNumber, // add(2026-07-08~)
|
|
333
312
|
result: params.result, // resultを更新
|
|
334
|
-
...((params.potentialActions !== undefined) && { potentialActions: params.potentialActions }) // support undefined(2026-07-17~)
|
|
313
|
+
// ...((params.potentialActions !== undefined) && { potentialActions: params.potentialActions }) // support undefined(2026-07-17~)
|
|
335
314
|
}, {
|
|
336
315
|
new: true,
|
|
337
316
|
projection: { _id: 1 }
|
|
@@ -22,8 +22,7 @@ function aggregateOffers(params) {
|
|
|
22
22
|
const eventCapacity = (await repos.event.projectEventFields({
|
|
23
23
|
limit: 1,
|
|
24
24
|
page: 1,
|
|
25
|
-
id: { $eq: params.id }
|
|
26
|
-
typeOf: params.typeOf
|
|
25
|
+
id: { $eq: params.id }
|
|
27
26
|
}, ['maximumAttendeeCapacity', 'remainingAttendeeCapacity'])).shift();
|
|
28
27
|
debug('processing aggregateOffersByEvent...', eventCapacity);
|
|
29
28
|
await aggregateOffersByEvent({
|
|
@@ -53,7 +53,6 @@ function aggregateScreeningEvent(params) {
|
|
|
53
53
|
limit: 100,
|
|
54
54
|
page: 1,
|
|
55
55
|
project: { id: { $eq: event.project.id } },
|
|
56
|
-
typeOf: event.typeOf,
|
|
57
56
|
eventStatuses: [factory_1.factory.eventStatusType.EventScheduled],
|
|
58
57
|
startFrom: startFrom,
|
|
59
58
|
startThrough: startThrough,
|
|
@@ -81,8 +81,7 @@ function validateAcceptedPaymentMethodIfNeeded(params
|
|
|
81
81
|
const eventSeriesIds = (await repos.event.projectEventFields({
|
|
82
82
|
limit: checkingEventIds.length,
|
|
83
83
|
page: 1,
|
|
84
|
-
id: { $in: checkingEventIds }
|
|
85
|
-
typeOf: factory_1.factory.eventType.ScreeningEvent
|
|
84
|
+
id: { $in: checkingEventIds }
|
|
86
85
|
}, ['superEvent'])).map((event) => event.superEvent.id);
|
|
87
86
|
if (eventSeriesIds.length !== checkingEventIds.length) {
|
|
88
87
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.eventType.ScreeningEvent);
|
|
@@ -153,7 +153,6 @@ function cancelDeletedEvents(params) {
|
|
|
153
153
|
// COAから削除されたイベントをキャンセル済ステータスへ変更
|
|
154
154
|
const ids = await repos.event.searchEventIds({
|
|
155
155
|
project: { id: { $eq: params.project.id } },
|
|
156
|
-
typeOf: factory_1.factory.eventType.ScreeningEvent,
|
|
157
156
|
superEvent: {
|
|
158
157
|
locationBranchCodes: [params.locationBranchCode]
|
|
159
158
|
},
|
|
@@ -101,8 +101,7 @@ function createInformTasks(params, setting) {
|
|
|
101
101
|
const informEvents = setting?.onResourceUpdated?.informResource;
|
|
102
102
|
if (params.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
103
103
|
const screeningEvents4inform = await repos.event.projectEventFields({
|
|
104
|
-
id: { $in: params.ids }
|
|
105
|
-
typeOf: params.typeOf
|
|
104
|
+
id: { $in: params.ids }
|
|
106
105
|
}, [
|
|
107
106
|
'project', 'organizer', 'typeOf', 'name', 'doorTime', 'endDate',
|
|
108
107
|
'eventStatus', 'location', 'startDate', 'superEvent', 'offers', 'additionalProperty', 'identifier'
|
|
@@ -296,8 +295,7 @@ function syncEventEndDate2pendingReservations(params) {
|
|
|
296
295
|
const events = await repos.event.projectEventFields({
|
|
297
296
|
limit: 1,
|
|
298
297
|
page: 1,
|
|
299
|
-
id: { $eq: eventId }
|
|
300
|
-
typeOf: params.typeOf
|
|
298
|
+
id: { $eq: eventId }
|
|
301
299
|
}, ['endDate']);
|
|
302
300
|
const endDate = events.shift()?.endDate;
|
|
303
301
|
if (endDate instanceof Date) {
|
|
@@ -169,8 +169,7 @@ function findEventSeatOffersBySection(params) {
|
|
|
169
169
|
page: 1,
|
|
170
170
|
project: { id: { $eq: projectId } },
|
|
171
171
|
organizer: { id: { $eq: sellerId } },
|
|
172
|
-
id: { $eq: eventId }
|
|
173
|
-
typeOf: factory_1.factory.eventType.ScreeningEvent
|
|
172
|
+
id: { $eq: eventId }
|
|
174
173
|
}, ['startDate', 'offers.itemOffered', 'location', 'superEvent'])).shift();
|
|
175
174
|
if (event === undefined) {
|
|
176
175
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.eventType.ScreeningEvent);
|
|
@@ -36,8 +36,7 @@ function preStart(params) {
|
|
|
36
36
|
let events = [];
|
|
37
37
|
if (eventIds.length > 0) {
|
|
38
38
|
events = await repos.event.projectEventFields({
|
|
39
|
-
id: { $in: eventIds }
|
|
40
|
-
typeOf: factory_1.factory.eventType.ScreeningEvent
|
|
39
|
+
id: { $in: eventIds }
|
|
41
40
|
}, ['startDate']);
|
|
42
41
|
}
|
|
43
42
|
let returnPolicies = [];
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.1090.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.1090.0",
|
|
14
|
-
"@chevre/factory": "11.0.0-alpha.
|
|
14
|
+
"@chevre/factory": "11.0.0-alpha.3",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
16
|
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"postversion": "git push origin --tags",
|
|
89
89
|
"prepublishOnly": "npm run clean && npm run build"
|
|
90
90
|
},
|
|
91
|
-
"version": "28.0.0-alpha.
|
|
91
|
+
"version": "28.0.0-alpha.6"
|
|
92
92
|
}
|