@chevre/domain 27.1.0-alpha.2 → 27.1.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/lib/chevre/repo/adminEvent.d.ts +236 -0
- package/lib/chevre/repo/adminEvent.js +388 -0
- package/lib/chevre/repo/aggregateEvent.d.ts +42 -0
- package/lib/chevre/repo/aggregateEvent.js +221 -0
- package/lib/chevre/repo/event.d.ts +5 -263
- package/lib/chevre/repo/event.js +31 -664
- package/lib/chevre/repo/eventSeries.js +24 -24
- package/lib/chevre/repository.d.ts +10 -0
- package/lib/chevre/repository.js +24 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +2 -0
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/aggregation/event/importFromCOA.d.ts +2 -2
- package/lib/chevre/service/aggregation/event/importFromCOA.js +1 -1
- package/lib/chevre/service/aggregation/system.d.ts +2 -2
- package/lib/chevre/service/aggregation/system.js +1 -1
- package/lib/chevre/service/event/saveScreeningEvents.d.ts +2 -2
- package/lib/chevre/service/event/saveScreeningEvents.js +1 -1
- package/lib/chevre/service/event.d.ts +2 -0
- package/lib/chevre/service/event.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +2 -3
- package/lib/chevre/service/offer/onEventChanged.d.ts +2 -0
- package/lib/chevre/service/offer/onEventChanged.js +1 -1
- package/lib/chevre/service/project.d.ts +3 -3
- package/lib/chevre/service/project.js +1 -1
- package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -0
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +2 -2
- package/lib/chevre/service/task/importEventsFromCOA.js +2 -0
- package/lib/chevre/service/task/onEventChanged.js +2 -0
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByEventSeries.js +1 -1
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByMovieTheater.js +1 -1
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByOfferCatalog.js +1 -1
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByProduct.js +1 -1
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesByRoom.js +1 -1
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +2 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +1 -1
- package/lib/chevre/service/task/onResourceDeleted.js +2 -2
- package/lib/chevre/service/task/syncResourcesFromCOA.js +2 -2
- package/package.json +2 -2
|
@@ -34,12 +34,12 @@ class EventSeriesRepo {
|
|
|
34
34
|
if (Array.isArray(idIn)) {
|
|
35
35
|
andConditions.push({ _id: { $in: idIn } });
|
|
36
36
|
}
|
|
37
|
-
/* istanbul ignore else */
|
|
38
|
-
if (Array.isArray(conditions.eventStatuses)) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
37
|
+
// /* istanbul ignore else */
|
|
38
|
+
// if (Array.isArray(conditions.eventStatuses)) {
|
|
39
|
+
// andConditions.push({
|
|
40
|
+
// eventStatus: { $in: conditions.eventStatuses }
|
|
41
|
+
// });
|
|
42
|
+
// }
|
|
43
43
|
/* istanbul ignore else */
|
|
44
44
|
if (conditions.inSessionFrom !== undefined) {
|
|
45
45
|
andConditions.push({
|
|
@@ -158,24 +158,24 @@ class EventSeriesRepo {
|
|
|
158
158
|
if (Array.isArray(videoFormatTypeOfIn)) {
|
|
159
159
|
andConditions.push({ 'subEvent.videoFormat': { $exists: true, $in: videoFormatTypeOfIn } });
|
|
160
160
|
}
|
|
161
|
-
const soundFormatTypeOfEq = conditions.soundFormat?.typeOf?.$eq;
|
|
162
|
-
if (typeof soundFormatTypeOfEq === 'string') {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
const soundFormatTypeOfIn = conditions.soundFormat?.typeOf?.$in;
|
|
171
|
-
if (Array.isArray(soundFormatTypeOfIn)) {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
161
|
+
// const soundFormatTypeOfEq = conditions.soundFormat?.typeOf?.$eq;
|
|
162
|
+
// if (typeof soundFormatTypeOfEq === 'string') {
|
|
163
|
+
// andConditions.push({
|
|
164
|
+
// 'soundFormat.typeOf': {
|
|
165
|
+
// $exists: true,
|
|
166
|
+
// $eq: soundFormatTypeOfEq
|
|
167
|
+
// }
|
|
168
|
+
// });
|
|
169
|
+
// }
|
|
170
|
+
// const soundFormatTypeOfIn = conditions.soundFormat?.typeOf?.$in;
|
|
171
|
+
// if (Array.isArray(soundFormatTypeOfIn)) {
|
|
172
|
+
// andConditions.push({
|
|
173
|
+
// 'soundFormat.typeOf': {
|
|
174
|
+
// $exists: true,
|
|
175
|
+
// $in: soundFormatTypeOfIn
|
|
176
|
+
// }
|
|
177
|
+
// });
|
|
178
|
+
// }
|
|
179
179
|
return andConditions;
|
|
180
180
|
}
|
|
181
181
|
/**
|
|
@@ -27,6 +27,7 @@ import type { AdminActionRepo } from './repo/adminAction';
|
|
|
27
27
|
import type { AdminAssetTransactionRepo } from './repo/adminAssetTransaction';
|
|
28
28
|
import type { AdminCheckMovieTicketActionRepo } from './repo/adminCheckMovieTicketAction';
|
|
29
29
|
import type { AdminAsyncActionRepo } from './repo/adminAsyncAction';
|
|
30
|
+
import type { AdminEventRepo } from './repo/adminEvent';
|
|
30
31
|
import type { AdminPendingReservationRepo } from './repo/adminPendingReservation';
|
|
31
32
|
import type { AdminScheduledTaskRepo } from './repo/adminScheduledTask';
|
|
32
33
|
import type { AdminTaskRepo } from './repo/adminTask';
|
|
@@ -35,6 +36,7 @@ import type { AggregateActionRepo } from './repo/aggregateAction';
|
|
|
35
36
|
import type { AggregateCheckMovieTicketActionRepo } from './repo/aggregateCheckMovieTicketAction';
|
|
36
37
|
import type { AggregateUseActionRepo } from './repo/aggregateUseAction';
|
|
37
38
|
import type { AggregateAssetTransactionRepo } from './repo/aggregateAssetTransaction';
|
|
39
|
+
import type { AggregateEventRepo } from './repo/aggregateEvent';
|
|
38
40
|
import type { AggregateOfferRepo } from './repo/aggregateOffer';
|
|
39
41
|
import type { AggregateOrderRepo } from './repo/aggregateOrder';
|
|
40
42
|
import type { AggregateReservationRepo } from './repo/aggregateReservation';
|
|
@@ -220,6 +222,10 @@ export type AdminAsyncAction = AdminAsyncActionRepo;
|
|
|
220
222
|
export declare namespace AdminAsyncAction {
|
|
221
223
|
function createInstance(...params: ConstructorParameters<typeof AdminAsyncActionRepo>): Promise<AdminAsyncActionRepo>;
|
|
222
224
|
}
|
|
225
|
+
export type AdminEvent = AdminEventRepo;
|
|
226
|
+
export declare namespace AdminEvent {
|
|
227
|
+
function createInstance(...params: ConstructorParameters<typeof AdminEventRepo>): Promise<AdminEventRepo>;
|
|
228
|
+
}
|
|
223
229
|
export type AdminPendingReservation = AdminPendingReservationRepo;
|
|
224
230
|
export declare namespace AdminPendingReservation {
|
|
225
231
|
function createInstance(...params: ConstructorParameters<typeof AdminPendingReservationRepo>): Promise<AdminPendingReservationRepo>;
|
|
@@ -264,6 +270,10 @@ export type AggregateAssetTransaction = AggregateAssetTransactionRepo;
|
|
|
264
270
|
export declare namespace AggregateAssetTransaction {
|
|
265
271
|
function createInstance(...params: ConstructorParameters<typeof AggregateAssetTransactionRepo>): Promise<AggregateAssetTransactionRepo>;
|
|
266
272
|
}
|
|
273
|
+
export type AggregateEvent = AggregateEventRepo;
|
|
274
|
+
export declare namespace AggregateEvent {
|
|
275
|
+
function createInstance(...params: ConstructorParameters<typeof AggregateEventRepo>): Promise<AggregateEventRepo>;
|
|
276
|
+
}
|
|
267
277
|
export type AggregateOffer = AggregateOfferRepo;
|
|
268
278
|
export declare namespace AggregateOffer {
|
|
269
279
|
function createInstance(...params: ConstructorParameters<typeof AggregateOfferRepo>): Promise<AggregateOfferRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.AsyncAction = exports.TaskDelayed = exports.Task = exports.ScheduledTask = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Person = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = void 0;
|
|
3
|
+
exports.MovieTicketType = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Authorization = exports.CategoryCode = exports.assetTransaction = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AggregateEvent = exports.AggregateAssetTransaction = exports.AggregateTransaction = exports.AggregateTask = exports.AggregateScheduledTask = exports.AggregateUseAction = exports.AggregateCheckMovieTicketAction = exports.AggregateAction = exports.AdminTransaction = exports.AdminTask = exports.AdminScheduledTask = exports.AdminPendingReservation = exports.AdminEvent = exports.AdminAsyncAction = exports.AdminAssetTransaction = exports.AdminCheckMovieTicketAction = exports.AdminAction = exports.AdminAcceptedOffer = exports.AdminAccountingReport = exports.AdditionalProperty = exports.action = exports.AccountTitle = exports.AccountingReport = exports.AcceptedOffer = void 0;
|
|
4
|
+
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.AsyncAction = exports.TaskDelayed = exports.Task = exports.ScheduledTask = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Person = exports.PendingReservation = exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -280,6 +280,17 @@ var AdminAsyncAction;
|
|
|
280
280
|
}
|
|
281
281
|
AdminAsyncAction.createInstance = createInstance;
|
|
282
282
|
})(AdminAsyncAction || (exports.AdminAsyncAction = AdminAsyncAction = {}));
|
|
283
|
+
var AdminEvent;
|
|
284
|
+
(function (AdminEvent) {
|
|
285
|
+
let repo;
|
|
286
|
+
async function createInstance(...params) {
|
|
287
|
+
if (repo === undefined) {
|
|
288
|
+
repo = (await import('./repo/adminEvent.js')).AdminEventRepo;
|
|
289
|
+
}
|
|
290
|
+
return new repo(...params);
|
|
291
|
+
}
|
|
292
|
+
AdminEvent.createInstance = createInstance;
|
|
293
|
+
})(AdminEvent || (exports.AdminEvent = AdminEvent = {}));
|
|
283
294
|
var AdminPendingReservation;
|
|
284
295
|
(function (AdminPendingReservation) {
|
|
285
296
|
let repo;
|
|
@@ -401,6 +412,17 @@ var AggregateAssetTransaction;
|
|
|
401
412
|
}
|
|
402
413
|
AggregateAssetTransaction.createInstance = createInstance;
|
|
403
414
|
})(AggregateAssetTransaction || (exports.AggregateAssetTransaction = AggregateAssetTransaction = {}));
|
|
415
|
+
var AggregateEvent;
|
|
416
|
+
(function (AggregateEvent) {
|
|
417
|
+
let repo;
|
|
418
|
+
async function createInstance(...params) {
|
|
419
|
+
if (repo === undefined) {
|
|
420
|
+
repo = (await import('./repo/aggregateEvent.js')).AggregateEventRepo;
|
|
421
|
+
}
|
|
422
|
+
return new repo(...params);
|
|
423
|
+
}
|
|
424
|
+
AggregateEvent.createInstance = createInstance;
|
|
425
|
+
})(AggregateEvent || (exports.AggregateEvent = AggregateEvent = {}));
|
|
404
426
|
var AggregateOffer;
|
|
405
427
|
(function (AggregateOffer) {
|
|
406
428
|
let repo;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AdminEventRepo } from '../../../repo/adminEvent';
|
|
1
2
|
import { EventRepo } from '../../../repo/event';
|
|
2
3
|
import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
|
|
3
4
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
@@ -9,6 +10,7 @@ import type { ReservationRepo } from '../../../repo/reservation';
|
|
|
9
10
|
import type { StockHolderRepo } from '../../../repo/stockHolder';
|
|
10
11
|
import type { TaskRepo } from '../../../repo/task';
|
|
11
12
|
export interface IAggregateScreeningEventRepos {
|
|
13
|
+
adminEvent: AdminEventRepo;
|
|
12
14
|
event: EventRepo;
|
|
13
15
|
stockHolder: StockHolderRepo;
|
|
14
16
|
offer: OfferRepo;
|
|
@@ -122,7 +122,7 @@ function aggregateByEvent(params, options) {
|
|
|
122
122
|
};
|
|
123
123
|
debug('update:', update);
|
|
124
124
|
// 保管
|
|
125
|
-
await repos.
|
|
125
|
+
await repos.adminEvent.updateAggregationById({ id: event.id }, update);
|
|
126
126
|
await onAggregated({ event }, options)({
|
|
127
127
|
task: repos.task
|
|
128
128
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* COAイベント集計サービス
|
|
3
3
|
*/
|
|
4
4
|
import type { COA } from '@motionpicture/coa-service';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AdminEventRepo } from '../../../repo/adminEvent';
|
|
6
6
|
import { factory } from '../../../factory';
|
|
7
7
|
/**
|
|
8
8
|
* イベント席数を更新する
|
|
@@ -16,6 +16,6 @@ export declare function importFromCOA(params: {
|
|
|
16
16
|
importFrom: Date;
|
|
17
17
|
importThrough: Date;
|
|
18
18
|
}): (repos: {
|
|
19
|
-
|
|
19
|
+
adminEvent: AdminEventRepo;
|
|
20
20
|
reserveService: COA.service.Reserve;
|
|
21
21
|
}) => Promise<void>;
|
|
@@ -61,7 +61,7 @@ function importFromCOA(params) {
|
|
|
61
61
|
}
|
|
62
62
|
debug(bulkWriteOps.length, 'ops writing...');
|
|
63
63
|
if (bulkWriteOps.length > 0) {
|
|
64
|
-
const res = await repos.
|
|
64
|
+
const res = await repos.adminEvent.bulkWrite(bulkWriteOps);
|
|
65
65
|
// const res = await repos.event.eventModel.bulkWrite(bulkWriteOps, { ordered: false });
|
|
66
66
|
debug('bulkWrite res:', res);
|
|
67
67
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { AggregateActionRepo } from '../../repo/aggregateAction';
|
|
2
2
|
import type { AggregateCheckMovieTicketActionRepo } from '../../repo/aggregateCheckMovieTicketAction';
|
|
3
|
+
import type { AggregateEventRepo } from '../../repo/aggregateEvent';
|
|
3
4
|
import type { AggregateUseActionRepo } from '../../repo/aggregateUseAction';
|
|
4
5
|
import type { AggregateAssetTransactionRepo } from '../../repo/aggregateAssetTransaction';
|
|
5
6
|
import type { AggregateScheduledTaskRepo } from '../../repo/aggregateScheduledTask';
|
|
6
7
|
import type { AggregateTaskRepo } from '../../repo/aggregateTask';
|
|
7
8
|
import type { AggregateTransactionRepo } from '../../repo/aggregateTransaction';
|
|
8
9
|
import type { AggregationRepo } from '../../repo/aggregation';
|
|
9
|
-
import type { EventRepo } from '../../repo/event';
|
|
10
10
|
import type { OrderRepo } from '../../repo/order';
|
|
11
11
|
type AggregateDurationUnit = 'days' | 'hours';
|
|
12
12
|
interface IAggregateParams {
|
|
@@ -17,7 +17,7 @@ interface IAggregateParams {
|
|
|
17
17
|
}
|
|
18
18
|
declare function aggregateEvent(params: IAggregateParams): (repos: {
|
|
19
19
|
agregation: AggregationRepo;
|
|
20
|
-
|
|
20
|
+
aggregateEvent: AggregateEventRepo;
|
|
21
21
|
}) => Promise<{
|
|
22
22
|
aggregationCount: number;
|
|
23
23
|
aggregateDuration: string;
|
|
@@ -46,7 +46,7 @@ function aggregateEvent(params) {
|
|
|
46
46
|
.add(-i, params.aggregateDurationUnit)
|
|
47
47
|
.endOf(params.aggregateDurationUnit)
|
|
48
48
|
.toDate();
|
|
49
|
-
const aggregateResult = await repos.
|
|
49
|
+
const aggregateResult = await repos.aggregateEvent.aggregateEvent({
|
|
50
50
|
project: { id: { $ne: params.excludedProjectId } },
|
|
51
51
|
startFrom,
|
|
52
52
|
startThrough,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
2
|
import type { CategoryCodeRepo } from '../../repo/categoryCode';
|
|
3
3
|
import type { CreativeWorkRepo } from '../../repo/creativeWork';
|
|
4
|
-
import type {
|
|
4
|
+
import type { AdminEventRepo } from '../../repo/adminEvent';
|
|
5
5
|
import type { EventSeriesRepo } from '../../repo/eventSeries';
|
|
6
6
|
import { factory } from '../../factory';
|
|
7
7
|
type IMovieTheater = Pick<factory.place.movieTheater.IPlace, 'id' | 'typeOf' | 'branchCode' | 'name' | 'kanaName'>;
|
|
@@ -28,7 +28,7 @@ declare function saveScreeningEvents(params: {
|
|
|
28
28
|
}): (repos: {
|
|
29
29
|
categoryCode: CategoryCodeRepo;
|
|
30
30
|
creativeWork: CreativeWorkRepo;
|
|
31
|
-
|
|
31
|
+
adminEvent: AdminEventRepo;
|
|
32
32
|
eventSeries: EventSeriesRepo;
|
|
33
33
|
masterService: COA.service.Master;
|
|
34
34
|
}) => Promise<factory.event.screeningEvent.IEvent[]>;
|
|
@@ -31,7 +31,7 @@ function saveScreeningEvents(params, options) {
|
|
|
31
31
|
// no op
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
await repos.
|
|
34
|
+
await repos.adminEvent.saveManyEvents(saveParams);
|
|
35
35
|
debug(`${screeningEvents.length} screeningEvents stored.`);
|
|
36
36
|
return screeningEvents;
|
|
37
37
|
};
|
|
@@ -5,6 +5,7 @@ import type { COA } from '@motionpicture/coa-service';
|
|
|
5
5
|
import type { UpdateActionRepo } from '../repo/action/update';
|
|
6
6
|
import type { CategoryCodeRepo } from '../repo/categoryCode';
|
|
7
7
|
import type { CreativeWorkRepo } from '../repo/creativeWork';
|
|
8
|
+
import type { AdminEventRepo } from '../repo/adminEvent';
|
|
8
9
|
import type { EventRepo } from '../repo/event';
|
|
9
10
|
import type { EventSeriesRepo } from '../repo/eventSeries';
|
|
10
11
|
import type { MovieTheaterRepo } from '../repo/place/movieTheater';
|
|
@@ -22,6 +23,7 @@ declare function importFromCOA(params: IImportFromCOAParams): (repos: {
|
|
|
22
23
|
};
|
|
23
24
|
categoryCode: CategoryCodeRepo;
|
|
24
25
|
creativeWork: CreativeWorkRepo;
|
|
26
|
+
adminEvent: AdminEventRepo;
|
|
25
27
|
event: EventRepo;
|
|
26
28
|
eventSeries: EventSeriesRepo;
|
|
27
29
|
movieTheater: MovieTheaterRepo;
|
|
@@ -165,7 +165,7 @@ function cancelDeletedEvents(params) {
|
|
|
165
165
|
debug(`cancelling ${cancelledIds.length} events...`);
|
|
166
166
|
for (const cancelledId of cancelledIds) {
|
|
167
167
|
try {
|
|
168
|
-
await repos.
|
|
168
|
+
await repos.adminEvent.cancelEvent({
|
|
169
169
|
id: cancelledId,
|
|
170
170
|
project: { id: params.project.id }
|
|
171
171
|
});
|
|
@@ -8,14 +8,13 @@ const authorize_1 = require("./acceptOffer/authorize");
|
|
|
8
8
|
const factory_2 = require("./acceptOffer/factory");
|
|
9
9
|
function findCOAInfo(params) {
|
|
10
10
|
return async (repos) => {
|
|
11
|
-
const
|
|
11
|
+
const event = (await repos.event.projectEventFields({
|
|
12
12
|
project: { id: { $eq: params.project.id } },
|
|
13
13
|
limit: 1,
|
|
14
14
|
page: 1,
|
|
15
15
|
typeOf: factory_1.factory.eventType.ScreeningEvent,
|
|
16
16
|
id: { $eq: params.id }
|
|
17
|
-
};
|
|
18
|
-
const event = (await repos.event.projectEventFields(searchConditions, ['coaInfo'])).shift();
|
|
17
|
+
}, ['coaInfo'])).shift();
|
|
19
18
|
if (event === undefined) {
|
|
20
19
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.eventType.ScreeningEvent);
|
|
21
20
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AdminEventRepo } from '../../repo/adminEvent';
|
|
1
2
|
import type { EventRepo } from '../../repo/event';
|
|
2
3
|
import type { EventSeriesRepo } from '../../repo/eventSeries';
|
|
3
4
|
import type { PendingReservationRepo } from '../../repo/pendingReservation';
|
|
@@ -9,6 +10,7 @@ import { factory } from '../../factory';
|
|
|
9
10
|
* イベント変更時処理
|
|
10
11
|
*/
|
|
11
12
|
declare function onEventChanged(params: factory.task.onEventChanged.IData): (repos: {
|
|
13
|
+
adminEvent: AdminEventRepo;
|
|
12
14
|
event: EventRepo;
|
|
13
15
|
eventSeries: EventSeriesRepo;
|
|
14
16
|
pendingReservation?: PendingReservationRepo;
|
|
@@ -83,7 +83,7 @@ function syncEventSeries2screeningEvents(params) {
|
|
|
83
83
|
if (superEventFromDB === undefined) {
|
|
84
84
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.eventType.ScreeningEventSeries);
|
|
85
85
|
}
|
|
86
|
-
await repos.
|
|
86
|
+
await repos.adminEvent.syncScreeningEventSeries2screeningEvents({
|
|
87
87
|
project: { id: params.project.id },
|
|
88
88
|
// superEvent: { id: eventSeriesId },
|
|
89
89
|
superEventFromDB,
|
|
@@ -5,7 +5,7 @@ import type { AccountTitleRepo } from '../repo/accountTitle';
|
|
|
5
5
|
import type { AssetTransactionRepo } from '../repo/assetTransaction';
|
|
6
6
|
import type { CategoryCodeRepo } from '../repo/categoryCode';
|
|
7
7
|
import type { CreativeWorkRepo } from '../repo/creativeWork';
|
|
8
|
-
import type {
|
|
8
|
+
import type { AdminEventRepo } from '../repo/adminEvent';
|
|
9
9
|
import type { MemberRepo } from '../repo/member';
|
|
10
10
|
import type { MovieTicketTypeRepo } from '../repo/movieTicketType';
|
|
11
11
|
import type { OfferRepo } from '../repo/offer/unitPriceInCatalog';
|
|
@@ -23,7 +23,7 @@ export declare function deleteProject(params: {
|
|
|
23
23
|
accountTitle: AccountTitleRepo;
|
|
24
24
|
categoryCode: CategoryCodeRepo;
|
|
25
25
|
creativeWork: CreativeWorkRepo;
|
|
26
|
-
|
|
26
|
+
adminEvent: AdminEventRepo;
|
|
27
27
|
member: MemberRepo;
|
|
28
28
|
movieTicketType: MovieTicketTypeRepo;
|
|
29
29
|
offer: OfferRepo;
|
|
@@ -44,7 +44,7 @@ export declare function cleanUpDatabaseByProject(params: {
|
|
|
44
44
|
assetTransaction: AssetTransactionRepo;
|
|
45
45
|
categoryCode: CategoryCodeRepo;
|
|
46
46
|
creativeWork: CreativeWorkRepo;
|
|
47
|
-
|
|
47
|
+
adminEvent: AdminEventRepo;
|
|
48
48
|
movieTicketType: MovieTicketTypeRepo;
|
|
49
49
|
offer: OfferRepo;
|
|
50
50
|
offerCatalog: OfferCatalogRepo;
|
|
@@ -17,7 +17,7 @@ function cleanUpDatabaseByProject(params) {
|
|
|
17
17
|
await repos.categoryCode.deleteCategoryCodesByProject({ project: { id: params.id } });
|
|
18
18
|
await repos.movieTicketType.deleteMovieTicketTypesByProject({ project: { id: params.id } });
|
|
19
19
|
await repos.creativeWork.deleteByProject({ project: { id: params.id } });
|
|
20
|
-
await repos.
|
|
20
|
+
await repos.adminEvent.deleteByProject({ project: { id: params.id } });
|
|
21
21
|
await repos.offerCatalog.deleteByProject({ project: { id: params.id } });
|
|
22
22
|
await repos.screeningRoom.deleteScreeningRoomsByProject({ project: { id: params.id } });
|
|
23
23
|
await repos.movieTheater.deleteMovieTheatersByProject({ project: { id: params.id } });
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.call = call;
|
|
37
37
|
const factory_1 = require("../../factory");
|
|
38
|
+
const adminEvent_1 = require("../../repo/adminEvent");
|
|
38
39
|
const event_1 = require("../../repo/event");
|
|
39
40
|
const unitPriceInCatalog_1 = require("../../repo/offer/unitPriceInCatalog");
|
|
40
41
|
const offerCatalog_1 = require("../../repo/offerCatalog");
|
|
@@ -56,6 +57,7 @@ function call(params) {
|
|
|
56
57
|
throw new factory_1.factory.errors.Argument('settings', 'redisClient required');
|
|
57
58
|
}
|
|
58
59
|
await AggregationService.event.aggregateScreeningEvent(data)({
|
|
60
|
+
adminEvent: new adminEvent_1.AdminEventRepo(connection),
|
|
59
61
|
event: new event_1.EventRepo(connection),
|
|
60
62
|
stockHolder: new stockHolder_1.StockHolderRepo({ connection }),
|
|
61
63
|
offer: new unitPriceInCatalog_1.OfferRepo(connection),
|
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.call = call;
|
|
37
37
|
const coa_service_1 = require("@motionpicture/coa-service");
|
|
38
|
-
const
|
|
38
|
+
const adminEvent_1 = require("../../repo/adminEvent");
|
|
39
39
|
const reserveInterface_1 = require("../../repo/reserveInterface");
|
|
40
40
|
const integration_1 = require("../../repo/setting/integration");
|
|
41
41
|
const factory_1 = require("../../factory");
|
|
@@ -64,7 +64,7 @@ function call(params) {
|
|
|
64
64
|
...params.data,
|
|
65
65
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project }
|
|
66
66
|
})({
|
|
67
|
-
|
|
67
|
+
adminEvent: new adminEvent_1.AdminEventRepo(connection),
|
|
68
68
|
reserveService
|
|
69
69
|
});
|
|
70
70
|
};
|
|
@@ -38,6 +38,7 @@ const coa_service_1 = require("@motionpicture/coa-service");
|
|
|
38
38
|
const update_1 = require("../../repo/action/update");
|
|
39
39
|
const categoryCode_1 = require("../../repo/categoryCode");
|
|
40
40
|
const creativeWork_1 = require("../../repo/creativeWork");
|
|
41
|
+
const adminEvent_1 = require("../../repo/adminEvent");
|
|
41
42
|
const event_1 = require("../../repo/event");
|
|
42
43
|
const eventSeries_1 = require("../../repo/eventSeries");
|
|
43
44
|
const movieTheater_1 = require("../../repo/place/movieTheater");
|
|
@@ -76,6 +77,7 @@ function call(params) {
|
|
|
76
77
|
},
|
|
77
78
|
categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
|
|
78
79
|
creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
|
|
80
|
+
adminEvent: new adminEvent_1.AdminEventRepo(connection),
|
|
79
81
|
event: new event_1.EventRepo(connection),
|
|
80
82
|
eventSeries: new eventSeries_1.EventSeriesRepo(connection),
|
|
81
83
|
movieTheater: new movieTheater_1.MovieTheaterRepo(connection),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.call = call;
|
|
4
|
+
const adminEvent_1 = require("../../repo/adminEvent");
|
|
4
5
|
const event_1 = require("../../repo/event");
|
|
5
6
|
const eventSeries_1 = require("../../repo/eventSeries");
|
|
6
7
|
const pendingReservation_1 = require("../../repo/pendingReservation");
|
|
@@ -15,6 +16,7 @@ function call(params) {
|
|
|
15
16
|
return async ({ connection }) => {
|
|
16
17
|
const { data } = params;
|
|
17
18
|
await (0, onEventChanged_1.onEventChanged)(data)({
|
|
19
|
+
adminEvent: new adminEvent_1.AdminEventRepo(connection),
|
|
18
20
|
event: new event_1.EventRepo(connection),
|
|
19
21
|
eventSeries: new eventSeries_1.EventSeriesRepo(connection),
|
|
20
22
|
pendingReservation: new pendingReservation_1.PendingReservationRepo(connection),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UpdateActionRepo } from '../../../repo/action/update';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AdminEventRepo } from '../../../repo/adminEvent';
|
|
3
3
|
export declare function deleteResourcesByEventSeries(params: {
|
|
4
4
|
project: {
|
|
5
5
|
id: string;
|
|
@@ -9,5 +9,5 @@ export declare function deleteResourcesByEventSeries(params: {
|
|
|
9
9
|
actions: {
|
|
10
10
|
update: UpdateActionRepo;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
adminEvent: AdminEventRepo;
|
|
13
13
|
}) => Promise<void>;
|
|
@@ -18,7 +18,7 @@ function deleteResourcesByEventSeries(params) {
|
|
|
18
18
|
const action = await repos.actions.update.startUpdateAction(deleteActionAttributes);
|
|
19
19
|
try {
|
|
20
20
|
// イベント削除
|
|
21
|
-
const deleteScreeningEventResult = await repos.
|
|
21
|
+
const deleteScreeningEventResult = await repos.adminEvent.deleteManyBySuperEventId({
|
|
22
22
|
project: { id: params.project.id },
|
|
23
23
|
superEvent: { id: eventSeriesId }
|
|
24
24
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UpdateActionRepo } from '../../../repo/action/update';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AdminEventRepo } from '../../../repo/adminEvent';
|
|
3
3
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
4
4
|
import type { ScreeningRoomRepo } from '../../../repo/place/screeningRoom';
|
|
5
5
|
export declare function deleteResourcesByMovieTheater(params: {
|
|
@@ -11,7 +11,7 @@ export declare function deleteResourcesByMovieTheater(params: {
|
|
|
11
11
|
actions: {
|
|
12
12
|
update: UpdateActionRepo;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
adminEvent: AdminEventRepo;
|
|
15
15
|
eventSeries: EventSeriesRepo;
|
|
16
16
|
screeningRoom: ScreeningRoomRepo;
|
|
17
17
|
}) => Promise<void>;
|
|
@@ -18,7 +18,7 @@ function deleteResourcesByMovieTheater(params) {
|
|
|
18
18
|
const action = await repos.actions.update.startUpdateAction(deleteActionAttributes);
|
|
19
19
|
try {
|
|
20
20
|
// イベント削除
|
|
21
|
-
const deleteScreeningEventResult = await repos.
|
|
21
|
+
const deleteScreeningEventResult = await repos.adminEvent.deleteManyBySuperEventLocationId({
|
|
22
22
|
project: { id: params.project.id },
|
|
23
23
|
superEvent: { location: { id: placeId } }
|
|
24
24
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { UpdateActionRepo } from '../../../repo/action/update';
|
|
2
2
|
import type { AggregateOfferRepo } from '../../../repo/aggregateOffer';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AdminEventRepo } from '../../../repo/adminEvent';
|
|
4
4
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
5
5
|
import type { ProductRepo } from '../../../repo/product';
|
|
6
6
|
export declare function deleteResourcesByOfferCatalog(params: {
|
|
@@ -13,7 +13,7 @@ export declare function deleteResourcesByOfferCatalog(params: {
|
|
|
13
13
|
update: UpdateActionRepo;
|
|
14
14
|
};
|
|
15
15
|
aggregateOffer: AggregateOfferRepo;
|
|
16
|
-
|
|
16
|
+
adminEvent: AdminEventRepo;
|
|
17
17
|
offerCatalog: OfferCatalogRepo;
|
|
18
18
|
product: ProductRepo;
|
|
19
19
|
}) => Promise<void>;
|
|
@@ -29,7 +29,7 @@ function deleteResourcesByOfferCatalog(params) {
|
|
|
29
29
|
if (productsWithCatalog.length > 0) {
|
|
30
30
|
const deletingProductIds = productsWithCatalog.map((product) => product.id);
|
|
31
31
|
// 興行を設定されたイベント削除
|
|
32
|
-
deleteEventResult = await repos.
|
|
32
|
+
deleteEventResult = await repos.adminEvent.deleteManyEventsByItemOfferedId({
|
|
33
33
|
project: { id: params.project.id },
|
|
34
34
|
offers: { itemOffered: { id: { $in: deletingProductIds } } }
|
|
35
35
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { factory } from '../../../factory';
|
|
2
2
|
import type { UpdateActionRepo } from '../../../repo/action/update';
|
|
3
3
|
import type { AggregateOfferRepo } from '../../../repo/aggregateOffer';
|
|
4
|
-
import type {
|
|
4
|
+
import type { AdminEventRepo } from '../../../repo/adminEvent';
|
|
5
5
|
import type { NoteRepo } from '../../../repo/note';
|
|
6
6
|
import type { ProductRepo } from '../../../repo/product';
|
|
7
7
|
export declare function deleteResourcesByProduct(params: {
|
|
@@ -15,7 +15,7 @@ export declare function deleteResourcesByProduct(params: {
|
|
|
15
15
|
update: UpdateActionRepo;
|
|
16
16
|
};
|
|
17
17
|
aggregateOffer: AggregateOfferRepo;
|
|
18
|
-
|
|
18
|
+
adminEvent: AdminEventRepo;
|
|
19
19
|
note: NoteRepo;
|
|
20
20
|
product: ProductRepo;
|
|
21
21
|
}) => Promise<void>;
|
|
@@ -18,7 +18,7 @@ function deleteResourcesByProduct(params) {
|
|
|
18
18
|
const action = await repos.actions.update.startUpdateAction(deleteActionAttributes);
|
|
19
19
|
try {
|
|
20
20
|
// 興行を設定されたイベント削除
|
|
21
|
-
const deleteEventResult = await repos.
|
|
21
|
+
const deleteEventResult = await repos.adminEvent.deleteManyEventsByItemOfferedId({
|
|
22
22
|
project: { id: params.project.id },
|
|
23
23
|
offers: { itemOffered: { id: { $in: [productId] } } }
|
|
24
24
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UpdateActionRepo } from '../../../repo/action/update';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AdminEventRepo } from '../../../repo/adminEvent';
|
|
3
3
|
export declare function deleteResourcesByRoom(params: {
|
|
4
4
|
project: {
|
|
5
5
|
id: string;
|
|
@@ -18,5 +18,5 @@ export declare function deleteResourcesByRoom(params: {
|
|
|
18
18
|
actions: {
|
|
19
19
|
update: UpdateActionRepo;
|
|
20
20
|
};
|
|
21
|
-
|
|
21
|
+
adminEvent: AdminEventRepo;
|
|
22
22
|
}) => Promise<void>;
|
|
@@ -19,7 +19,7 @@ function deleteResourcesByRoom(params) {
|
|
|
19
19
|
const action = await repos.actions.update.startUpdateAction(deleteActionAttributes);
|
|
20
20
|
try {
|
|
21
21
|
// イベント削除
|
|
22
|
-
const deleteScreeningEventResult = await repos.
|
|
22
|
+
const deleteScreeningEventResult = await repos.adminEvent.deleteManyEventsByScreeningRoom({
|
|
23
23
|
project: { id: params.project.id },
|
|
24
24
|
location: {
|
|
25
25
|
branchCode: firstBranchCode,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UpdateActionRepo } from '../../../repo/action/update';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AdminEventRepo } from '../../../repo/adminEvent';
|
|
3
3
|
import type { EventOfferRepo } from '../../../repo/eventOffer';
|
|
4
4
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
5
5
|
import type { MemberRepo } from '../../../repo/member';
|
|
@@ -15,7 +15,7 @@ export declare function deleteResourcesBySeller(params: {
|
|
|
15
15
|
actions: {
|
|
16
16
|
update: UpdateActionRepo;
|
|
17
17
|
};
|
|
18
|
-
|
|
18
|
+
adminEvent: AdminEventRepo;
|
|
19
19
|
eventOffer: EventOfferRepo;
|
|
20
20
|
eventSeries: EventSeriesRepo;
|
|
21
21
|
member: MemberRepo;
|
|
@@ -38,7 +38,7 @@ function deleteResourcesBySeller(params) {
|
|
|
38
38
|
seller: { id: sellerId }
|
|
39
39
|
});
|
|
40
40
|
// イベント削除
|
|
41
|
-
const deleteEventResult = await repos.
|
|
41
|
+
const deleteEventResult = await repos.adminEvent.deleteManyEventByOrganizerId({
|
|
42
42
|
project: { id: params.project.id },
|
|
43
43
|
organizer: { id: sellerId }
|
|
44
44
|
});
|
|
@@ -5,7 +5,7 @@ const factory_1 = require("../../factory");
|
|
|
5
5
|
const update_1 = require("../../repo/action/update");
|
|
6
6
|
const aggregateOffer_1 = require("../../repo/aggregateOffer");
|
|
7
7
|
const categoryCode_1 = require("../../repo/categoryCode");
|
|
8
|
-
const
|
|
8
|
+
const adminEvent_1 = require("../../repo/adminEvent");
|
|
9
9
|
const eventOffer_1 = require("../../repo/eventOffer");
|
|
10
10
|
const eventSeries_1 = require("../../repo/eventSeries");
|
|
11
11
|
const member_1 = require("../../repo/member");
|
|
@@ -39,7 +39,7 @@ function call(params) {
|
|
|
39
39
|
},
|
|
40
40
|
aggregateOffer: new aggregateOffer_1.AggregateOfferRepo(connection),
|
|
41
41
|
categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
|
|
42
|
-
|
|
42
|
+
adminEvent: new adminEvent_1.AdminEventRepo(connection),
|
|
43
43
|
eventOffer: new eventOffer_1.EventOfferRepo(connection),
|
|
44
44
|
eventSeries: new eventSeries_1.EventSeriesRepo(connection),
|
|
45
45
|
hasPOS: new hasPOS_1.HasPOSRepo(connection, { id: '' }), // 先の処理で明示的に指定される
|