@chevre/domain 22.0.0 → 22.1.0-alpha.1
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/findAnyEventById.ts +24 -0
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/repo/event.d.ts +20 -1
- package/lib/chevre/repo/event.js +31 -1
- package/lib/chevre/repo/order.d.ts +4 -1
- package/lib/chevre/repo/order.js +49 -51
- package/lib/chevre/service/offer/onEventChanged.js +22 -7
- package/lib/chevre/service/order/returnOrder.js +1 -1
- package/lib/chevre/service/order/sendOrder.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -3
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as mongoose from 'mongoose';
|
|
3
|
+
import { chevre } from '../../../lib/index';
|
|
4
|
+
|
|
5
|
+
const PROJECT_ID = String(process.env.PROJECT_ID);
|
|
6
|
+
|
|
7
|
+
async function main() {
|
|
8
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
9
|
+
|
|
10
|
+
const eventRepo: chevre.repository.Event = await chevre.repository.Event.createInstance(mongoose.connection);
|
|
11
|
+
|
|
12
|
+
const event = await eventRepo.findAnyEventById<chevre.factory.eventType.ScreeningEvent>({
|
|
13
|
+
id: { $eq: 'blxonxv1m' },
|
|
14
|
+
project: { id: { $eq: PROJECT_ID } }
|
|
15
|
+
// organizer: { id: { $eq: 'xxx' } }
|
|
16
|
+
});
|
|
17
|
+
// tslint:disable-next-line:no-null-keyword
|
|
18
|
+
console.dir(event, { depth: null });
|
|
19
|
+
console.log('event found');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
main()
|
|
23
|
+
.then(console.log)
|
|
24
|
+
.catch(console.error);
|
|
@@ -6,5 +6,5 @@ export type IMinimizedIndividualEvent<T extends factory.eventType.ScreeningEvent
|
|
|
6
6
|
* 興行イベントのsuperEventを作成する
|
|
7
7
|
*/
|
|
8
8
|
export declare function minimizeSuperEvent(params: {
|
|
9
|
-
superEventFromDB:
|
|
9
|
+
superEventFromDB: Pick<factory.event.screeningEventSeries.IEvent, 'additionalProperty' | 'alternativeHeadline' | 'description' | 'dubLanguage' | 'endDate' | 'headline' | 'id' | 'kanaName' | 'location' | 'name' | 'soundFormat' | 'startDate' | 'subtitleLanguage' | 'typeOf' | 'videoFormat' | 'workPerformed'>;
|
|
10
10
|
}): factory.event.screeningEvent.ISuperEvent;
|
|
@@ -160,7 +160,26 @@ export declare class EventRepo {
|
|
|
160
160
|
/**
|
|
161
161
|
* イベントを検索する
|
|
162
162
|
*/
|
|
163
|
-
search<T extends factory.eventType>(params: ISearchConditions<T>, inclusion: IKeyOfProjection<T>[], exclusion
|
|
163
|
+
search<T extends factory.eventType>(params: ISearchConditions<T>, inclusion: IKeyOfProjection<T>[], exclusion?: IKeyOfProjection<T>[]): Promise<Omit<factory.event.IEvent<T>, 'aggregateEntranceGate' | 'aggregateOffer'>[]>;
|
|
164
|
+
/**
|
|
165
|
+
* IDのみで検索する
|
|
166
|
+
* projectionなし
|
|
167
|
+
*/
|
|
168
|
+
findAnyEventById<T extends factory.eventType>(params: {
|
|
169
|
+
id: {
|
|
170
|
+
$eq: string;
|
|
171
|
+
};
|
|
172
|
+
project: {
|
|
173
|
+
id: {
|
|
174
|
+
$eq: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
organizer?: {
|
|
178
|
+
id: {
|
|
179
|
+
$eq: string;
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
}): Promise<Omit<factory.event.IEvent<T>, 'aggregateEntranceGate' | 'aggregateOffer'>>;
|
|
164
183
|
searchIds<T extends factory.eventType>(params: ISearchConditions<T>): Promise<string[]>;
|
|
165
184
|
/**
|
|
166
185
|
* 特定イベントから指定フィールドのみ取得する
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -865,6 +865,32 @@ class EventRepo {
|
|
|
865
865
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
866
866
|
});
|
|
867
867
|
}
|
|
868
|
+
/**
|
|
869
|
+
* IDのみで検索する
|
|
870
|
+
* projectionなし
|
|
871
|
+
*/
|
|
872
|
+
findAnyEventById(params) {
|
|
873
|
+
var _a;
|
|
874
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
875
|
+
const doc = yield this.eventModel.findOne(Object.assign({ _id: { $eq: params.id.$eq }, 'project.id': { $eq: params.project.id.$eq } }, (typeof ((_a = params.organizer) === null || _a === void 0 ? void 0 : _a.id.$eq) === 'string')
|
|
876
|
+
? { 'organizer.id': { $exists: true, $eq: params.organizer.id.$eq } }
|
|
877
|
+
: undefined), {
|
|
878
|
+
__v: 0,
|
|
879
|
+
createdAt: 0,
|
|
880
|
+
updatedAt: 0,
|
|
881
|
+
// DefaultでaggregateEntranceGateを取得しない(2023-01-25~)
|
|
882
|
+
aggregateEntranceGate: 0,
|
|
883
|
+
// DefaultでaggregateOfferを取得しない(2023-01-24~)
|
|
884
|
+
aggregateOffer: 0
|
|
885
|
+
})
|
|
886
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
887
|
+
.exec();
|
|
888
|
+
if (doc === null) {
|
|
889
|
+
throw new factory.errors.NotFound('Event');
|
|
890
|
+
}
|
|
891
|
+
return doc.toObject();
|
|
892
|
+
});
|
|
893
|
+
}
|
|
868
894
|
searchIds(params) {
|
|
869
895
|
return __awaiter(this, void 0, void 0, function* () {
|
|
870
896
|
const conditions = EventRepo.CREATE_MONGO_CONDITIONS(params);
|
|
@@ -929,7 +955,11 @@ class EventRepo {
|
|
|
929
955
|
typeOf: factory.eventType.ScreeningEventSeries,
|
|
930
956
|
id: { $eq: params.superEvent.id },
|
|
931
957
|
project: { id: { $eq: params.project.id } }
|
|
932
|
-
}, [
|
|
958
|
+
}, [
|
|
959
|
+
'additionalProperty', 'alternativeHeadline', 'description', 'dubLanguage',
|
|
960
|
+
'endDate', 'headline', 'kanaName', 'location', 'name',
|
|
961
|
+
'soundFormat', 'startDate', 'subtitleLanguage', 'typeOf', 'videoFormat', 'workPerformed'
|
|
962
|
+
], []);
|
|
933
963
|
const superEventFromDB = superEvents.shift();
|
|
934
964
|
if (superEventFromDB === undefined) {
|
|
935
965
|
throw new factory.errors.NotFound(factory.eventType.ScreeningEventSeries);
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
import type { Connection, FilterQuery } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
27
|
type IOrderWithoutAcceptedOffers = factory.order.IOrder;
|
|
28
|
-
type IKeyOfProjection = keyof IOrderWithoutAcceptedOffers | '
|
|
28
|
+
type IKeyOfProjection = Extract<keyof IOrderWithoutAcceptedOffers, 'broker' | 'confirmationNumber' | 'customer' | 'dateReturned' | 'identifier' | 'name' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'previousOrderStatus' | 'price' | 'priceCurrency' | 'project' | 'returner' | 'seller' | 'typeOf' | 'url'> | 'paymentMethods.accountId' | 'paymentMethods.name' | 'paymentMethods.paymentMethod' | 'paymentMethods.paymentMethodId' | 'paymentMethods.totalPaymentDue' | 'paymentMethods.additionalProperty' | 'paymentMethods.issuedThrough';
|
|
29
29
|
export type IReturnedOrder = Pick<IOrderWithoutAcceptedOffers, 'project' | 'typeOf' | 'orderNumber' | 'dateReturned' | 'id' | 'customer' | 'returner' | 'seller' | 'price' | 'priceCurrency' | 'orderDate'> & {
|
|
30
30
|
id: string;
|
|
31
31
|
};
|
|
@@ -155,6 +155,9 @@ export declare class OrderRepo {
|
|
|
155
155
|
inclusion: {
|
|
156
156
|
[key in IKeyOfProjection]?: 1;
|
|
157
157
|
};
|
|
158
|
+
/**
|
|
159
|
+
* @deprecated use inclusion
|
|
160
|
+
*/
|
|
158
161
|
exclusion: {
|
|
159
162
|
[key in IKeyOfProjection]?: 0;
|
|
160
163
|
};
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -14,6 +14,15 @@ const factory = require("../factory");
|
|
|
14
14
|
const order_1 = require("./mongoose/schemas/order");
|
|
15
15
|
const errorHandler_1 = require("../errorHandler");
|
|
16
16
|
const settings_1 = require("../settings");
|
|
17
|
+
/**
|
|
18
|
+
* ドキュメント検索時に指定可能なprojectionフィールドを厳密に定義する
|
|
19
|
+
*/
|
|
20
|
+
const AVAILABLE_PROJECT_FIELDS = [
|
|
21
|
+
'broker', 'confirmationNumber', 'customer', 'dateReturned', 'identifier', 'name', 'orderDate', 'orderNumber', 'orderStatus', 'orderedItem',
|
|
22
|
+
'paymentMethods', 'previousOrderStatus', 'price', 'priceCurrency', 'project', 'returner', 'seller', 'typeOf', 'url',
|
|
23
|
+
'paymentMethods.accountId', 'paymentMethods.additionalProperty', 'paymentMethods.issuedThrough', 'paymentMethods.name', 'paymentMethods.paymentMethod',
|
|
24
|
+
'paymentMethods.paymentMethodId', 'paymentMethods.totalPaymentDue'
|
|
25
|
+
];
|
|
17
26
|
/**
|
|
18
27
|
* 注文リポジトリ
|
|
19
28
|
*/
|
|
@@ -31,22 +40,6 @@ class OrderRepo {
|
|
|
31
40
|
if (typeof projectIdEq === 'string') {
|
|
32
41
|
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
33
42
|
}
|
|
34
|
-
// const additionalPropertyAll = params.additionalProperty?.$all; // 廃止(2024-04-12~)
|
|
35
|
-
// if (Array.isArray(additionalPropertyAll)) {
|
|
36
|
-
// andConditions.push({ additionalProperty: { $exists: true, $all: additionalPropertyAll } });
|
|
37
|
-
// }
|
|
38
|
-
// const additionalPropertyIn = params.additionalProperty?.$in; // 廃止(2024-04-12~)
|
|
39
|
-
// if (Array.isArray(additionalPropertyIn)) {
|
|
40
|
-
// andConditions.push({ additionalProperty: { $exists: true, $in: additionalPropertyIn } });
|
|
41
|
-
// }
|
|
42
|
-
// const additionalPropertyNin = params.additionalProperty?.$nin; // 廃止(2024-04-12~)
|
|
43
|
-
// if (Array.isArray(additionalPropertyNin)) {
|
|
44
|
-
// andConditions.push({ additionalProperty: { $nin: additionalPropertyNin } });
|
|
45
|
-
// }
|
|
46
|
-
// const additionalPropertyElemMatch = params.additionalProperty?.$elemMatch; // 廃止(2024-04-12~)
|
|
47
|
-
// if (additionalPropertyElemMatch !== undefined && additionalPropertyElemMatch !== null) {
|
|
48
|
-
// andConditions.push({ additionalProperty: { $exists: true, $elemMatch: additionalPropertyElemMatch } });
|
|
49
|
-
// }
|
|
50
43
|
// tslint:disable-next-line:no-single-line-block-comment
|
|
51
44
|
/* istanbul ignore else */
|
|
52
45
|
if (params.identifier !== undefined) {
|
|
@@ -83,10 +76,6 @@ class OrderRepo {
|
|
|
83
76
|
if (Array.isArray(sellerIds)) {
|
|
84
77
|
andConditions.push({ 'seller.id': { $exists: true, $in: sellerIds } });
|
|
85
78
|
}
|
|
86
|
-
// 不要なので廃止(2023-09-11~)
|
|
87
|
-
// if (typeof params.seller?.typeOf === 'string') {
|
|
88
|
-
// andConditions.push({ 'seller.typeOf': { $exists: true, $eq: params.seller.typeOf } });
|
|
89
|
-
// }
|
|
90
79
|
const brokerIdEq = (_j = (_h = params.broker) === null || _h === void 0 ? void 0 : _h.id) === null || _j === void 0 ? void 0 : _j.$eq;
|
|
91
80
|
if (typeof brokerIdEq === 'string') {
|
|
92
81
|
andConditions.push({
|
|
@@ -768,26 +757,33 @@ class OrderRepo {
|
|
|
768
757
|
*/
|
|
769
758
|
returnOrder(params) {
|
|
770
759
|
return __awaiter(this, void 0, void 0, function* () {
|
|
760
|
+
const { dateReturned, returner, orderNumber, project } = params;
|
|
771
761
|
const doc = yield this.orderModel.findOneAndUpdate({
|
|
772
|
-
orderNumber: { $eq:
|
|
762
|
+
orderNumber: { $eq: orderNumber },
|
|
773
763
|
orderStatus: { $eq: factory.orderStatus.OrderDelivered },
|
|
774
|
-
'project.id': { $eq:
|
|
764
|
+
'project.id': { $eq: project.id },
|
|
775
765
|
typeOf: { $eq: factory.order.OrderType.Order }
|
|
776
766
|
}, {
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
767
|
+
$set: {
|
|
768
|
+
previousOrderStatus: factory.orderStatus.OrderDelivered,
|
|
769
|
+
orderStatus: factory.orderStatus.OrderReturned,
|
|
770
|
+
dateReturned,
|
|
771
|
+
returner
|
|
772
|
+
}
|
|
781
773
|
}, {
|
|
782
774
|
new: true,
|
|
783
775
|
projection: {
|
|
784
|
-
_id:
|
|
776
|
+
_id: 0,
|
|
777
|
+
id: { $toString: '$_id' },
|
|
778
|
+
// _id: 1,
|
|
779
|
+
project: 1, typeOf: 1, orderNumber: 1, dateReturned: 1,
|
|
785
780
|
customer: 1, returner: 1, seller: 1, price: 1, priceCurrency: 1, orderDate: 1 // optimize(2023-12-07~)
|
|
786
781
|
// __v: 0,
|
|
787
782
|
// createdAt: 0,
|
|
788
783
|
// updatedAt: 0
|
|
789
784
|
}
|
|
790
785
|
})
|
|
786
|
+
.lean() // lean(2024-07-30~)
|
|
791
787
|
.exec();
|
|
792
788
|
// NotFoundであれば状態確認
|
|
793
789
|
if (doc === null) {
|
|
@@ -795,7 +791,7 @@ class OrderRepo {
|
|
|
795
791
|
orderNumber: params.orderNumber,
|
|
796
792
|
project: { id: params.project.id },
|
|
797
793
|
inclusion: [
|
|
798
|
-
'project', 'typeOf', 'orderNumber', 'dateReturned',
|
|
794
|
+
'project', 'typeOf', 'orderNumber', 'dateReturned',
|
|
799
795
|
'customer', 'returner', 'seller', 'price', 'priceCurrency', 'orderDate'
|
|
800
796
|
]
|
|
801
797
|
});
|
|
@@ -811,7 +807,8 @@ class OrderRepo {
|
|
|
811
807
|
throw new factory.errors.Argument('orderNumber', `Order ${order.orderNumber} already changed -> ${order.orderStatus}`);
|
|
812
808
|
}
|
|
813
809
|
}
|
|
814
|
-
return doc
|
|
810
|
+
return doc;
|
|
811
|
+
// return doc.toObject();
|
|
815
812
|
});
|
|
816
813
|
}
|
|
817
814
|
/**
|
|
@@ -820,19 +817,21 @@ class OrderRepo {
|
|
|
820
817
|
updateChangeableAttributes(params) {
|
|
821
818
|
return __awaiter(this, void 0, void 0, function* () {
|
|
822
819
|
const updatedAt = new Date();
|
|
820
|
+
const { orderNumber, project, name } = params;
|
|
823
821
|
const doc = yield this.orderModel.findOneAndUpdate({
|
|
824
|
-
orderNumber: { $eq:
|
|
825
|
-
'project.id': { $eq:
|
|
822
|
+
orderNumber: { $eq: orderNumber },
|
|
823
|
+
'project.id': { $eq: project.id },
|
|
826
824
|
typeOf: { $eq: factory.order.OrderType.Order }
|
|
827
825
|
}, {
|
|
828
|
-
$set: Object.assign({}, (typeof
|
|
826
|
+
$set: Object.assign({}, (typeof name === 'string') ? { name } : undefined)
|
|
829
827
|
}, {
|
|
830
|
-
new:
|
|
828
|
+
new: false,
|
|
831
829
|
projection: {
|
|
832
830
|
_id: 1
|
|
833
831
|
// updatedAt: 1 // discontinue(2024-06-17~)
|
|
834
832
|
}
|
|
835
833
|
})
|
|
834
|
+
.lean() // lean(2024-07-30~)
|
|
836
835
|
.exec();
|
|
837
836
|
if (doc === null) {
|
|
838
837
|
throw new factory.errors.NotFound(this.orderModel.modelName);
|
|
@@ -864,6 +863,7 @@ class OrderRepo {
|
|
|
864
863
|
_id: 1
|
|
865
864
|
}
|
|
866
865
|
})
|
|
866
|
+
.lean() // lean(2024-07-30~)
|
|
867
867
|
.exec();
|
|
868
868
|
if (doc === null) {
|
|
869
869
|
throw new factory.errors.NotFound(this.orderModel.modelName);
|
|
@@ -879,7 +879,10 @@ class OrderRepo {
|
|
|
879
879
|
};
|
|
880
880
|
if (Array.isArray(params.inclusion) && params.inclusion.length > 0) {
|
|
881
881
|
params.inclusion.forEach((field) => {
|
|
882
|
-
if (String(field) !== 'acceptedOffers' && field !== '_id' && field !== 'id') {
|
|
882
|
+
// if (String(field) !== 'acceptedOffers' && field !== '_id' && field !== 'id') {
|
|
883
|
+
// projection[field] = 1;
|
|
884
|
+
// }
|
|
885
|
+
if (AVAILABLE_PROJECT_FIELDS.includes(field)) {
|
|
883
886
|
projection[field] = 1;
|
|
884
887
|
}
|
|
885
888
|
});
|
|
@@ -887,12 +890,6 @@ class OrderRepo {
|
|
|
887
890
|
else {
|
|
888
891
|
// discontinue(2024-07-25~)
|
|
889
892
|
throw new factory.errors.ArgumentNull('inclusion', 'inclusion must be specified');
|
|
890
|
-
// projection = {
|
|
891
|
-
// __v: 0,
|
|
892
|
-
// createdAt: 0,
|
|
893
|
-
// updatedAt: 0,
|
|
894
|
-
// acceptedOffers: 0
|
|
895
|
-
// };
|
|
896
893
|
}
|
|
897
894
|
const doc = yield this.orderModel.findOne({
|
|
898
895
|
_id: { $eq: params.id },
|
|
@@ -920,7 +917,10 @@ class OrderRepo {
|
|
|
920
917
|
};
|
|
921
918
|
if (Array.isArray(params.inclusion) && params.inclusion.length > 0) {
|
|
922
919
|
params.inclusion.forEach((field) => {
|
|
923
|
-
if (String(field) !== 'acceptedOffers' && field !== '_id' && field !== 'id') {
|
|
920
|
+
// if (String(field) !== 'acceptedOffers' && field !== '_id' && field !== 'id') {
|
|
921
|
+
// projection[field] = 1;
|
|
922
|
+
// }
|
|
923
|
+
if (AVAILABLE_PROJECT_FIELDS.includes(field)) {
|
|
924
924
|
projection[field] = 1;
|
|
925
925
|
}
|
|
926
926
|
});
|
|
@@ -928,12 +928,6 @@ class OrderRepo {
|
|
|
928
928
|
else {
|
|
929
929
|
// discontinue(2024-07-25~)
|
|
930
930
|
throw new factory.errors.ArgumentNull('inclusion', 'inclusion must be specified');
|
|
931
|
-
// projection = {
|
|
932
|
-
// __v: 0,
|
|
933
|
-
// createdAt: 0,
|
|
934
|
-
// updatedAt: 0,
|
|
935
|
-
// acceptedOffers: 0 // defaultで除外(2023-12-08~)
|
|
936
|
-
// };
|
|
937
931
|
}
|
|
938
932
|
const doc = yield this.orderModel.findOne({
|
|
939
933
|
orderNumber: { $eq: params.orderNumber },
|
|
@@ -1008,10 +1002,14 @@ class OrderRepo {
|
|
|
1008
1002
|
let projectStage = {};
|
|
1009
1003
|
const positiveProjectionFields = (inclusion !== undefined && inclusion !== null)
|
|
1010
1004
|
? Object.keys(inclusion)
|
|
1011
|
-
.filter((key) =>
|
|
1012
|
-
|
|
1013
|
-
&& key !== '
|
|
1014
|
-
&& key !== '
|
|
1005
|
+
.filter((key) => {
|
|
1006
|
+
// return inclusion[<IKeyOfProjection>key] === 1
|
|
1007
|
+
// && key !== 'acceptedOffers' // defaultで隠蔽(2023-12-06~)
|
|
1008
|
+
// && key !== '_id'
|
|
1009
|
+
// && key !== 'id';
|
|
1010
|
+
return inclusion[key] === 1
|
|
1011
|
+
&& AVAILABLE_PROJECT_FIELDS.includes(key);
|
|
1012
|
+
})
|
|
1015
1013
|
: [];
|
|
1016
1014
|
if (Array.isArray(positiveProjectionFields) && positiveProjectionFields.length > 0) {
|
|
1017
1015
|
useInclusionProjection = true;
|
|
@@ -132,9 +132,13 @@ function createInformTasks(params) {
|
|
|
132
132
|
const eventsFromDB = yield repos.event.search({
|
|
133
133
|
id: { $in: params.ids },
|
|
134
134
|
typeOf: params.typeOf
|
|
135
|
-
}, [
|
|
136
|
-
'
|
|
137
|
-
'
|
|
135
|
+
}, [
|
|
136
|
+
'project', 'organizer', 'typeOf', 'name', 'doorTime', 'endDate',
|
|
137
|
+
'eventStatus', 'location', 'startDate', 'additionalProperty'
|
|
138
|
+
], // inclusion(2024-07-30~)
|
|
139
|
+
[
|
|
140
|
+
// 'aggregateEntranceGate', 'aggregateOffer', 'aggregateReservation',
|
|
141
|
+
// 'remainingAttendeeCapacity', 'checkInCount', 'attendeeCount'
|
|
138
142
|
]);
|
|
139
143
|
// 最適化(2024-03-26~)
|
|
140
144
|
events4inform = eventsFromDB.map(({ project, organizer, typeOf, name, doorTime, endDate, eventStatus, location, startDate, id, additionalProperty }) => {
|
|
@@ -148,9 +152,13 @@ function createInformTasks(params) {
|
|
|
148
152
|
const screeningEvents4inform = yield repos.event.search({
|
|
149
153
|
id: { $in: params.ids },
|
|
150
154
|
typeOf: params.typeOf
|
|
151
|
-
}, [
|
|
152
|
-
'
|
|
153
|
-
'
|
|
155
|
+
}, [
|
|
156
|
+
'project', 'organizer', 'typeOf', 'name', 'doorTime', 'endDate',
|
|
157
|
+
'eventStatus', 'location', 'startDate', 'superEvent', 'offers', 'additionalProperty'
|
|
158
|
+
], // inclusion(2024-07-30~)
|
|
159
|
+
[
|
|
160
|
+
// 'aggregateEntranceGate', 'aggregateOffer', 'aggregateReservation',
|
|
161
|
+
// 'remainingAttendeeCapacity', 'checkInCount', 'attendeeCount'
|
|
154
162
|
]);
|
|
155
163
|
// 最適化(2024-03-22~)
|
|
156
164
|
events4inform = screeningEvents4inform.map(({ project, organizer, typeOf, name, doorTime, endDate, eventStatus, location, startDate, superEvent, offers, id, additionalProperty }) => {
|
|
@@ -182,7 +190,14 @@ function createInformTasks(params) {
|
|
|
182
190
|
const screeningEventSeries4inform = yield repos.event.search({
|
|
183
191
|
id: { $in: params.ids },
|
|
184
192
|
typeOf: params.typeOf
|
|
185
|
-
}, [
|
|
193
|
+
}, [
|
|
194
|
+
'project', 'organizer', 'typeOf', 'name', 'location', 'videoFormat', 'soundFormat', 'workPerformed', 'kanaName', 'eventStatus',
|
|
195
|
+
'endDate', 'startDate', 'additionalProperty', 'subtitleLanguage', 'dubLanguage',
|
|
196
|
+
'alternativeHeadline', 'description', 'duration', 'headline'
|
|
197
|
+
], // inclusion(2024-07-30~)
|
|
198
|
+
[
|
|
199
|
+
// 'offers'
|
|
200
|
+
]);
|
|
186
201
|
// 最適化(2024-03-25~)
|
|
187
202
|
events4inform = screeningEventSeries4inform.map(({ project, organizer, typeOf, name, location, id, videoFormat, soundFormat, workPerformed, kanaName, eventStatus, endDate, startDate, additionalProperty, subtitleLanguage, dubLanguage, alternativeHeadline, description, duration, headline }) => {
|
|
188
203
|
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ project, organizer, typeOf, name, location, id, videoFormat, soundFormat, workPerformed, kanaName, eventStatus }, (endDate !== undefined) ? { endDate } : undefined), (startDate !== undefined) ? { startDate } : undefined), (Array.isArray(additionalProperty)) ? { additionalProperty } : undefined), (subtitleLanguage !== undefined) ? {} : undefined), (dubLanguage !== undefined) ? { dubLanguage } : undefined), (alternativeHeadline !== undefined) ? { alternativeHeadline } : undefined), (description !== undefined) ? { description } : undefined), (typeof duration === 'string') ? { duration } : undefined), (headline !== undefined) ? { headline } : undefined);
|
|
@@ -30,7 +30,7 @@ function returnOrder(params) {
|
|
|
30
30
|
orderNumber,
|
|
31
31
|
project: { id: params.project.id },
|
|
32
32
|
inclusion: [
|
|
33
|
-
'project', 'typeOf', 'orderNumber', 'dateReturned',
|
|
33
|
+
'project', 'typeOf', 'orderNumber', 'dateReturned',
|
|
34
34
|
'customer', 'returner', 'seller', 'price', 'priceCurrency', 'orderDate', 'orderStatus'
|
|
35
35
|
]
|
|
36
36
|
});
|
|
@@ -51,7 +51,7 @@ function sendOrder(params) {
|
|
|
51
51
|
let order = yield repos.order.projectFieldsByOrderNumber({
|
|
52
52
|
orderNumber,
|
|
53
53
|
project: { id: params.project.id },
|
|
54
|
-
inclusion: ['confirmationNumber', 'project', 'typeOf', 'seller', 'orderNumber', 'price', 'priceCurrency', 'orderDate', 'customer'
|
|
54
|
+
inclusion: ['confirmationNumber', 'project', 'typeOf', 'seller', 'orderNumber', 'price', 'priceCurrency', 'orderDate', 'customer']
|
|
55
55
|
});
|
|
56
56
|
// プロジェクト条件検証
|
|
57
57
|
if (order.project.id !== params.project.id) {
|
|
@@ -113,9 +113,7 @@ function onReservationCheckedIn(params) {
|
|
|
113
113
|
const existingEvents = yield repos.event.search({
|
|
114
114
|
id: { $eq: reservationForId },
|
|
115
115
|
typeOfIn: [factory.eventType.Event, factory.eventType.ScreeningEvent] // 指定しないとArgumentNullError
|
|
116
|
-
}, ['
|
|
117
|
-
// { _id: 1 }
|
|
118
|
-
);
|
|
116
|
+
}, ['typeOf'], []);
|
|
119
117
|
if (existingEvents.length > 0) {
|
|
120
118
|
yield (0, onEventChanged_1.createAggregateScreeningEventIfNotExist)({
|
|
121
119
|
project: { id: params.project.id },
|
package/package.json
CHANGED