@chevre/domain 28.0.0-alpha.21 → 28.0.0-alpha.22
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/eventSeries.d.ts +11 -2
- package/lib/chevre/repo/eventSeries.js +19 -12
- package/lib/chevre/service/event/saveScreeningEvents.js +1 -1
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +1 -1
- package/lib/chevre/service/offer/event/searchOfferAppliesToMovieTicket.js +1 -1
- package/lib/chevre/service/offer/event/searchOffersByIds.js +1 -1
- package/lib/chevre/service/offer/onEventChanged.js +2 -2
- package/lib/chevre/service/task/syncResourcesFromCOA.js +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
|
-
type ISearchConditions = factory.eventSeries.ISearchConditions
|
|
3
|
+
type ISearchConditions = Pick<factory.eventSeries.ISearchConditions, 'limit' | 'page' | 'sort' | 'additionalProperty' | 'endFrom' | 'endThrough' | 'id' | 'inSessionFrom' | 'inSessionThrough' | 'location' | 'name' | 'organizer' | 'project' | 'startFrom' | 'startThrough' | 'videoFormat'> & {
|
|
4
|
+
/**
|
|
5
|
+
* コンテンツコード
|
|
6
|
+
*/
|
|
7
|
+
movieIdentifier?: string;
|
|
8
|
+
/**
|
|
9
|
+
* コンテンツバージョン
|
|
10
|
+
*/
|
|
11
|
+
movieVersion?: string;
|
|
12
|
+
};
|
|
4
13
|
type IKeyOfProjection = Exclude<keyof factory.eventSeries.IEvent, 'id' | 'videoFormat'>;
|
|
5
14
|
/**
|
|
6
15
|
* 施設コンテンツリポジトリ
|
|
@@ -12,7 +21,7 @@ export declare class EventSeriesRepo {
|
|
|
12
21
|
/**
|
|
13
22
|
* イベントを検索する(inclusion projection)
|
|
14
23
|
*/
|
|
15
|
-
|
|
24
|
+
findEventSeries(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<factory.eventSeries.IEvent[]>;
|
|
16
25
|
deleteManyByOrganizerId(params: {
|
|
17
26
|
project: {
|
|
18
27
|
id: string;
|
|
@@ -127,18 +127,25 @@ class EventSeriesRepo {
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
const workPerformedIdentifierIn = conditions.workPerformed?.identifiers;
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
// const workPerformedIdentifierIn = conditions.workPerformed?.identifiers;
|
|
131
|
+
// if (Array.isArray(workPerformedIdentifierIn)) {
|
|
132
|
+
// andConditions.push({
|
|
133
|
+
// 'workPerformed.identifier': { $exists: true, $in: workPerformedIdentifierIn }
|
|
134
|
+
// });
|
|
135
|
+
// }
|
|
136
|
+
// const workPerformedVersionEq = conditions.workPerformed?.version?.$eq;
|
|
137
|
+
// if (typeof workPerformedVersionEq === 'string') {
|
|
138
|
+
// andConditions.push({
|
|
139
|
+
// 'workPerformed.version': { $exists: true, $eq: workPerformedVersionEq }
|
|
140
|
+
// });
|
|
141
|
+
// }
|
|
142
|
+
const workPerformedIdentifierEq = conditions.movieIdentifier;
|
|
143
|
+
if (typeof workPerformedIdentifierEq === 'string') {
|
|
144
|
+
andConditions.push({ 'workPerformed.identifier': { $exists: true, $eq: workPerformedIdentifierEq } });
|
|
145
|
+
}
|
|
146
|
+
const workPerformedVersionEq = conditions.movieVersion;
|
|
138
147
|
if (typeof workPerformedVersionEq === 'string') {
|
|
139
|
-
andConditions.push({
|
|
140
|
-
'workPerformed.version': { $exists: true, $eq: workPerformedVersionEq }
|
|
141
|
-
});
|
|
148
|
+
andConditions.push({ 'workPerformed.version': { $exists: true, $eq: workPerformedVersionEq } });
|
|
142
149
|
}
|
|
143
150
|
const videoFormatTypeOfEq = conditions.videoFormat?.typeOf?.$eq;
|
|
144
151
|
if (typeof videoFormatTypeOfEq === 'string') {
|
|
@@ -153,7 +160,7 @@ class EventSeriesRepo {
|
|
|
153
160
|
/**
|
|
154
161
|
* イベントを検索する(inclusion projection)
|
|
155
162
|
*/
|
|
156
|
-
async
|
|
163
|
+
async findEventSeries(params, inclusion) {
|
|
157
164
|
const conditions = EventSeriesRepo.CREATE_MONGO_CONDITIONS(params);
|
|
158
165
|
let projection;
|
|
159
166
|
const positiveProjectionFields = (Array.isArray(inclusion))
|
|
@@ -89,7 +89,7 @@ function createScreeningEvents(params, options) {
|
|
|
89
89
|
}))];
|
|
90
90
|
debug('searching eventSeries... importingEventSeriesIds:', importingEventSeriesIds);
|
|
91
91
|
if (importingEventSeriesIds.length > 0) {
|
|
92
|
-
screeningEventSerieses = await repos.eventSeries.
|
|
92
|
+
screeningEventSerieses = await repos.eventSeries.findEventSeries({
|
|
93
93
|
id: { $in: importingEventSeriesIds },
|
|
94
94
|
project: { id: { $eq: params.project.id } }
|
|
95
95
|
}, [
|
|
@@ -118,7 +118,7 @@ function searchEventTicketOffersByEvent(params) {
|
|
|
118
118
|
let soundFormatTypes = [];
|
|
119
119
|
let videoFormatTypes = [];
|
|
120
120
|
if (event.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
121
|
-
const superEvents = await repos.eventSeries.
|
|
121
|
+
const superEvents = await repos.eventSeries.findEventSeries({
|
|
122
122
|
limit: 1,
|
|
123
123
|
page: 1,
|
|
124
124
|
id: { $eq: event.superEvent.id }
|
|
@@ -23,7 +23,7 @@ function searchOfferAppliesToMovieTicket(params) {
|
|
|
23
23
|
// let soundFormatTypes: string[] = [];
|
|
24
24
|
let videoFormatTypes = [];
|
|
25
25
|
if (event.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
26
|
-
const superEvents = await repos.eventSeries.
|
|
26
|
+
const superEvents = await repos.eventSeries.findEventSeries({
|
|
27
27
|
limit: 1,
|
|
28
28
|
page: 1,
|
|
29
29
|
id: { $eq: event.superEvent.id }
|
|
@@ -104,7 +104,7 @@ function searchEventTicketOffersByEvent(params) {
|
|
|
104
104
|
let soundFormatTypes = [];
|
|
105
105
|
let videoFormatTypes = [];
|
|
106
106
|
if (event.typeOf === factory_1.factory.eventType.ScreeningEvent) {
|
|
107
|
-
const superEvents = await repos.eventSeries.
|
|
107
|
+
const superEvents = await repos.eventSeries.findEventSeries({
|
|
108
108
|
limit: 1,
|
|
109
109
|
page: 1,
|
|
110
110
|
id: { $eq: event.superEvent.id }
|
|
@@ -66,7 +66,7 @@ function syncEventSeries2screeningEvents(params) {
|
|
|
66
66
|
return async (repos) => {
|
|
67
67
|
const now = new Date();
|
|
68
68
|
for (const eventSeriesId of params.ids) {
|
|
69
|
-
const superEvents = await repos.eventSeries.
|
|
69
|
+
const superEvents = await repos.eventSeries.findEventSeries({
|
|
70
70
|
limit: 1,
|
|
71
71
|
page: 1,
|
|
72
72
|
// typeOf: factory.eventType.ScreeningEventSeries,
|
|
@@ -162,7 +162,7 @@ function createInformTasks(params, setting) {
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
else {
|
|
165
|
-
const screeningEventSeries4inform = await repos.eventSeries.
|
|
165
|
+
const screeningEventSeries4inform = await repos.eventSeries.findEventSeries({
|
|
166
166
|
id: { $in: params.ids }
|
|
167
167
|
// typeOf: params.typeOf
|
|
168
168
|
}, [
|
|
@@ -241,7 +241,7 @@ function syncEvents(params) {
|
|
|
241
241
|
titleCode,
|
|
242
242
|
titleBranchNum
|
|
243
243
|
});
|
|
244
|
-
const eventSeries = (await repos.eventSeries.
|
|
244
|
+
const eventSeries = (await repos.eventSeries.findEventSeries({
|
|
245
245
|
id: { $eq: eventSeriesId },
|
|
246
246
|
project: { id: { $eq: params.project.id } }
|
|
247
247
|
}, [
|
package/package.json
CHANGED