@chevre/domain 21.2.0-alpha.143 → 21.2.0-alpha.145
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/findScreeningRoomsByBranchCode.ts +4 -3
- package/example/src/chevre/searchScreeningRooms.ts +16 -4
- package/example/src/chevre/syncScreeningRoomsAll.ts +1 -1
- package/lib/chevre/repo/place.d.ts +25 -13
- package/lib/chevre/repo/place.js +498 -368
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +12 -6
- package/lib/chevre/service/assetTransaction/reserve.js +1 -1
- package/lib/chevre/service/event.js +2 -1
- package/lib/chevre/service/offer.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.js +1 -6
- package/lib/chevre/settings.d.ts +2 -0
- package/lib/chevre/settings.js +3 -1
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ async function main() {
|
|
|
8
8
|
|
|
9
9
|
const placeRepo = new chevre.repository.Place(mongoose.connection);
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const screeningRoom = await placeRepo.findScreeningRoomsByBranchCode({
|
|
12
12
|
branchCode: {
|
|
13
13
|
$eq: '20'
|
|
14
14
|
},
|
|
@@ -16,9 +16,10 @@ async function main() {
|
|
|
16
16
|
id: {
|
|
17
17
|
$eq: '5bfb841d5a78d7948369979a'
|
|
18
18
|
}
|
|
19
|
-
}
|
|
19
|
+
},
|
|
20
|
+
useScreeningRoomType: true
|
|
20
21
|
});
|
|
21
|
-
console.log('room found',
|
|
22
|
+
console.log('room found', screeningRoom);
|
|
22
23
|
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -6,16 +6,28 @@ import { chevre } from '../../../lib/index';
|
|
|
6
6
|
// const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
7
7
|
|
|
8
8
|
async function main() {
|
|
9
|
-
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex:
|
|
9
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
10
10
|
|
|
11
11
|
const placeRepo = new chevre.repository.Place(mongoose.connection);
|
|
12
12
|
|
|
13
|
-
const rooms = await placeRepo.searchScreeningRooms(
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const rooms = await placeRepo.searchScreeningRooms(
|
|
14
|
+
{
|
|
15
|
+
limit: 10,
|
|
16
|
+
page: 1,
|
|
17
|
+
$projection: { sectionCount: 1 }
|
|
18
|
+
},
|
|
19
|
+
true
|
|
20
|
+
);
|
|
16
21
|
console.log('place found', rooms);
|
|
17
22
|
const filteredRooms = rooms.filter((room) => typeof room.sectionCount === 'number' && room.sectionCount > 1);
|
|
18
23
|
console.log(filteredRooms.length, 'filteredRooms found');
|
|
24
|
+
|
|
25
|
+
const screeningRoom = await placeRepo.findScreeningRoomsByBranchCode({
|
|
26
|
+
branchCode: { $eq: rooms[0].branchCode },
|
|
27
|
+
containedInPlace: { id: { $eq: String(rooms[0].containedInPlace?.id) } },
|
|
28
|
+
useScreeningRoomType: true
|
|
29
|
+
});
|
|
30
|
+
console.log('screeningRoom found', screeningRoom);
|
|
19
31
|
}
|
|
20
32
|
|
|
21
33
|
main()
|
|
@@ -30,7 +30,7 @@ async function main() {
|
|
|
30
30
|
doc.toObject();
|
|
31
31
|
|
|
32
32
|
console.log('syncing...', project.id, typeOf, id, name.ja, i);
|
|
33
|
-
|
|
33
|
+
await placeRepo.syncScreeningRooms({ id });
|
|
34
34
|
console.log('synced.', project.id, typeOf, id, name.ja, i);
|
|
35
35
|
});
|
|
36
36
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import { Connection } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
27
|
type IScreeningRoomSectionWithoutContainsPlace = Omit<factory.place.screeningRoomSection.IPlace, 'containsPlace'>;
|
|
28
|
-
export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace'>;
|
|
28
|
+
export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount'>;
|
|
29
29
|
/**
|
|
30
30
|
* 施設リポジトリ
|
|
31
31
|
*/
|
|
@@ -50,7 +50,7 @@ export declare class MongoRepository {
|
|
|
50
50
|
deleteMovieTheaterById(params: {
|
|
51
51
|
id: string;
|
|
52
52
|
}): Promise<void>;
|
|
53
|
-
createScreeningRoom(screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containsPlace'
|
|
53
|
+
createScreeningRoom(screeningRoom: Omit<factory.place.screeningRoom.IPlace, 'containsPlace'>, useScreeningRoomType?: boolean): Promise<{
|
|
54
54
|
/**
|
|
55
55
|
* 施設ID
|
|
56
56
|
*/
|
|
@@ -61,7 +61,7 @@ export declare class MongoRepository {
|
|
|
61
61
|
containedInPlace: {
|
|
62
62
|
branchCode: string;
|
|
63
63
|
};
|
|
64
|
-
}, $unset: any): Promise<{
|
|
64
|
+
}, $unset: any, useScreeningRoomType?: boolean): Promise<{
|
|
65
65
|
/**
|
|
66
66
|
* 施設ID
|
|
67
67
|
*/
|
|
@@ -82,14 +82,25 @@ export declare class MongoRepository {
|
|
|
82
82
|
*/
|
|
83
83
|
branchCode: string;
|
|
84
84
|
};
|
|
85
|
-
}): Promise<{
|
|
85
|
+
}, useScreeningRoomType?: boolean): Promise<{
|
|
86
86
|
/**
|
|
87
87
|
* 施設ID
|
|
88
88
|
*/
|
|
89
89
|
id: string;
|
|
90
90
|
typeOf: factory.placeType.MovieTheater;
|
|
91
91
|
}>;
|
|
92
|
-
|
|
92
|
+
deleteScreeningRoomsByMovieTheaterId(params: {
|
|
93
|
+
project: {
|
|
94
|
+
id: string;
|
|
95
|
+
};
|
|
96
|
+
containedInPlace: {
|
|
97
|
+
/**
|
|
98
|
+
* 施設ID
|
|
99
|
+
*/
|
|
100
|
+
id: string;
|
|
101
|
+
};
|
|
102
|
+
}): Promise<void>;
|
|
103
|
+
createScreeningRoomSection(screeningRoomSection: IScreeningRoomSectionWithoutContainsPlace, useScreeningRoomType?: boolean): Promise<{
|
|
93
104
|
/**
|
|
94
105
|
* 施設ID
|
|
95
106
|
*/
|
|
@@ -103,7 +114,7 @@ export declare class MongoRepository {
|
|
|
103
114
|
branchCode: string;
|
|
104
115
|
};
|
|
105
116
|
};
|
|
106
|
-
}, $unset: any): Promise<{
|
|
117
|
+
}, $unset: any, useScreeningRoomType?: boolean): Promise<{
|
|
107
118
|
/**
|
|
108
119
|
* 施設ID
|
|
109
120
|
*/
|
|
@@ -114,7 +125,7 @@ export declare class MongoRepository {
|
|
|
114
125
|
$projection?: {
|
|
115
126
|
[key: string]: number;
|
|
116
127
|
};
|
|
117
|
-
}, useScreeningRoomType
|
|
128
|
+
}, useScreeningRoomType: boolean): Promise<IScreeningRoomSectionWithoutContainsPlace[]>;
|
|
118
129
|
deleteScreeningRoomSection(screeningRoomSection: {
|
|
119
130
|
project: {
|
|
120
131
|
id: string;
|
|
@@ -135,14 +146,14 @@ export declare class MongoRepository {
|
|
|
135
146
|
branchCode: string;
|
|
136
147
|
};
|
|
137
148
|
};
|
|
138
|
-
}): Promise<{
|
|
149
|
+
}, useScreeningRoomType?: boolean): Promise<{
|
|
139
150
|
/**
|
|
140
151
|
* 施設ID
|
|
141
152
|
*/
|
|
142
153
|
id: string;
|
|
143
154
|
typeOf: factory.placeType.MovieTheater;
|
|
144
155
|
}>;
|
|
145
|
-
searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions, useScreeningRoomType
|
|
156
|
+
searchScreeningRooms(searchConditions: factory.place.screeningRoom.ISearchConditions, useScreeningRoomType: boolean): Promise<Omit<factory.place.screeningRoom.IPlace, 'containsPlace'>[]>;
|
|
146
157
|
findScreeningRoomsByBranchCode(params: {
|
|
147
158
|
branchCode: {
|
|
148
159
|
$eq: string;
|
|
@@ -152,8 +163,9 @@ export declare class MongoRepository {
|
|
|
152
163
|
$eq: string;
|
|
153
164
|
};
|
|
154
165
|
};
|
|
166
|
+
useScreeningRoomType: boolean;
|
|
155
167
|
}): Promise<IScreeningRoomFoundByBranchCode>;
|
|
156
|
-
createSeat(seat: factory.place.seat.IPlace): Promise<{
|
|
168
|
+
createSeat(seat: factory.place.seat.IPlace, useScreeningRoomType?: boolean): Promise<{
|
|
157
169
|
/**
|
|
158
170
|
* 施設ID
|
|
159
171
|
*/
|
|
@@ -170,14 +182,14 @@ export declare class MongoRepository {
|
|
|
170
182
|
};
|
|
171
183
|
};
|
|
172
184
|
};
|
|
173
|
-
}, $unset: any): Promise<{
|
|
185
|
+
}, $unset: any, useScreeningRoomType?: boolean): Promise<{
|
|
174
186
|
/**
|
|
175
187
|
* 施設ID
|
|
176
188
|
*/
|
|
177
189
|
id: string;
|
|
178
190
|
typeOf: factory.placeType.MovieTheater;
|
|
179
191
|
}>;
|
|
180
|
-
searchSeats(params: factory.place.seat.ISearchConditions, useScreeningRoomType
|
|
192
|
+
searchSeats(params: factory.place.seat.ISearchConditions, useScreeningRoomType: boolean): Promise<factory.place.seat.IPlace[]>;
|
|
181
193
|
deleteSeat(seat: {
|
|
182
194
|
project: {
|
|
183
195
|
id: string;
|
|
@@ -204,7 +216,7 @@ export declare class MongoRepository {
|
|
|
204
216
|
};
|
|
205
217
|
};
|
|
206
218
|
};
|
|
207
|
-
}): Promise<{
|
|
219
|
+
}, useScreeningRoomType?: boolean): Promise<{
|
|
208
220
|
/**
|
|
209
221
|
* 施設ID
|
|
210
222
|
*/
|