@chevre/domain 21.28.0-alpha.2 → 21.28.0-alpha.4
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/aggregation/aggregateEventReservation.ts +1 -1
- package/example/src/chevre/aggregation/aggregateOffersOnEvent.ts +1 -1
- package/example/src/chevre/importEventsFromCOA.ts +2 -2
- package/example/src/chevre/migrateMovieTheaterAdditionalProperties.ts +1 -1
- package/lib/chevre/repo/place/movieTheater.d.ts +47 -0
- package/lib/chevre/repo/place/movieTheater.js +30 -0
- package/lib/chevre/repo/place/screeningRoom.d.ts +113 -0
- package/lib/chevre/repo/{place.js → place/screeningRoom.js} +17 -262
- package/lib/chevre/repo/place/section.d.ts +64 -0
- package/lib/chevre/repo/place/section.js +274 -0
- package/lib/chevre/repository.d.ts +16 -5
- package/lib/chevre/repository.js +34 -15
- package/lib/chevre/service/aggregation/event/aggregateOffers.d.ts +2 -2
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +1 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +2 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/event.d.ts +2 -2
- package/lib/chevre/service/event.js +1 -1
- package/lib/chevre/service/project.d.ts +6 -3
- package/lib/chevre/service/project.js +2 -2
- package/lib/chevre/service/task/aggregateOffers.js +2 -2
- package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -2
- package/lib/chevre/service/task/importEventsFromCOA.js +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +8 -3
- package/lib/chevre/service/task/onResourceUpdated.js +4 -4
- package/package.json +3 -3
- package/lib/chevre/repo/place.d.ts +0 -207
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MongoRepository = void 0;
|
|
13
|
+
const factory = require("../../factory");
|
|
14
|
+
const settings_1 = require("../../settings");
|
|
15
|
+
const place_1 = require("../mongoose/schemas/place");
|
|
16
|
+
/**
|
|
17
|
+
* セクションリポジトリ
|
|
18
|
+
*/
|
|
19
|
+
class MongoRepository {
|
|
20
|
+
constructor(connection) {
|
|
21
|
+
this.placeModel = connection.model(place_1.modelName, (0, place_1.createSchema)());
|
|
22
|
+
}
|
|
23
|
+
// tslint:disable-next-line:max-func-body-length
|
|
24
|
+
createScreeningRoomSection(screeningRoomSection) {
|
|
25
|
+
var _a;
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const screeningRoom = screeningRoomSection.containedInPlace;
|
|
28
|
+
if (typeof (screeningRoom === null || screeningRoom === void 0 ? void 0 : screeningRoom.branchCode) !== 'string') {
|
|
29
|
+
throw new factory.errors.ArgumentNull('containedInPlace.branchCode');
|
|
30
|
+
}
|
|
31
|
+
const movieTheater = screeningRoom.containedInPlace;
|
|
32
|
+
if (typeof (movieTheater === null || movieTheater === void 0 ? void 0 : movieTheater.branchCode) !== 'string') {
|
|
33
|
+
throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.branchCode');
|
|
34
|
+
}
|
|
35
|
+
// 施設存在確認
|
|
36
|
+
const movieTheaterDoc = yield this.placeModel.findOne(Object.assign({ typeOf: { $eq: factory.placeType.MovieTheater }, 'project.id': { $eq: screeningRoomSection.project.id }, branchCode: { $eq: movieTheater.branchCode } }, (typeof ((_a = screeningRoomSection.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
|
|
37
|
+
? { 'parentOrganization.id': { $exists: true, $eq: screeningRoomSection.parentOrganization.id } }
|
|
38
|
+
: undefined), { _id: 1 })
|
|
39
|
+
.exec();
|
|
40
|
+
if (movieTheaterDoc === null) {
|
|
41
|
+
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
42
|
+
}
|
|
43
|
+
// セクションコードが存在しなければ追加する
|
|
44
|
+
const doc = yield this.placeModel.findOneAndUpdate({
|
|
45
|
+
typeOf: { $eq: factory.placeType.ScreeningRoom },
|
|
46
|
+
'project.id': { $eq: screeningRoomSection.project.id },
|
|
47
|
+
'containedInPlace.branchCode': { $exists: true, $eq: movieTheater.branchCode },
|
|
48
|
+
branchCode: { $eq: screeningRoom.branchCode },
|
|
49
|
+
'containsPlace.branchCode': { $ne: screeningRoomSection.branchCode }
|
|
50
|
+
}, {
|
|
51
|
+
$push: {
|
|
52
|
+
containsPlace: Object.assign({ typeOf: screeningRoomSection.typeOf, branchCode: screeningRoomSection.branchCode, name: screeningRoomSection.name }, (Array.isArray(screeningRoomSection.additionalProperty))
|
|
53
|
+
? { additionalProperty: screeningRoomSection.additionalProperty }
|
|
54
|
+
: undefined)
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
new: true,
|
|
58
|
+
projection: { 'containedInPlace.id': 1, typeOf: 1 }
|
|
59
|
+
})
|
|
60
|
+
.exec();
|
|
61
|
+
// 存在しなければコード重複
|
|
62
|
+
if (doc === null) {
|
|
63
|
+
throw new factory.errors.AlreadyInUse(factory.placeType.ScreeningRoomSection, ['branchCode']);
|
|
64
|
+
}
|
|
65
|
+
return doc.toObject();
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
// tslint:disable-next-line:max-func-body-length
|
|
69
|
+
updateScreeningRoomSection(screeningRoomSection, $unset) {
|
|
70
|
+
var _a;
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const screeningRoom = screeningRoomSection.containedInPlace;
|
|
73
|
+
if (typeof (screeningRoom === null || screeningRoom === void 0 ? void 0 : screeningRoom.branchCode) !== 'string') {
|
|
74
|
+
throw new factory.errors.ArgumentNull('containedInPlace.branchCode');
|
|
75
|
+
}
|
|
76
|
+
const movieTheater = screeningRoom.containedInPlace;
|
|
77
|
+
if (typeof (movieTheater === null || movieTheater === void 0 ? void 0 : movieTheater.branchCode) !== 'string') {
|
|
78
|
+
throw new factory.errors.ArgumentNull('containedInPlace.containedInPlace.branchCode');
|
|
79
|
+
}
|
|
80
|
+
const doc = yield this.placeModel.findOneAndUpdate(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: screeningRoomSection.project.id }, 'containedInPlace.branchCode': { $exists: true, $eq: movieTheater.branchCode }, branchCode: { $eq: screeningRoom.branchCode }, 'containsPlace.branchCode': { $eq: screeningRoomSection.branchCode } }, (typeof ((_a = screeningRoomSection.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
|
|
81
|
+
? { 'parentOrganization.id': { $exists: true, $eq: screeningRoomSection.parentOrganization.id } }
|
|
82
|
+
: undefined), Object.assign(Object.assign(Object.assign(Object.assign({ 'containsPlace.$[screeningRoomSection].branchCode': screeningRoomSection.branchCode }, (screeningRoomSection.name !== undefined && screeningRoomSection !== null)
|
|
83
|
+
? {
|
|
84
|
+
'containsPlace.$[screeningRoomSection].name': screeningRoomSection.name
|
|
85
|
+
}
|
|
86
|
+
: undefined), (Array.isArray(screeningRoomSection.additionalProperty))
|
|
87
|
+
? {
|
|
88
|
+
'containsPlace.$[screeningRoomSection].additionalProperty': screeningRoomSection.additionalProperty
|
|
89
|
+
}
|
|
90
|
+
: undefined), (Array.isArray(screeningRoomSection.containsPlace) && screeningRoomSection.containsPlace.length > 0)
|
|
91
|
+
? {
|
|
92
|
+
'containsPlace.$[screeningRoomSection].containsPlace': screeningRoomSection.containsPlace.map((p) => {
|
|
93
|
+
return Object.assign(Object.assign(Object.assign({ typeOf: p.typeOf, branchCode: p.branchCode }, (p.name !== undefined && p.name !== null) ? { name: p.name } : undefined), (Array.isArray(p.seatingType)) ? { seatingType: p.seatingType } : undefined), (Array.isArray(p.additionalProperty)) ? { additionalProperty: p.additionalProperty } : undefined);
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
: undefined), ($unset !== undefined && $unset !== null) ? { $unset } : undefined), {
|
|
97
|
+
new: true,
|
|
98
|
+
arrayFilters: [
|
|
99
|
+
{ 'screeningRoomSection.branchCode': screeningRoomSection.branchCode }
|
|
100
|
+
],
|
|
101
|
+
projection: { 'containedInPlace.id': 1, typeOf: 1 }
|
|
102
|
+
})
|
|
103
|
+
.exec();
|
|
104
|
+
if (doc === null) {
|
|
105
|
+
throw new factory.errors.NotFound(factory.placeType.ScreeningRoomSection);
|
|
106
|
+
}
|
|
107
|
+
return doc.toObject();
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// tslint:disable-next-line:cyclomatic-complexity max-func-body-length
|
|
111
|
+
searchScreeningRoomSections(searchConditions) {
|
|
112
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
const matchStages = [{ $match: { typeOf: { $eq: factory.placeType.ScreeningRoom } } }];
|
|
115
|
+
const projectIdEq = (_b = (_a = searchConditions.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
116
|
+
if (typeof projectIdEq === 'string') {
|
|
117
|
+
matchStages.push({
|
|
118
|
+
$match: { 'project.id': { $eq: projectIdEq } }
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const parentOrganizationIdEq = (_d = (_c = searchConditions.parentOrganization) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$eq;
|
|
122
|
+
if (typeof parentOrganizationIdEq === 'string') {
|
|
123
|
+
matchStages.push({
|
|
124
|
+
$match: { 'parentOrganization.id': { $exists: true, $eq: parentOrganizationIdEq } }
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
// 施設コード
|
|
128
|
+
const movieTheaterBranchCodeEq = (_g = (_f = (_e = searchConditions.containedInPlace) === null || _e === void 0 ? void 0 : _e.containedInPlace) === null || _f === void 0 ? void 0 : _f.branchCode) === null || _g === void 0 ? void 0 : _g.$eq;
|
|
129
|
+
if (typeof movieTheaterBranchCodeEq === 'string') {
|
|
130
|
+
matchStages.push({
|
|
131
|
+
$match: {
|
|
132
|
+
'containedInPlace.branchCode': {
|
|
133
|
+
$exists: true,
|
|
134
|
+
$eq: movieTheaterBranchCodeEq
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
// ルームコード
|
|
140
|
+
const containedInPlaceBranchCodeEq = (_j = (_h = searchConditions.containedInPlace) === null || _h === void 0 ? void 0 : _h.branchCode) === null || _j === void 0 ? void 0 : _j.$eq;
|
|
141
|
+
if (typeof containedInPlaceBranchCodeEq === 'string') {
|
|
142
|
+
matchStages.push({
|
|
143
|
+
$match: {
|
|
144
|
+
branchCode: {
|
|
145
|
+
$eq: containedInPlaceBranchCodeEq
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// セクションコード
|
|
151
|
+
const sectionBranchCodeEq = (_k = searchConditions === null || searchConditions === void 0 ? void 0 : searchConditions.branchCode) === null || _k === void 0 ? void 0 : _k.$eq;
|
|
152
|
+
if (typeof sectionBranchCodeEq === 'string') {
|
|
153
|
+
matchStages.push({
|
|
154
|
+
$match: {
|
|
155
|
+
'containsPlace.branchCode': {
|
|
156
|
+
$exists: true,
|
|
157
|
+
$eq: sectionBranchCodeEq
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
const nameCodeRegex = (_l = searchConditions.name) === null || _l === void 0 ? void 0 : _l.$regex;
|
|
163
|
+
if (typeof nameCodeRegex === 'string') {
|
|
164
|
+
matchStages.push({
|
|
165
|
+
$match: {
|
|
166
|
+
$or: [
|
|
167
|
+
{
|
|
168
|
+
'containsPlace.name.ja': {
|
|
169
|
+
$exists: true,
|
|
170
|
+
$regex: new RegExp(nameCodeRegex)
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
'containsPlace.name.en': {
|
|
175
|
+
$exists: true,
|
|
176
|
+
$regex: new RegExp(nameCodeRegex)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
const branchCodeRegex = (_m = searchConditions.branchCode) === null || _m === void 0 ? void 0 : _m.$regex;
|
|
184
|
+
if (typeof branchCodeRegex === 'string') {
|
|
185
|
+
matchStages.push({
|
|
186
|
+
$match: {
|
|
187
|
+
'containsPlace.branchCode': {
|
|
188
|
+
$exists: true,
|
|
189
|
+
$regex: new RegExp(branchCodeRegex)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
const additionalPropertyElemMatch = (_o = searchConditions.additionalProperty) === null || _o === void 0 ? void 0 : _o.$elemMatch;
|
|
195
|
+
if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
196
|
+
matchStages.push({
|
|
197
|
+
$match: {
|
|
198
|
+
'containsPlace.additionalProperty': {
|
|
199
|
+
$exists: true,
|
|
200
|
+
$elemMatch: additionalPropertyElemMatch
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
const aggregate = this.placeModel.aggregate([
|
|
206
|
+
{ $unwind: '$containsPlace' },
|
|
207
|
+
...matchStages,
|
|
208
|
+
{
|
|
209
|
+
$project: Object.assign(Object.assign({ _id: 0, typeOf: '$containsPlace.typeOf', branchCode: '$containsPlace.branchCode', name: '$containsPlace.name', additionalProperty: '$containsPlace.additionalProperty' }, (((_p = searchConditions.$projection) === null || _p === void 0 ? void 0 : _p.containedInPlace) === 1)
|
|
210
|
+
? {
|
|
211
|
+
containedInPlace: {
|
|
212
|
+
typeOf: '$typeOf',
|
|
213
|
+
branchCode: '$branchCode',
|
|
214
|
+
name: '$name',
|
|
215
|
+
containedInPlace: {
|
|
216
|
+
id: '$containedInPlace.id',
|
|
217
|
+
typeOf: '$containedInPlace.typeOf',
|
|
218
|
+
branchCode: '$containedInPlace.branchCode',
|
|
219
|
+
name: '$containedInPlace.name'
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
: undefined), (((_q = searchConditions.$projection) === null || _q === void 0 ? void 0 : _q.seatCount) === 1)
|
|
224
|
+
? {
|
|
225
|
+
seatCount: {
|
|
226
|
+
$cond: {
|
|
227
|
+
if: { $isArray: '$containsPlace.containsPlace' },
|
|
228
|
+
then: { $size: '$containsPlace.containsPlace' },
|
|
229
|
+
else: 0
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
: undefined)
|
|
234
|
+
}
|
|
235
|
+
]);
|
|
236
|
+
// tslint:disable-next-line:no-single-line-block-comment
|
|
237
|
+
/* istanbul ignore else */
|
|
238
|
+
if (typeof searchConditions.limit === 'number' && searchConditions.limit > 0) {
|
|
239
|
+
const page = (typeof searchConditions.page === 'number' && searchConditions.page > 0) ? searchConditions.page : 1;
|
|
240
|
+
aggregate.limit(searchConditions.limit * page)
|
|
241
|
+
.skip(searchConditions.limit * (page - 1));
|
|
242
|
+
}
|
|
243
|
+
return aggregate
|
|
244
|
+
.option({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
245
|
+
.exec();
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
deleteScreeningRoomSection(screeningRoomSection) {
|
|
249
|
+
var _a;
|
|
250
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
251
|
+
const doc = yield this.placeModel.findOneAndUpdate(Object.assign({ typeOf: { $eq: factory.placeType.ScreeningRoom }, 'project.id': { $eq: screeningRoomSection.project.id }, 'containedInPlace.branchCode': {
|
|
252
|
+
$exists: true,
|
|
253
|
+
$eq: screeningRoomSection.containedInPlace.containedInPlace.branchCode
|
|
254
|
+
}, branchCode: { $eq: screeningRoomSection.containedInPlace.branchCode }, 'containsPlace.branchCode': { $eq: screeningRoomSection.branchCode } }, (typeof ((_a = screeningRoomSection.parentOrganization) === null || _a === void 0 ? void 0 : _a.id) === 'string')
|
|
255
|
+
? { 'parentOrganization.id': { $exists: true, $eq: screeningRoomSection.parentOrganization.id } }
|
|
256
|
+
: undefined), {
|
|
257
|
+
$pull: {
|
|
258
|
+
containsPlace: {
|
|
259
|
+
branchCode: screeningRoomSection.branchCode
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}, {
|
|
263
|
+
new: true,
|
|
264
|
+
projection: { 'containedInPlace.id': 1, typeOf: 1 }
|
|
265
|
+
})
|
|
266
|
+
.exec();
|
|
267
|
+
if (doc === null) {
|
|
268
|
+
throw new factory.errors.NotFound(factory.placeType.ScreeningRoomSection);
|
|
269
|
+
}
|
|
270
|
+
return doc.toObject();
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
exports.MongoRepository = MongoRepository;
|
|
@@ -32,11 +32,12 @@ import type { MongoRepository as OwnershipInfoRepo } from './repo/ownershipInfo'
|
|
|
32
32
|
import type { MongoRepository as PaymentServiceRepo } from './repo/paymentService';
|
|
33
33
|
import type { MongoRepository as PaymentServiceProviderRepo } from './repo/paymentServiceProvider';
|
|
34
34
|
import type { MongoRepository as PermitRepo } from './repo/permit';
|
|
35
|
-
import type { MongoRepository as PlaceRepo } from './repo/place';
|
|
36
35
|
import type { MongoRepository as BusStopRepo } from './repo/place/busStop';
|
|
37
36
|
import type { MongoRepository as HasPOSRepo } from './repo/place/hasPOS';
|
|
38
37
|
import type { MongoRepository as MovieTheaterRepo } from './repo/place/movieTheater';
|
|
38
|
+
import type { MongoRepository as ScreeningRoomRepo } from './repo/place/screeningRoom';
|
|
39
39
|
import type { MongoRepository as SeatRepo } from './repo/place/seat';
|
|
40
|
+
import type { MongoRepository as SectionRepo } from './repo/place/section';
|
|
40
41
|
import type { MongoRepository as PriceSpecificationRepo } from './repo/priceSpecification';
|
|
41
42
|
import type { MongoRepository as ProductRepo } from './repo/product';
|
|
42
43
|
import type { MongoRepository as ProductOfferRepo } from './repo/productOffer';
|
|
@@ -204,10 +205,6 @@ export type Permit = PermitRepo;
|
|
|
204
205
|
export declare namespace Permit {
|
|
205
206
|
function createInstance(...params: ConstructorParameters<typeof PermitRepo>): Promise<PermitRepo>;
|
|
206
207
|
}
|
|
207
|
-
export type Place = PlaceRepo;
|
|
208
|
-
export declare namespace Place {
|
|
209
|
-
function createInstance(...params: ConstructorParameters<typeof PlaceRepo>): Promise<PlaceRepo>;
|
|
210
|
-
}
|
|
211
208
|
export declare namespace place {
|
|
212
209
|
type BusStop = BusStopRepo;
|
|
213
210
|
/**
|
|
@@ -230,6 +227,13 @@ export declare namespace place {
|
|
|
230
227
|
namespace MovieTheater {
|
|
231
228
|
function createInstance(...params: ConstructorParameters<typeof MovieTheaterRepo>): Promise<MovieTheaterRepo>;
|
|
232
229
|
}
|
|
230
|
+
type ScreeningRoom = ScreeningRoomRepo;
|
|
231
|
+
/**
|
|
232
|
+
* ルームリポジトリ
|
|
233
|
+
*/
|
|
234
|
+
namespace ScreeningRoom {
|
|
235
|
+
function createInstance(...params: ConstructorParameters<typeof ScreeningRoomRepo>): Promise<ScreeningRoomRepo>;
|
|
236
|
+
}
|
|
233
237
|
type Seat = SeatRepo;
|
|
234
238
|
/**
|
|
235
239
|
* 座席リポジトリ
|
|
@@ -237,6 +241,13 @@ export declare namespace place {
|
|
|
237
241
|
namespace Seat {
|
|
238
242
|
function createInstance(...params: ConstructorParameters<typeof SeatRepo>): Promise<SeatRepo>;
|
|
239
243
|
}
|
|
244
|
+
type Section = SectionRepo;
|
|
245
|
+
/**
|
|
246
|
+
* セクションリポジトリ
|
|
247
|
+
*/
|
|
248
|
+
namespace Section {
|
|
249
|
+
function createInstance(...params: ConstructorParameters<typeof SectionRepo>): Promise<SectionRepo>;
|
|
250
|
+
}
|
|
240
251
|
}
|
|
241
252
|
export type PriceSpecification = PriceSpecificationRepo;
|
|
242
253
|
export declare namespace PriceSpecification {
|
package/lib/chevre/repository.js
CHANGED
|
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Task = exports.StockHolder = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.SellerPaymentAccepted = exports.Seller = exports.Role = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductOffer = exports.Product = exports.PriceSpecification = exports.place = exports.
|
|
13
|
-
exports.rateLimit = exports.Trip = exports.TransactionNumber = exports.Transaction =
|
|
12
|
+
exports.Telemetry = exports.Task = exports.StockHolder = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.SellerPaymentAccepted = exports.Seller = exports.Role = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductOffer = exports.Product = exports.PriceSpecification = exports.place = exports.Permit = exports.Person = exports.paymentMethod = exports.PaymentServiceProvider = exports.PaymentService = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.Note = exports.MerchantReturnPolicy = exports.Member = exports.Event = exports.EmailMessage = exports.Customer = exports.CreativeWork = exports.ConfirmationNumber = exports.Comment = exports.Code = exports.CategoryCode = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOffer = exports.AdditionalProperty = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = exports.AcceptedOffer = void 0;
|
|
13
|
+
exports.rateLimit = exports.Trip = exports.TransactionNumber = exports.Transaction = void 0;
|
|
14
14
|
var AcceptedOffer;
|
|
15
15
|
(function (AcceptedOffer) {
|
|
16
16
|
let repo;
|
|
@@ -469,19 +469,6 @@ var Permit;
|
|
|
469
469
|
}
|
|
470
470
|
Permit.createInstance = createInstance;
|
|
471
471
|
})(Permit = exports.Permit || (exports.Permit = {}));
|
|
472
|
-
var Place;
|
|
473
|
-
(function (Place) {
|
|
474
|
-
let repo;
|
|
475
|
-
function createInstance(...params) {
|
|
476
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
477
|
-
if (repo === undefined) {
|
|
478
|
-
repo = (yield Promise.resolve().then(() => require('./repo/place'))).MongoRepository;
|
|
479
|
-
}
|
|
480
|
-
return new repo(...params);
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
Place.createInstance = createInstance;
|
|
484
|
-
})(Place = exports.Place || (exports.Place = {}));
|
|
485
472
|
var place;
|
|
486
473
|
(function (place) {
|
|
487
474
|
/**
|
|
@@ -532,6 +519,22 @@ var place;
|
|
|
532
519
|
}
|
|
533
520
|
MovieTheater.createInstance = createInstance;
|
|
534
521
|
})(MovieTheater = place.MovieTheater || (place.MovieTheater = {}));
|
|
522
|
+
/**
|
|
523
|
+
* ルームリポジトリ
|
|
524
|
+
*/
|
|
525
|
+
let ScreeningRoom;
|
|
526
|
+
(function (ScreeningRoom) {
|
|
527
|
+
let repo;
|
|
528
|
+
function createInstance(...params) {
|
|
529
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
530
|
+
if (repo === undefined) {
|
|
531
|
+
repo = (yield Promise.resolve().then(() => require('./repo/place/screeningRoom'))).MongoRepository;
|
|
532
|
+
}
|
|
533
|
+
return new repo(...params);
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
ScreeningRoom.createInstance = createInstance;
|
|
537
|
+
})(ScreeningRoom = place.ScreeningRoom || (place.ScreeningRoom = {}));
|
|
535
538
|
/**
|
|
536
539
|
* 座席リポジトリ
|
|
537
540
|
*/
|
|
@@ -548,6 +551,22 @@ var place;
|
|
|
548
551
|
}
|
|
549
552
|
Seat.createInstance = createInstance;
|
|
550
553
|
})(Seat = place.Seat || (place.Seat = {}));
|
|
554
|
+
/**
|
|
555
|
+
* セクションリポジトリ
|
|
556
|
+
*/
|
|
557
|
+
let Section;
|
|
558
|
+
(function (Section) {
|
|
559
|
+
let repo;
|
|
560
|
+
function createInstance(...params) {
|
|
561
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
562
|
+
if (repo === undefined) {
|
|
563
|
+
repo = (yield Promise.resolve().then(() => require('./repo/place/section'))).MongoRepository;
|
|
564
|
+
}
|
|
565
|
+
return new repo(...params);
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
Section.createInstance = createInstance;
|
|
569
|
+
})(Section = place.Section || (place.Section = {}));
|
|
551
570
|
})(place = exports.place || (exports.place = {}));
|
|
552
571
|
var PriceSpecification;
|
|
553
572
|
(function (PriceSpecification) {
|
|
@@ -2,7 +2,7 @@ import type { MongoRepository as AggregateReservationRepo } from '../../../repo/
|
|
|
2
2
|
import { MongoRepository as EventRepo } from '../../../repo/event';
|
|
3
3
|
import type { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
4
4
|
import type { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
5
|
-
import { MongoRepository as
|
|
5
|
+
import { MongoRepository as ScreeningRoomRepo } from '../../../repo/place/screeningRoom';
|
|
6
6
|
import type { MongoRepository as ProductRepo } from '../../../repo/product';
|
|
7
7
|
import { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
8
8
|
import type { MongoRepository as ReservationRepo } from '../../../repo/reservation';
|
|
@@ -16,7 +16,7 @@ type IAggregateOffersOperation<T> = (repos: {
|
|
|
16
16
|
offer: OfferRepo;
|
|
17
17
|
offerCatalog: OfferCatalogRepo;
|
|
18
18
|
offerRateLimit: OfferRateLimitRepo;
|
|
19
|
-
|
|
19
|
+
screeningRoom: ScreeningRoomRepo;
|
|
20
20
|
product: ProductRepo;
|
|
21
21
|
reservation: ReservationRepo;
|
|
22
22
|
task: TaskRepo;
|
|
@@ -52,7 +52,7 @@ function aggregateOffersByEvent(params) {
|
|
|
52
52
|
else {
|
|
53
53
|
movieTheaterId = String((_a = params.event.offers) === null || _a === void 0 ? void 0 : _a.itemOffered.availableChannel.serviceLocation.containedInPlace.id);
|
|
54
54
|
}
|
|
55
|
-
const screeningRoom = yield repos.
|
|
55
|
+
const screeningRoom = yield repos.screeningRoom.findScreeningRoomsByBranchCode({
|
|
56
56
|
project: { id: event.project.id },
|
|
57
57
|
branchCode: { $eq: event.location.branchCode },
|
|
58
58
|
containedInPlace: { id: { $eq: movieTheaterId } }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IMinimizedIndividualEvent, MongoRepository as EventRepo } from '../../../repo/event';
|
|
2
2
|
import type { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
3
3
|
import type { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
4
|
-
import { MongoRepository as
|
|
4
|
+
import { MongoRepository as ScreeningRoomRepo } from '../../../repo/place/screeningRoom';
|
|
5
5
|
import type { MongoRepository as ProductRepo } from '../../../repo/product';
|
|
6
6
|
import { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
7
7
|
import type { MongoRepository as ReservationRepo } from '../../../repo/reservation';
|
|
@@ -14,7 +14,7 @@ export interface IAggregateScreeningEventRepos {
|
|
|
14
14
|
offer: OfferRepo;
|
|
15
15
|
offerCatalog: OfferCatalogRepo;
|
|
16
16
|
offerRateLimit: OfferRateLimitRepo;
|
|
17
|
-
|
|
17
|
+
screeningRoom: ScreeningRoomRepo;
|
|
18
18
|
product: ProductRepo;
|
|
19
19
|
reservation: ReservationRepo;
|
|
20
20
|
task: TaskRepo;
|
|
@@ -94,7 +94,7 @@ function aggregateByEvent(params) {
|
|
|
94
94
|
else {
|
|
95
95
|
movieTheaterId = String((_a = params.event.offers) === null || _a === void 0 ? void 0 : _a.itemOffered.availableChannel.serviceLocation.containedInPlace.id);
|
|
96
96
|
}
|
|
97
|
-
const screeningRoom = yield repos.
|
|
97
|
+
const screeningRoom = yield repos.screeningRoom.findScreeningRoomsByBranchCode({
|
|
98
98
|
project: { id: event.project.id },
|
|
99
99
|
branchCode: { $eq: event.location.branchCode },
|
|
100
100
|
containedInPlace: { id: { $eq: movieTheaterId } }
|
|
@@ -2,8 +2,8 @@ import type { MongoRepository as ActionRepo } from '../repo/action';
|
|
|
2
2
|
import type { MongoRepository as CategoryCodeRepo } from '../repo/categoryCode';
|
|
3
3
|
import type { MongoRepository as CreativeWorkRepo } from '../repo/creativeWork';
|
|
4
4
|
import type { MongoRepository as EventRepo } from '../repo/event';
|
|
5
|
-
import type { MongoRepository as PlaceRepo } from '../repo/place';
|
|
6
5
|
import type { MongoRepository as MovieTheaterRepo } from '../repo/place/movieTheater';
|
|
6
|
+
import type { MongoRepository as ScreeningRoomRepo } from '../repo/place/screeningRoom';
|
|
7
7
|
import type { MongoRepository as ProjectRepo } from '../repo/project';
|
|
8
8
|
import type { MongoRepository as SellerRepo } from '../repo/seller';
|
|
9
9
|
import type { MongoRepository as TaskRepo } from '../repo/task';
|
|
@@ -41,7 +41,7 @@ export declare function importFromCOA(params: {
|
|
|
41
41
|
creativeWork: CreativeWorkRepo;
|
|
42
42
|
event: EventRepo;
|
|
43
43
|
movieTheater: MovieTheaterRepo;
|
|
44
|
-
|
|
44
|
+
screeningRoom: ScreeningRoomRepo;
|
|
45
45
|
seller: SellerRepo;
|
|
46
46
|
}) => Promise<void>;
|
|
47
47
|
/**
|
|
@@ -122,7 +122,7 @@ function importFromCOA(params) {
|
|
|
122
122
|
if (movieTheater === undefined) {
|
|
123
123
|
throw new factory.errors.NotFound(factory.placeType.MovieTheater);
|
|
124
124
|
}
|
|
125
|
-
const screeningRooms = yield repos.
|
|
125
|
+
const screeningRooms = yield repos.screeningRoom.searchScreeningRooms({
|
|
126
126
|
project: { id: { $eq: project.id } },
|
|
127
127
|
containedInPlace: { branchCode: { $eq: movieTheater.branchCode } }
|
|
128
128
|
});
|
|
@@ -10,7 +10,8 @@ import type { MongoRepository as EventRepo } from '../repo/event';
|
|
|
10
10
|
import type { MongoRepository as MemberRepo } from '../repo/member';
|
|
11
11
|
import type { MongoRepository as OfferRepo } from '../repo/offer';
|
|
12
12
|
import type { MongoRepository as OfferCatalogRepo } from '../repo/offerCatalog';
|
|
13
|
-
import type { MongoRepository as
|
|
13
|
+
import type { MongoRepository as MovieTheaterRepo } from '../repo/place/movieTheater';
|
|
14
|
+
import type { MongoRepository as ScreeningRoomRepo } from '../repo/place/screeningRoom';
|
|
14
15
|
import type { MongoRepository as PriceSpecificationRepo } from '../repo/priceSpecification';
|
|
15
16
|
import type { MongoRepository as ProductRepo } from '../repo/product';
|
|
16
17
|
import type { MongoRepository as ProjectRepo } from '../repo/project';
|
|
@@ -28,11 +29,12 @@ export declare function deleteProject(params: {
|
|
|
28
29
|
member: MemberRepo;
|
|
29
30
|
offer: OfferRepo;
|
|
30
31
|
offerCatalog: OfferCatalogRepo;
|
|
31
|
-
place: PlaceRepo;
|
|
32
32
|
priceSpecification: PriceSpecificationRepo;
|
|
33
33
|
product: ProductRepo;
|
|
34
34
|
project: ProjectRepo;
|
|
35
35
|
reservation: ReservationRepo;
|
|
36
|
+
movieTheater: MovieTheaterRepo;
|
|
37
|
+
screeningRoom: ScreeningRoomRepo;
|
|
36
38
|
seller: SellerRepo;
|
|
37
39
|
task: TaskRepo;
|
|
38
40
|
assetTransaction: AssetTransactionRepo;
|
|
@@ -48,10 +50,11 @@ export declare function cleanUpDatabaseByProject(params: {
|
|
|
48
50
|
event: EventRepo;
|
|
49
51
|
offer: OfferRepo;
|
|
50
52
|
offerCatalog: OfferCatalogRepo;
|
|
51
|
-
place: PlaceRepo;
|
|
52
53
|
priceSpecification: PriceSpecificationRepo;
|
|
53
54
|
product: ProductRepo;
|
|
54
55
|
reservation: ReservationRepo;
|
|
56
|
+
movieTheater: MovieTheaterRepo;
|
|
57
|
+
screeningRoom: ScreeningRoomRepo;
|
|
55
58
|
seller: SellerRepo;
|
|
56
59
|
task: TaskRepo;
|
|
57
60
|
}) => Promise<void>;
|
|
@@ -27,9 +27,9 @@ function cleanUpDatabaseByProject(params) {
|
|
|
27
27
|
yield repos.categoryCode.deleteByProject({ project: { id: params.id } });
|
|
28
28
|
yield repos.creativeWork.deleteByProject({ project: { id: params.id } });
|
|
29
29
|
yield repos.event.deleteByProject({ project: { id: params.id } });
|
|
30
|
-
// await repos.offer.deleteByProject({ project: { id: params.id } });
|
|
31
30
|
yield repos.offerCatalog.deleteByProject({ project: { id: params.id } });
|
|
32
|
-
yield repos.
|
|
31
|
+
yield repos.screeningRoom.deleteScreeningRoomsByProject({ project: { id: params.id } });
|
|
32
|
+
yield repos.movieTheater.deleteMovieTheatersByProject({ project: { id: params.id } });
|
|
33
33
|
yield repos.priceSpecification.deleteByProject({ project: { id: params.id } });
|
|
34
34
|
yield repos.product.deleteByProject({ project: { id: params.id } });
|
|
35
35
|
yield repos.reservation.deleteByProject({ project: { id: params.id } });
|
|
@@ -15,7 +15,7 @@ const aggregateReservation_1 = require("../../repo/aggregateReservation");
|
|
|
15
15
|
const event_1 = require("../../repo/event");
|
|
16
16
|
const offer_1 = require("../../repo/offer");
|
|
17
17
|
const offerCatalog_1 = require("../../repo/offerCatalog");
|
|
18
|
-
const
|
|
18
|
+
const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
19
19
|
const product_1 = require("../../repo/product");
|
|
20
20
|
const offer_2 = require("../../repo/rateLimit/offer");
|
|
21
21
|
const reservation_1 = require("../../repo/reservation");
|
|
@@ -37,9 +37,9 @@ function call(data) {
|
|
|
37
37
|
offer: new offer_1.MongoRepository(settings.connection),
|
|
38
38
|
offerCatalog: new offerCatalog_1.MongoRepository(settings.connection),
|
|
39
39
|
offerRateLimit: new offer_2.RedisRepository(settings.redisClient),
|
|
40
|
-
place: new place_1.MongoRepository(settings.connection),
|
|
41
40
|
product: new product_1.MongoRepository(settings.connection),
|
|
42
41
|
reservation: new reservation_1.MongoRepository(settings.connection),
|
|
42
|
+
screeningRoom: new screeningRoom_1.MongoRepository(settings.connection),
|
|
43
43
|
task: new task_1.MongoRepository(settings.connection)
|
|
44
44
|
});
|
|
45
45
|
});
|
|
@@ -14,7 +14,7 @@ const factory = require("../../factory");
|
|
|
14
14
|
const event_1 = require("../../repo/event");
|
|
15
15
|
const offer_1 = require("../../repo/offer");
|
|
16
16
|
const offerCatalog_1 = require("../../repo/offerCatalog");
|
|
17
|
-
const
|
|
17
|
+
const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
18
18
|
const product_1 = require("../../repo/product");
|
|
19
19
|
const offer_2 = require("../../repo/rateLimit/offer");
|
|
20
20
|
const reservation_1 = require("../../repo/reservation");
|
|
@@ -35,7 +35,7 @@ function call(data) {
|
|
|
35
35
|
offer: new offer_1.MongoRepository(settings.connection),
|
|
36
36
|
offerCatalog: new offerCatalog_1.MongoRepository(settings.connection),
|
|
37
37
|
offerRateLimit: new offer_2.RedisRepository(settings.redisClient),
|
|
38
|
-
|
|
38
|
+
screeningRoom: new screeningRoom_1.MongoRepository(settings.connection),
|
|
39
39
|
product: new product_1.MongoRepository(settings.connection),
|
|
40
40
|
reservation: new reservation_1.MongoRepository(settings.connection),
|
|
41
41
|
task: new task_1.MongoRepository(settings.connection)
|
|
@@ -14,8 +14,8 @@ const action_1 = require("../../repo/action");
|
|
|
14
14
|
const categoryCode_1 = require("../../repo/categoryCode");
|
|
15
15
|
const creativeWork_1 = require("../../repo/creativeWork");
|
|
16
16
|
const event_1 = require("../../repo/event");
|
|
17
|
-
const place_1 = require("../../repo/place");
|
|
18
17
|
const movieTheater_1 = require("../../repo/place/movieTheater");
|
|
18
|
+
const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
19
19
|
const seller_1 = require("../../repo/seller");
|
|
20
20
|
const EventService = require("../event");
|
|
21
21
|
/**
|
|
@@ -29,7 +29,7 @@ function call(data) {
|
|
|
29
29
|
creativeWork: new creativeWork_1.MongoRepository(settings.connection),
|
|
30
30
|
event: new event_1.MongoRepository(settings.connection),
|
|
31
31
|
movieTheater: new movieTheater_1.MongoRepository(settings.connection),
|
|
32
|
-
|
|
32
|
+
screeningRoom: new screeningRoom_1.MongoRepository(settings.connection),
|
|
33
33
|
seller: new seller_1.MongoRepository(settings.connection)
|
|
34
34
|
});
|
|
35
35
|
});
|
|
@@ -10,9 +10,9 @@ import type { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
|
10
10
|
import type { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
11
11
|
import type { MongoRepository as OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
12
12
|
import type { MongoRepository as PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
13
|
-
import type { MongoRepository as PlaceRepo } from '../../../repo/place';
|
|
14
13
|
import type { MongoRepository as HasPOSRepo } from '../../../repo/place/hasPOS';
|
|
15
14
|
import type { MongoRepository as MovieTheaterRepo } from '../../../repo/place/movieTheater';
|
|
15
|
+
import type { MongoRepository as ScreeningRoomRepo } from '../../../repo/place/screeningRoom';
|
|
16
16
|
import type { MongoRepository as ProductRepo } from '../../../repo/product';
|
|
17
17
|
import type { MongoRepository as ProductOfferRepo } from '../../../repo/productOffer';
|
|
18
18
|
import type { MongoRepository as TaskRepo } from '../../../repo/task';
|
|
@@ -30,7 +30,7 @@ export declare function onResourceDeleted(params: factory.task.onResourceUpdated
|
|
|
30
30
|
offer: OfferRepo;
|
|
31
31
|
offerCatalog: OfferCatalogRepo;
|
|
32
32
|
offerCatalogItem: OfferCatalogItemRepo;
|
|
33
|
-
|
|
33
|
+
screeningRoom: ScreeningRoomRepo;
|
|
34
34
|
product: ProductRepo;
|
|
35
35
|
productOffer: ProductOfferRepo;
|
|
36
36
|
task: TaskRepo;
|