@chevre/domain 21.27.0-alpha.9 → 21.27.0
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/{aggregateEventReservation.ts → aggregation/aggregateEventReservation.ts} +2 -3
- package/example/src/chevre/aggregation/aggregateOffersOnEvent.ts +82 -0
- package/example/src/chevre/{aggregateAllEvents.ts → aggregation/createAggregateEventTasks.ts} +26 -13
- package/example/src/chevre/aggregation/searchAggregateReservations.ts +33 -0
- package/example/src/chevre/searchEvents.ts +4 -4
- package/example/src/chevre/transaction/processPlaceOrder.ts +1 -2
- package/example/src/chevre/unsetUnnecessaryFields.ts +4 -4
- package/lib/chevre/credentials.d.ts +7 -0
- package/lib/chevre/credentials.js +10 -6
- package/lib/chevre/repo/action.d.ts +2 -2
- package/lib/chevre/repo/action.js +64 -49
- package/lib/chevre/repo/aggregateReservation.d.ts +68 -0
- package/lib/chevre/repo/aggregateReservation.js +135 -0
- package/lib/chevre/repo/event.d.ts +16 -14
- package/lib/chevre/repo/event.js +62 -20
- package/lib/chevre/repo/mongoose/schemas/action.js +18 -0
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +5 -0
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +84 -0
- package/lib/chevre/repo/mongoose/schemas/event.js +1 -1
- package/lib/chevre/repo/offer.d.ts +5 -0
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +15 -2
- package/lib/chevre/service/aggregation/event/aggregateOffers.d.ts +31 -0
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +290 -0
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.d.ts +3 -4
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +33 -238
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.d.ts +2 -0
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +19 -15
- package/lib/chevre/service/aggregation/event/findEventOffers.d.ts +2 -2
- package/lib/chevre/service/aggregation/event/findEventOffers.js +0 -2
- package/lib/chevre/service/aggregation/event.d.ts +2 -1
- package/lib/chevre/service/aggregation/event.js +3 -1
- package/lib/chevre/service/assetTransaction/pay.d.ts +4 -1
- package/lib/chevre/service/assetTransaction/pay.js +53 -27
- package/lib/chevre/service/assetTransaction/reserve.js +2 -1
- package/lib/chevre/service/event.js +16 -23
- package/lib/chevre/service/notification.js +0 -102
- package/lib/chevre/service/offer/onEventChanged.d.ts +25 -0
- package/lib/chevre/service/offer/onEventChanged.js +232 -0
- package/lib/chevre/service/offer.d.ts +0 -40
- package/lib/chevre/service/offer.js +1 -184
- package/lib/chevre/service/payment/any.d.ts +4 -2
- package/lib/chevre/service/payment/any.js +76 -48
- package/lib/chevre/service/payment/creditCard.js +14 -7
- package/lib/chevre/service/payment/movieTicket/checkByIdentifier.js +1 -9
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +2 -2
- package/lib/chevre/service/task/aggregateOffers.d.ts +7 -0
- package/lib/chevre/service/task/aggregateOffers.js +47 -0
- package/lib/chevre/service/task/aggregateScreeningEvent.js +0 -2
- package/lib/chevre/service/task/aggregateUseActionsOnEvent.js +2 -0
- package/lib/chevre/service/task/onEventChanged.js +2 -2
- package/lib/chevre/service/transaction/returnOrder/preStart.js +0 -18
- package/lib/chevre/settings.d.ts +1 -0
- package/lib/chevre/settings.js +2 -1
- package/package.json +3 -3
|
@@ -33,8 +33,8 @@ export interface IAttributes4patchUpdate<T extends factory.eventType> {
|
|
|
33
33
|
export interface IUpdateAggregateReservationParams {
|
|
34
34
|
$set: {
|
|
35
35
|
updatedAt: Date;
|
|
36
|
-
aggregateReservation: factory.event.
|
|
37
|
-
aggregateOffer?: factory.event.
|
|
36
|
+
aggregateReservation: factory.event.event.IAggregateReservation;
|
|
37
|
+
aggregateOffer?: Pick<factory.event.event.IAggregateOffer, 'aggregateDate' | 'offerCount' | 'typeOf'>;
|
|
38
38
|
maximumAttendeeCapacity?: number;
|
|
39
39
|
remainingAttendeeCapacity?: number;
|
|
40
40
|
checkInCount?: number;
|
|
@@ -46,15 +46,6 @@ export interface IUpdateAggregateReservationParams {
|
|
|
46
46
|
remainingAttendeeCapacity?: '';
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
export interface IUpdateAggregateUseActionsParams {
|
|
50
|
-
$set: {
|
|
51
|
-
updatedAt: Date;
|
|
52
|
-
aggregateEntranceGate: factory.event.screeningEvent.IAggregateEntranceGate;
|
|
53
|
-
};
|
|
54
|
-
$unset: {
|
|
55
|
-
noExistingAttributeName: 1;
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
49
|
export type ISearchConditions<T extends factory.eventType> = factory.event.ISearchConditions<T>;
|
|
59
50
|
interface IAggregationByStatus {
|
|
60
51
|
eventCount: number;
|
|
@@ -77,7 +68,7 @@ interface IStatus {
|
|
|
77
68
|
interface IAggregateEvent {
|
|
78
69
|
statuses: IStatus[];
|
|
79
70
|
}
|
|
80
|
-
type IKeyOfProjection<T extends factory.eventType> = keyof factory.event.IEvent<T> | '_id' | '__v' | 'createdAt' | 'updatedAt';
|
|
71
|
+
type IKeyOfProjection<T extends factory.eventType> = keyof factory.event.IEvent<T> | '_id' | '__v' | 'createdAt' | 'updatedAt' | 'aggregateEntranceGate' | 'aggregateOffer';
|
|
81
72
|
type IUnset<T extends factory.eventType> = {
|
|
82
73
|
[key in keyof factory.event.IEvent<T>]?: 1;
|
|
83
74
|
};
|
|
@@ -166,7 +157,7 @@ export declare class MongoRepository {
|
|
|
166
157
|
/**
|
|
167
158
|
* イベントを検索する
|
|
168
159
|
*/
|
|
169
|
-
search<T extends factory.eventType>(params: ISearchConditions<T>, inclusion: IKeyOfProjection<T>[], exclusion: IKeyOfProjection<T>[]): Promise<factory.event.IEvent<T>[]>;
|
|
160
|
+
search<T extends factory.eventType>(params: ISearchConditions<T>, inclusion: IKeyOfProjection<T>[], exclusion: IKeyOfProjection<T>[]): Promise<Omit<factory.event.IEvent<T>, 'aggregateEntranceGate' | 'aggregateOffer'>[]>;
|
|
170
161
|
searchIds<T extends factory.eventType>(params: ISearchConditions<T>): Promise<string[]>;
|
|
171
162
|
findMinimizedIndividualEventById<T extends factory.eventType.ScreeningEvent | factory.eventType.Event>(params: {
|
|
172
163
|
id: string;
|
|
@@ -281,6 +272,17 @@ export declare class MongoRepository {
|
|
|
281
272
|
$lte: Date;
|
|
282
273
|
};
|
|
283
274
|
}): Promise<import("mongodb").DeleteResult>;
|
|
275
|
+
deleteManyEndedByProject(params: {
|
|
276
|
+
typeOf: {
|
|
277
|
+
$in: factory.eventType[];
|
|
278
|
+
};
|
|
279
|
+
project: {
|
|
280
|
+
id: string;
|
|
281
|
+
};
|
|
282
|
+
endDate: {
|
|
283
|
+
$lte: Date;
|
|
284
|
+
};
|
|
285
|
+
}): Promise<import("mongodb").DeleteResult>;
|
|
284
286
|
deleteByProject(params: {
|
|
285
287
|
project: {
|
|
286
288
|
id: string;
|
|
@@ -291,7 +293,7 @@ export declare class MongoRepository {
|
|
|
291
293
|
*/
|
|
292
294
|
updateAggregationById<T extends factory.eventType>(params: {
|
|
293
295
|
id: string;
|
|
294
|
-
}, update: IUpdateAggregateReservationParams
|
|
296
|
+
}, update: IUpdateAggregateReservationParams): Promise<Pick<factory.event.IEvent<T>, 'id' | 'typeOf' | 'project'>>;
|
|
295
297
|
bulkWrite(bulkWriteOps: any[]): Promise<BulkWriteResult & {
|
|
296
298
|
mongoose?: {
|
|
297
299
|
validationErrors: import("mongoose").Error[];
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -812,9 +812,7 @@ class MongoRepository {
|
|
|
812
812
|
/**
|
|
813
813
|
* イベントを検索する
|
|
814
814
|
*/
|
|
815
|
-
search(params,
|
|
816
|
-
// projection?: IProjection<T>
|
|
817
|
-
inclusion, exclusion) {
|
|
815
|
+
search(params, inclusion, exclusion) {
|
|
818
816
|
var _a;
|
|
819
817
|
return __awaiter(this, void 0, void 0, function* () {
|
|
820
818
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
@@ -836,21 +834,7 @@ class MongoRepository {
|
|
|
836
834
|
});
|
|
837
835
|
}
|
|
838
836
|
}
|
|
839
|
-
|
|
840
|
-
// ? Object.values(projection)
|
|
841
|
-
// .some((value) => value !== 0)
|
|
842
|
-
// : false;
|
|
843
|
-
const query = this.eventModel.find({ $and: conditions }, projection
|
|
844
|
-
// :1対応(2023-01-25~)
|
|
845
|
-
// (positiveProjectionExists)
|
|
846
|
-
// ? projection
|
|
847
|
-
// : {
|
|
848
|
-
// ...projection,
|
|
849
|
-
// __v: 0,
|
|
850
|
-
// createdAt: 0,
|
|
851
|
-
// updatedAt: 0
|
|
852
|
-
// }
|
|
853
|
-
);
|
|
837
|
+
const query = this.eventModel.find({ $and: conditions }, projection);
|
|
854
838
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
855
839
|
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
856
840
|
query.limit(params.limit)
|
|
@@ -874,6 +858,45 @@ class MongoRepository {
|
|
|
874
858
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
875
859
|
});
|
|
876
860
|
}
|
|
861
|
+
// イベント集計検索廃止(2024-03-28~)
|
|
862
|
+
// public async searchAggregations(
|
|
863
|
+
// params: Pick<
|
|
864
|
+
// ISearchConditions<factory.eventType.ScreeningEvent>,
|
|
865
|
+
// 'page' | 'limit' | 'sort' | 'project' | 'typeOf' | 'id' | 'startFrom' | 'startThrough' | 'organizer'
|
|
866
|
+
// >,
|
|
867
|
+
// inclusion: ('aggregateEntranceGate' | 'aggregateOffer' | 'aggregateReservation')[]
|
|
868
|
+
// ): Promise<Pick<
|
|
869
|
+
// factory.event.IEvent<factory.eventType.ScreeningEvent>,
|
|
870
|
+
// 'aggregateEntranceGate' | 'aggregateOffer' | 'aggregateReservation' | 'id'
|
|
871
|
+
// >[]> {
|
|
872
|
+
// const conditions = MongoRepository.CREATE_MONGO_CONDITIONS<factory.eventType.ScreeningEvent>(params);
|
|
873
|
+
// let projection: IProjection<factory.eventType.ScreeningEvent> = {};
|
|
874
|
+
// if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
875
|
+
// inclusion.forEach((field) => {
|
|
876
|
+
// projection[field] = 1;
|
|
877
|
+
// });
|
|
878
|
+
// } else {
|
|
879
|
+
// projection = {
|
|
880
|
+
// aggregateEntranceGate: 1,
|
|
881
|
+
// aggregateOffer: 1,
|
|
882
|
+
// aggregateReservation: 1
|
|
883
|
+
// };
|
|
884
|
+
// }
|
|
885
|
+
// const query = this.eventModel.find({ $and: conditions }, projection);
|
|
886
|
+
// if (typeof params.limit === 'number' && params.limit > 0) {
|
|
887
|
+
// const page: number = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
888
|
+
// query.limit(params.limit)
|
|
889
|
+
// .skip(params.limit * (page - 1));
|
|
890
|
+
// }
|
|
891
|
+
// // tslint:disable-next-line:no-single-line-block-comment
|
|
892
|
+
// /* istanbul ignore else */
|
|
893
|
+
// if (params.sort?.startDate !== undefined) {
|
|
894
|
+
// query.sort({ startDate: params.sort.startDate });
|
|
895
|
+
// }
|
|
896
|
+
// return query.setOptions({ maxTimeMS: MONGO_MAX_TIME_MS })
|
|
897
|
+
// .exec()
|
|
898
|
+
// .then((docs) => docs.map((doc) => doc.toObject()));
|
|
899
|
+
// }
|
|
877
900
|
searchIds(params) {
|
|
878
901
|
return __awaiter(this, void 0, void 0, function* () {
|
|
879
902
|
const conditions = MongoRepository.CREATE_MONGO_CONDITIONS(params);
|
|
@@ -1038,6 +1061,16 @@ class MongoRepository {
|
|
|
1038
1061
|
.exec();
|
|
1039
1062
|
});
|
|
1040
1063
|
}
|
|
1064
|
+
deleteManyEndedByProject(params) {
|
|
1065
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1066
|
+
return this.eventModel.deleteMany({
|
|
1067
|
+
typeOf: { $in: params.typeOf.$in },
|
|
1068
|
+
'project.id': { $eq: params.project.id },
|
|
1069
|
+
endDate: { $lte: params.endDate.$lte }
|
|
1070
|
+
})
|
|
1071
|
+
.exec();
|
|
1072
|
+
});
|
|
1073
|
+
}
|
|
1041
1074
|
deleteByProject(params) {
|
|
1042
1075
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1043
1076
|
yield this.eventModel.deleteMany({
|
|
@@ -1049,9 +1082,18 @@ class MongoRepository {
|
|
|
1049
1082
|
/**
|
|
1050
1083
|
* 集計属性を更新する
|
|
1051
1084
|
*/
|
|
1052
|
-
updateAggregationById(params, update
|
|
1085
|
+
updateAggregationById(params, update
|
|
1086
|
+
// | IUpdateAggregateOfferParams // 廃止(2024-03-28)
|
|
1087
|
+
// | IUpdateAggregateUseActionsParams // 廃止(2024-03-28)
|
|
1088
|
+
) {
|
|
1053
1089
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1054
|
-
const doc = yield this.eventModel.findOneAndUpdate({ _id: params.id }, update, {
|
|
1090
|
+
const doc = yield this.eventModel.findOneAndUpdate({ _id: params.id }, update, {
|
|
1091
|
+
new: true,
|
|
1092
|
+
projection: {
|
|
1093
|
+
typeOf: 1,
|
|
1094
|
+
project: 1
|
|
1095
|
+
}
|
|
1096
|
+
})
|
|
1055
1097
|
.exec();
|
|
1056
1098
|
if (doc === null) {
|
|
1057
1099
|
throw new factory.errors.NotFound(this.eventModel.modelName);
|
|
@@ -387,6 +387,24 @@ const indexes = [
|
|
|
387
387
|
'instrument.transactionNumber': { $exists: true }
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
+
],
|
|
391
|
+
[
|
|
392
|
+
{ 'instrument.typeOf': 1, startDate: -1 },
|
|
393
|
+
{
|
|
394
|
+
name: 'searchByInstrumentTypeOf',
|
|
395
|
+
partialFilterExpression: {
|
|
396
|
+
'instrument.typeOf': { $exists: true }
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
],
|
|
400
|
+
[
|
|
401
|
+
{ 'object.transactionNumber': 1, startDate: -1 },
|
|
402
|
+
{
|
|
403
|
+
name: 'searchByObjectTransactionNumber',
|
|
404
|
+
partialFilterExpression: {
|
|
405
|
+
'object.transactionNumber': { $exists: true }
|
|
406
|
+
}
|
|
407
|
+
}
|
|
390
408
|
]
|
|
391
409
|
];
|
|
392
410
|
exports.indexes = indexes;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
|
|
2
|
+
declare const modelName = "AggregateReservation";
|
|
3
|
+
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
4
|
+
declare function createSchema(): Schema;
|
|
5
|
+
export { modelName, indexes, createSchema };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSchema = exports.indexes = exports.modelName = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const writeConcern_1 = require("../writeConcern");
|
|
6
|
+
const settings_1 = require("../../../settings");
|
|
7
|
+
const modelName = 'AggregateReservation';
|
|
8
|
+
exports.modelName = modelName;
|
|
9
|
+
const schemaDefinition = {
|
|
10
|
+
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
11
|
+
typeOf: { type: String, required: true },
|
|
12
|
+
reservationFor: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
13
|
+
aggregateEntranceGate: mongoose_1.SchemaTypes.Mixed,
|
|
14
|
+
aggregateOffer: mongoose_1.SchemaTypes.Mixed
|
|
15
|
+
};
|
|
16
|
+
const schemaOptions = {
|
|
17
|
+
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
18
|
+
autoCreate: false,
|
|
19
|
+
collection: 'aggregateReservations',
|
|
20
|
+
id: true,
|
|
21
|
+
read: settings_1.MONGO_READ_PREFERENCE,
|
|
22
|
+
writeConcern: writeConcern_1.writeConcern,
|
|
23
|
+
strict: true,
|
|
24
|
+
strictQuery: false,
|
|
25
|
+
timestamps: {
|
|
26
|
+
createdAt: 'createdAt',
|
|
27
|
+
updatedAt: 'updatedAt'
|
|
28
|
+
},
|
|
29
|
+
toJSON: {
|
|
30
|
+
getters: false,
|
|
31
|
+
virtuals: false,
|
|
32
|
+
minimize: false,
|
|
33
|
+
versionKey: false
|
|
34
|
+
},
|
|
35
|
+
toObject: {
|
|
36
|
+
getters: false,
|
|
37
|
+
virtuals: true,
|
|
38
|
+
minimize: false,
|
|
39
|
+
versionKey: false
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const indexes = [
|
|
43
|
+
[
|
|
44
|
+
{ createdAt: 1 },
|
|
45
|
+
{ name: 'searchByCreatedAt' }
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
{ updatedAt: 1 },
|
|
49
|
+
{ name: 'searchByUpdatedAt' }
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
{ 'reservationFor.startDate': 1 },
|
|
53
|
+
{ name: 'searchByReservationForStartDate' }
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
{ 'project.id': 1, 'reservationFor.startDate': 1 },
|
|
57
|
+
{ name: 'searchByProjectId' }
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
{ 'reservationFor.id': 1, 'reservationFor.startDate': 1 },
|
|
61
|
+
{ name: 'searchByReservationForId' }
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
{ 'reservationFor.typeOf': 1, 'reservationFor.startDate': 1 },
|
|
65
|
+
{ name: 'searchByReservationForTypeOf' }
|
|
66
|
+
]
|
|
67
|
+
];
|
|
68
|
+
exports.indexes = indexes;
|
|
69
|
+
/**
|
|
70
|
+
* 予約集計スキーマ
|
|
71
|
+
*/
|
|
72
|
+
let schema;
|
|
73
|
+
function createSchema() {
|
|
74
|
+
if (schema === undefined) {
|
|
75
|
+
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
76
|
+
if (settings_1.MONGO_AUTO_INDEX) {
|
|
77
|
+
indexes.forEach((indexParams) => {
|
|
78
|
+
schema === null || schema === void 0 ? void 0 : schema.index(...indexParams);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return schema;
|
|
83
|
+
}
|
|
84
|
+
exports.createSchema = createSchema;
|
|
@@ -46,7 +46,7 @@ const schemaDefinition = {
|
|
|
46
46
|
remainingAttendeeCapacity: { type: Number },
|
|
47
47
|
checkInCount: { type: Number },
|
|
48
48
|
attendeeCount: { type: Number },
|
|
49
|
-
aggregateEntranceGate:
|
|
49
|
+
// aggregateEntranceGate: SchemaTypes.Mixed, // 廃止(2024-03-29~)
|
|
50
50
|
aggregateReservation: mongoose_1.SchemaTypes.Mixed,
|
|
51
51
|
aggregateOffer: mongoose_1.SchemaTypes.Mixed,
|
|
52
52
|
coaInfo: mongoose_1.SchemaTypes.Mixed
|
|
@@ -35,6 +35,11 @@ export type IUnitPriceOfferFromAggregateOffer = factory.unitPriceOffer.IUnitPric
|
|
|
35
35
|
parentOffer?: {
|
|
36
36
|
id: string;
|
|
37
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* 単価オファーID
|
|
40
|
+
* 検索レスポンスに必ず含まれる
|
|
41
|
+
*/
|
|
42
|
+
id: string;
|
|
38
43
|
};
|
|
39
44
|
export interface IPriceSpecificationConditionsOnSearchWithSortIndex {
|
|
40
45
|
appliesToMovieTicket?: {
|
|
@@ -9,6 +9,7 @@ import type { MongoRepository as AccountTransactionRepo } from './repo/accountTr
|
|
|
9
9
|
import type { MongoRepository as ActionRepo } from './repo/action';
|
|
10
10
|
import type { MongoRepository as AdditionalPropertyRepo } from './repo/additionalProperty';
|
|
11
11
|
import type { MongoRepository as AggregateOfferRepo } from './repo/aggregateOffer';
|
|
12
|
+
import type { MongoRepository as AggregateReservationRepo } from './repo/aggregateReservation';
|
|
12
13
|
import type { MongoRepository as AggregationRepo } from './repo/aggregation';
|
|
13
14
|
import type { MongoRepository as AssetTransactionRepo } from './repo/assetTransaction';
|
|
14
15
|
import type { MongoRepository as CategoryCodeRepo } from './repo/categoryCode';
|
|
@@ -87,6 +88,10 @@ export type AggregateOffer = AggregateOfferRepo;
|
|
|
87
88
|
export declare namespace AggregateOffer {
|
|
88
89
|
function createInstance(...params: ConstructorParameters<typeof AggregateOfferRepo>): Promise<AggregateOfferRepo>;
|
|
89
90
|
}
|
|
91
|
+
export type AggregateReservation = AggregateReservationRepo;
|
|
92
|
+
export declare namespace AggregateReservation {
|
|
93
|
+
function createInstance(...params: ConstructorParameters<typeof AggregateReservationRepo>): Promise<AggregateReservationRepo>;
|
|
94
|
+
}
|
|
90
95
|
export type Aggregation = AggregationRepo;
|
|
91
96
|
export declare namespace Aggregation {
|
|
92
97
|
function createInstance(...params: ConstructorParameters<typeof AggregationRepo>): Promise<AggregationRepo>;
|
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.
|
|
13
|
-
exports.rateLimit = exports.Trip = exports.TransactionNumber = exports.Transaction = void 0;
|
|
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.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 = exports.Telemetry = void 0;
|
|
14
14
|
var AcceptedOffer;
|
|
15
15
|
(function (AcceptedOffer) {
|
|
16
16
|
let repo;
|
|
@@ -115,6 +115,19 @@ var AggregateOffer;
|
|
|
115
115
|
}
|
|
116
116
|
AggregateOffer.createInstance = createInstance;
|
|
117
117
|
})(AggregateOffer = exports.AggregateOffer || (exports.AggregateOffer = {}));
|
|
118
|
+
var AggregateReservation;
|
|
119
|
+
(function (AggregateReservation) {
|
|
120
|
+
let repo;
|
|
121
|
+
function createInstance(...params) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
if (repo === undefined) {
|
|
124
|
+
repo = (yield Promise.resolve().then(() => require('./repo/aggregateReservation'))).MongoRepository;
|
|
125
|
+
}
|
|
126
|
+
return new repo(...params);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
AggregateReservation.createInstance = createInstance;
|
|
130
|
+
})(AggregateReservation = exports.AggregateReservation || (exports.AggregateReservation = {}));
|
|
118
131
|
var Aggregation;
|
|
119
132
|
(function (Aggregation) {
|
|
120
133
|
let repo;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { MongoRepository as AggregateReservationRepo } from '../../../repo/aggregateReservation';
|
|
2
|
+
import { MongoRepository as EventRepo } from '../../../repo/event';
|
|
3
|
+
import type { MongoRepository as OfferRepo } from '../../../repo/offer';
|
|
4
|
+
import type { MongoRepository as OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
5
|
+
import { MongoRepository as PlaceRepo } from '../../../repo/place';
|
|
6
|
+
import type { MongoRepository as ProductRepo } from '../../../repo/product';
|
|
7
|
+
import { RedisRepository as OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
8
|
+
import type { MongoRepository as ReservationRepo } from '../../../repo/reservation';
|
|
9
|
+
import type { StockHolderRepository as StockHolderRepo } from '../../../repo/stockHolder';
|
|
10
|
+
import type { MongoRepository as TaskRepo } from '../../../repo/task';
|
|
11
|
+
import * as factory from '../../../factory';
|
|
12
|
+
type IAggregateOffersOperation<T> = (repos: {
|
|
13
|
+
aggregateReservation: AggregateReservationRepo;
|
|
14
|
+
event: EventRepo;
|
|
15
|
+
stockHolder: StockHolderRepo;
|
|
16
|
+
offer: OfferRepo;
|
|
17
|
+
offerCatalog: OfferCatalogRepo;
|
|
18
|
+
offerRateLimit: OfferRateLimitRepo;
|
|
19
|
+
place: PlaceRepo;
|
|
20
|
+
product: ProductRepo;
|
|
21
|
+
reservation: ReservationRepo;
|
|
22
|
+
task: TaskRepo;
|
|
23
|
+
}) => Promise<T>;
|
|
24
|
+
/**
|
|
25
|
+
* イベントに対するオファー集計
|
|
26
|
+
*/
|
|
27
|
+
declare function aggregateOffers(params: {
|
|
28
|
+
id: string;
|
|
29
|
+
typeOf: factory.eventType.ScreeningEvent | factory.eventType.Event;
|
|
30
|
+
}): IAggregateOffersOperation<void>;
|
|
31
|
+
export { aggregateOffers };
|