@chevre/domain 22.1.0-alpha.0 → 22.1.0-alpha.2
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/example/src/chevre/searchOrders.ts +1 -2
- package/example/src/chevre/updateEventPartiallyById.ts +22 -0
- package/lib/chevre/factory/event.d.ts +1 -1
- package/lib/chevre/repo/event.d.ts +27 -4
- package/lib/chevre/repo/event.js +67 -26
- package/lib/chevre/repo/order.d.ts +0 -6
- package/lib/chevre/repo/order.js +9 -2
- package/lib/chevre/service/assetTransaction/pay.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/confirm.js +1 -1
- package/lib/chevre/service/event.js +6 -6
- package/lib/chevre/service/offer/onEventChanged.js +22 -7
- package/lib/chevre/service/order/deleteOrder.js +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +1 -1
- package/lib/chevre/service/payment.js +2 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -3
- package/lib/chevre/service/reserve/searchByOrder.js +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +1 -1
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/transaction/moneyTransfer.js +2 -4
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -2
- package/lib/chevre/service/transaction/returnOrder.js +1 -2
- 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);
|
|
@@ -0,0 +1,22 @@
|
|
|
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 result = await eventRepo.updatePartiallyById<chevre.factory.eventType.ScreeningEvent>({
|
|
13
|
+
project: { id: PROJECT_ID },
|
|
14
|
+
id: 'blxd1grxw',
|
|
15
|
+
attributes: { typeOf: chevre.factory.eventType.ScreeningEvent, eventStatus: chevre.factory.eventStatusType.EventScheduled }
|
|
16
|
+
});
|
|
17
|
+
console.log(result);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
main()
|
|
21
|
+
.then(console.log)
|
|
22
|
+
.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;
|
|
@@ -134,7 +134,7 @@ export declare class EventRepo {
|
|
|
134
134
|
};
|
|
135
135
|
id: string;
|
|
136
136
|
attributes: IAttributes4patchUpdate<T>;
|
|
137
|
-
}): Promise<
|
|
137
|
+
}): Promise<void>;
|
|
138
138
|
/**
|
|
139
139
|
* イベントを保管する
|
|
140
140
|
*/
|
|
@@ -146,7 +146,9 @@ export declare class EventRepo {
|
|
|
146
146
|
*/
|
|
147
147
|
$unset?: IUnset<T>;
|
|
148
148
|
upsert?: boolean;
|
|
149
|
-
}): Promise<
|
|
149
|
+
}): Promise<{
|
|
150
|
+
id: string;
|
|
151
|
+
}>;
|
|
150
152
|
saveMany<T extends factory.eventType>(params: {
|
|
151
153
|
id: string;
|
|
152
154
|
attributes: factory.event.IAttributes<T>;
|
|
@@ -156,11 +158,32 @@ export declare class EventRepo {
|
|
|
156
158
|
save4ttts(params: {
|
|
157
159
|
oldEventId: string;
|
|
158
160
|
attributes: factory.event.IAttributes<factory.eventType.ScreeningEvent>;
|
|
159
|
-
}): Promise<
|
|
161
|
+
}): Promise<{
|
|
162
|
+
id: string;
|
|
163
|
+
}>;
|
|
160
164
|
/**
|
|
161
165
|
* イベントを検索する
|
|
162
166
|
*/
|
|
163
|
-
search<T extends factory.eventType>(params: ISearchConditions<T>, inclusion: IKeyOfProjection<T>[], exclusion
|
|
167
|
+
search<T extends factory.eventType>(params: ISearchConditions<T>, inclusion: IKeyOfProjection<T>[], exclusion?: IKeyOfProjection<T>[]): Promise<Omit<factory.event.IEvent<T>, 'aggregateEntranceGate' | 'aggregateOffer'>[]>;
|
|
168
|
+
/**
|
|
169
|
+
* IDのみで検索する
|
|
170
|
+
* projectionなし
|
|
171
|
+
*/
|
|
172
|
+
findAnyEventById<T extends factory.eventType>(params: {
|
|
173
|
+
id: {
|
|
174
|
+
$eq: string;
|
|
175
|
+
};
|
|
176
|
+
project: {
|
|
177
|
+
id: {
|
|
178
|
+
$eq: string;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
organizer?: {
|
|
182
|
+
id: {
|
|
183
|
+
$eq: string;
|
|
184
|
+
};
|
|
185
|
+
};
|
|
186
|
+
}): Promise<Omit<factory.event.IEvent<T>, 'aggregateEntranceGate' | 'aggregateOffer'>>;
|
|
164
187
|
searchIds<T extends factory.eventType>(params: ISearchConditions<T>): Promise<string[]>;
|
|
165
188
|
/**
|
|
166
189
|
* 特定イベントから指定フィールドのみ取得する
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -683,20 +683,24 @@ class EventRepo {
|
|
|
683
683
|
*/
|
|
684
684
|
updatePartiallyById(params) {
|
|
685
685
|
return __awaiter(this, void 0, void 0, function* () {
|
|
686
|
-
let doc;
|
|
686
|
+
// let doc: Document | null;
|
|
687
687
|
const _a = params.attributes, { typeOf } = _a, updateFields = __rest(_a, ["typeOf"]);
|
|
688
|
-
|
|
689
|
-
|
|
688
|
+
if (typeof typeOf !== 'string' || typeOf.length === 0) {
|
|
689
|
+
throw new factory.errors.ArgumentNull('attributes.typeOf');
|
|
690
|
+
}
|
|
691
|
+
const doc = yield this.eventModel.findOneAndUpdate({
|
|
692
|
+
_id: { $eq: params.id },
|
|
690
693
|
'project.id': { $eq: params.project.id },
|
|
691
|
-
typeOf:
|
|
694
|
+
typeOf: { $eq: typeOf }
|
|
692
695
|
}, {
|
|
693
696
|
$set: updateFields
|
|
694
|
-
}, { upsert: false, new:
|
|
697
|
+
}, { upsert: false, new: false, projection: { _id: 1 } })
|
|
698
|
+
.lean()
|
|
695
699
|
.exec();
|
|
696
700
|
if (doc === null) {
|
|
697
701
|
throw new factory.errors.NotFound(this.eventModel.modelName);
|
|
698
702
|
}
|
|
699
|
-
return doc.toObject();
|
|
703
|
+
// return doc.toObject(); // void化(2024-07-31~)
|
|
700
704
|
});
|
|
701
705
|
}
|
|
702
706
|
/**
|
|
@@ -704,24 +708,31 @@ class EventRepo {
|
|
|
704
708
|
*/
|
|
705
709
|
save(params) {
|
|
706
710
|
return __awaiter(this, void 0, void 0, function* () {
|
|
711
|
+
let savedEventId;
|
|
707
712
|
let doc;
|
|
713
|
+
const _a = params.attributes, { identifier, project, typeOf } = _a, updateFields = __rest(_a, ["identifier", "project", "typeOf"]);
|
|
714
|
+
if (typeof typeOf !== 'string' || typeOf.length === 0) {
|
|
715
|
+
throw new factory.errors.ArgumentNull('attributes.typeOf');
|
|
716
|
+
}
|
|
708
717
|
try {
|
|
709
718
|
if (params.id === undefined) {
|
|
710
719
|
const uniqid = yield Promise.resolve().then(() => require('uniqid'));
|
|
711
720
|
const id = uniqid();
|
|
712
721
|
doc = yield this.eventModel.create(Object.assign(Object.assign({}, params.attributes), { _id: id }));
|
|
722
|
+
savedEventId = id;
|
|
713
723
|
}
|
|
714
724
|
else {
|
|
715
725
|
const upsert = params.upsert === true;
|
|
716
|
-
// 上書き禁止属性を除外(2022-08-24~)
|
|
717
|
-
const _a = params.attributes, { identifier, project, typeOf } = _a, updateFields = __rest(_a, ["identifier", "project", "typeOf"]);
|
|
718
726
|
doc = yield this.eventModel.findOneAndUpdate({
|
|
719
|
-
_id: params.id,
|
|
720
|
-
typeOf:
|
|
721
|
-
}, Object.assign({
|
|
722
|
-
|
|
723
|
-
|
|
727
|
+
_id: { $eq: params.id },
|
|
728
|
+
typeOf: { $eq: typeOf }
|
|
729
|
+
}, Object.assign({
|
|
730
|
+
// 上書き禁止属性を除外(2022-08-24~)
|
|
731
|
+
$setOnInsert: Object.assign({ typeOf,
|
|
732
|
+
project }, (identifier !== undefined) ? { identifier } : undefined), $set: updateFields }, (params.$unset !== undefined) ? { $unset: params.$unset } : undefined), { upsert, new: true, projection: { _id: 1 } })
|
|
733
|
+
.lean()
|
|
724
734
|
.exec();
|
|
735
|
+
savedEventId = params.id;
|
|
725
736
|
}
|
|
726
737
|
}
|
|
727
738
|
catch (error) {
|
|
@@ -735,7 +746,8 @@ class EventRepo {
|
|
|
735
746
|
if (doc === null) {
|
|
736
747
|
throw new factory.errors.NotFound(this.eventModel.modelName);
|
|
737
748
|
}
|
|
738
|
-
return
|
|
749
|
+
return { id: savedEventId }; // optimize(2024-07-31~)
|
|
750
|
+
// return doc.toObject();
|
|
739
751
|
});
|
|
740
752
|
}
|
|
741
753
|
saveMany(params) {
|
|
@@ -787,13 +799,13 @@ class EventRepo {
|
|
|
787
799
|
}
|
|
788
800
|
save4ttts(params) {
|
|
789
801
|
return __awaiter(this, void 0, void 0, function* () {
|
|
790
|
-
let doc;
|
|
802
|
+
// let doc: Document | null;
|
|
791
803
|
const _a = params.attributes, { identifier, project, typeOf } = _a, updateFields = __rest(_a, ["identifier", "project", "typeOf"]);
|
|
792
804
|
const uniqid = yield Promise.resolve().then(() => require('uniqid'));
|
|
793
805
|
const id = uniqid();
|
|
794
|
-
doc = yield this.eventModel.findOneAndUpdate({
|
|
795
|
-
'project.id': { $eq:
|
|
796
|
-
typeOf:
|
|
806
|
+
const doc = yield this.eventModel.findOneAndUpdate({
|
|
807
|
+
'project.id': { $eq: project.id },
|
|
808
|
+
typeOf: { $eq: typeOf },
|
|
797
809
|
// 追加特性をキーに更新
|
|
798
810
|
additionalProperty: {
|
|
799
811
|
$exists: true,
|
|
@@ -802,18 +814,17 @@ class EventRepo {
|
|
|
802
814
|
},
|
|
803
815
|
// upsertの場合、createがありうるので属性を除外しない
|
|
804
816
|
{
|
|
805
|
-
$setOnInsert: Object.assign(
|
|
806
|
-
|
|
807
|
-
? { identifier: params.attributes.identifier } : undefined),
|
|
817
|
+
$setOnInsert: Object.assign({ _id: id, typeOf,
|
|
818
|
+
project }, (identifier !== undefined) ? { identifier } : undefined),
|
|
808
819
|
$set: updateFields
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
}, { upsert: true, new: true })
|
|
820
|
+
}, { upsert: true, new: true, projection: { _id: 1 } })
|
|
821
|
+
.lean()
|
|
812
822
|
.exec();
|
|
813
823
|
if (doc === null) {
|
|
814
824
|
throw new factory.errors.NotFound(this.eventModel.modelName);
|
|
815
825
|
}
|
|
816
|
-
return doc.
|
|
826
|
+
return { id: doc._id }; // optimize(2024-07-31~)
|
|
827
|
+
// return <factory.event.IEvent<factory.eventType.ScreeningEvent>>doc.toObject();
|
|
817
828
|
});
|
|
818
829
|
}
|
|
819
830
|
/**
|
|
@@ -865,6 +876,32 @@ class EventRepo {
|
|
|
865
876
|
.then((docs) => docs.map((doc) => doc.toObject()));
|
|
866
877
|
});
|
|
867
878
|
}
|
|
879
|
+
/**
|
|
880
|
+
* IDのみで検索する
|
|
881
|
+
* projectionなし
|
|
882
|
+
*/
|
|
883
|
+
findAnyEventById(params) {
|
|
884
|
+
var _a;
|
|
885
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
886
|
+
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')
|
|
887
|
+
? { 'organizer.id': { $exists: true, $eq: params.organizer.id.$eq } }
|
|
888
|
+
: undefined), {
|
|
889
|
+
__v: 0,
|
|
890
|
+
createdAt: 0,
|
|
891
|
+
updatedAt: 0,
|
|
892
|
+
// DefaultでaggregateEntranceGateを取得しない(2023-01-25~)
|
|
893
|
+
aggregateEntranceGate: 0,
|
|
894
|
+
// DefaultでaggregateOfferを取得しない(2023-01-24~)
|
|
895
|
+
aggregateOffer: 0
|
|
896
|
+
})
|
|
897
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
898
|
+
.exec();
|
|
899
|
+
if (doc === null) {
|
|
900
|
+
throw new factory.errors.NotFound('Event');
|
|
901
|
+
}
|
|
902
|
+
return doc.toObject();
|
|
903
|
+
});
|
|
904
|
+
}
|
|
868
905
|
searchIds(params) {
|
|
869
906
|
return __awaiter(this, void 0, void 0, function* () {
|
|
870
907
|
const conditions = EventRepo.CREATE_MONGO_CONDITIONS(params);
|
|
@@ -929,7 +966,11 @@ class EventRepo {
|
|
|
929
966
|
typeOf: factory.eventType.ScreeningEventSeries,
|
|
930
967
|
id: { $eq: params.superEvent.id },
|
|
931
968
|
project: { id: { $eq: params.project.id } }
|
|
932
|
-
}, [
|
|
969
|
+
}, [
|
|
970
|
+
'additionalProperty', 'alternativeHeadline', 'description', 'dubLanguage',
|
|
971
|
+
'endDate', 'headline', 'kanaName', 'location', 'name',
|
|
972
|
+
'soundFormat', 'startDate', 'subtitleLanguage', 'typeOf', 'videoFormat', 'workPerformed'
|
|
973
|
+
], []);
|
|
933
974
|
const superEventFromDB = superEvents.shift();
|
|
934
975
|
if (superEventFromDB === undefined) {
|
|
935
976
|
throw new factory.errors.NotFound(factory.eventType.ScreeningEventSeries);
|
|
@@ -155,12 +155,6 @@ export declare class OrderRepo {
|
|
|
155
155
|
inclusion: {
|
|
156
156
|
[key in IKeyOfProjection]?: 1;
|
|
157
157
|
};
|
|
158
|
-
/**
|
|
159
|
-
* @deprecated use inclusion
|
|
160
|
-
*/
|
|
161
|
-
exclusion: {
|
|
162
|
-
[key in IKeyOfProjection]?: 0;
|
|
163
|
-
};
|
|
164
158
|
}): Promise<(IOrderWithoutAcceptedOffers & {
|
|
165
159
|
id: string;
|
|
166
160
|
})[]>;
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -996,7 +996,7 @@ class OrderRepo {
|
|
|
996
996
|
options) {
|
|
997
997
|
var _a;
|
|
998
998
|
return __awaiter(this, void 0, void 0, function* () {
|
|
999
|
-
const { inclusion
|
|
999
|
+
const { inclusion } = options;
|
|
1000
1000
|
const conditions = OrderRepo.CREATE_MONGO_CONDITIONS(params);
|
|
1001
1001
|
let useInclusionProjection = false;
|
|
1002
1002
|
let projectStage = {};
|
|
@@ -1022,7 +1022,14 @@ class OrderRepo {
|
|
|
1022
1022
|
});
|
|
1023
1023
|
}
|
|
1024
1024
|
else {
|
|
1025
|
-
|
|
1025
|
+
throw new factory.errors.ArgumentNull('inclusion', 'inclusion must be specified');
|
|
1026
|
+
// projectStage = {
|
|
1027
|
+
// __v: 0,
|
|
1028
|
+
// createdAt: 0,
|
|
1029
|
+
// updatedAt: 0,
|
|
1030
|
+
// acceptedOffers: 0, // defaultで隠蔽(2023-12-06~)
|
|
1031
|
+
// ...exclusion
|
|
1032
|
+
// };
|
|
1026
1033
|
}
|
|
1027
1034
|
const query = this.orderModel.find((conditions.length > 0) ? { $and: conditions } : {}, projectStage);
|
|
1028
1035
|
// .select(projectStage);
|
|
@@ -469,7 +469,7 @@ function confirm(params) {
|
|
|
469
469
|
project: { id: { $eq: transaction.project.id } },
|
|
470
470
|
confirmationNumbers: [confirmationNumber],
|
|
471
471
|
orderNumbers: [orderNumber]
|
|
472
|
-
}, { inclusion: { orderNumber: 1 }
|
|
472
|
+
}, { inclusion: { orderNumber: 1 } });
|
|
473
473
|
if (existingOrders.length === 0) {
|
|
474
474
|
throw new factory.errors.NotFound(factory.order.OrderType.Order);
|
|
475
475
|
}
|
|
@@ -81,7 +81,7 @@ function fixOrderAsPurpose(params, transaction) {
|
|
|
81
81
|
project: { id: { $eq: transaction.project.id } },
|
|
82
82
|
confirmationNumbers: [payPurposeConfirmationNumber],
|
|
83
83
|
orderNumbers: [payPurposeOrderNumber]
|
|
84
|
-
}, { inclusion: { customer: 1, orderNumber: 1, typeOf: 1 }
|
|
84
|
+
}, { inclusion: { customer: 1, orderNumber: 1, typeOf: 1 } });
|
|
85
85
|
order = orders.shift();
|
|
86
86
|
if (order === undefined) {
|
|
87
87
|
throw new factory.errors.NotFound('Order as purpose');
|
|
@@ -787,9 +787,9 @@ function updateEvent4ttts(params) {
|
|
|
787
787
|
}
|
|
788
788
|
});
|
|
789
789
|
const action = yield repos.action.start(actionAttributes);
|
|
790
|
-
let
|
|
790
|
+
let savedEvent;
|
|
791
791
|
try {
|
|
792
|
-
|
|
792
|
+
savedEvent = yield repos.event.save4ttts({
|
|
793
793
|
oldEventId: params.oldEventId,
|
|
794
794
|
attributes: params.attributes
|
|
795
795
|
});
|
|
@@ -804,11 +804,11 @@ function updateEvent4ttts(params) {
|
|
|
804
804
|
throw error;
|
|
805
805
|
}
|
|
806
806
|
// アクション完了
|
|
807
|
-
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: { id:
|
|
807
|
+
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: { id: savedEvent.id } });
|
|
808
808
|
yield (0, onEventChanged_1.onEventChanged)({
|
|
809
|
-
id: [
|
|
810
|
-
project: { id:
|
|
811
|
-
typeOf:
|
|
809
|
+
id: [savedEvent.id],
|
|
810
|
+
project: { id: params.project.id },
|
|
811
|
+
typeOf: factory.eventType.ScreeningEvent,
|
|
812
812
|
isNew: false,
|
|
813
813
|
useInform: true
|
|
814
814
|
})({
|
|
@@ -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);
|
|
@@ -20,7 +20,7 @@ function deleteOrder(params) {
|
|
|
20
20
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
const orders = yield repos.order.search({
|
|
22
22
|
orderNumbers: [params.object.orderNumber]
|
|
23
|
-
}, { inclusion: { orderDate: 1, project: 1, customer: 1, orderNumber: 1, seller: 1 }
|
|
23
|
+
}, { inclusion: { orderDate: 1, project: 1, customer: 1, orderNumber: 1, seller: 1 } });
|
|
24
24
|
const order = orders.shift();
|
|
25
25
|
if (order === undefined) {
|
|
26
26
|
// すでに削除済
|
|
@@ -281,7 +281,7 @@ function cancelOrderIfExist(params) {
|
|
|
281
281
|
paymentMethodIds: [params.paymentMethodId]
|
|
282
282
|
},
|
|
283
283
|
project: { id: { $eq: params.project.id } }
|
|
284
|
-
}, { inclusion: { confirmationNumber: 1, orderNumber: 1 }
|
|
284
|
+
}, { inclusion: { confirmationNumber: 1, orderNumber: 1 } });
|
|
285
285
|
const orderByPaymentMethodId = ordersByPaymentMethodId.shift();
|
|
286
286
|
if (orderByPaymentMethodId !== undefined) {
|
|
287
287
|
const placeOrderTransaction = yield (0, findPlaceOrderTransaction_1.findPlaceOrderTransaction)({
|
|
@@ -27,7 +27,7 @@ function fixOrderAsPurpose(params, transaction) {
|
|
|
27
27
|
project: { id: { $eq: transaction.project.id } },
|
|
28
28
|
confirmationNumbers: [payPurposeConfirmationNumber],
|
|
29
29
|
orderNumbers: [payPurposeOrderNumber]
|
|
30
|
-
}, { inclusion: { typeOf: 1, confirmationNumber: 1, orderNumber: 1 }
|
|
30
|
+
}, { inclusion: { typeOf: 1, confirmationNumber: 1, orderNumber: 1 } });
|
|
31
31
|
const orderWithoutAcceptedOffers = ordersWithoutAcceptedOffers.shift();
|
|
32
32
|
if (orderWithoutAcceptedOffers === undefined) {
|
|
33
33
|
throw new factory.errors.NotFound('Order as purpose');
|
|
@@ -65,7 +65,7 @@ function payTask2payActionAttributes(params) {
|
|
|
65
65
|
limit: 1,
|
|
66
66
|
page: 1,
|
|
67
67
|
orderNumbers: [params.purpose.object.orderNumber]
|
|
68
|
-
}, { inclusion: { seller: 1, project: 1 }
|
|
68
|
+
}, { inclusion: { seller: 1, project: 1 } })).shift();
|
|
69
69
|
if (order === undefined) {
|
|
70
70
|
throw new factory.errors.NotFound(factory.order.OrderType.Order);
|
|
71
71
|
}
|
|
@@ -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 },
|
|
@@ -44,7 +44,7 @@ function searchByOrder(params) {
|
|
|
44
44
|
limit: 1,
|
|
45
45
|
page: 1,
|
|
46
46
|
orderNumbers: [params.orderNumber]
|
|
47
|
-
}, { inclusion: { customer: 1 }
|
|
47
|
+
}, { inclusion: { customer: 1 } })).shift();
|
|
48
48
|
if (order === undefined) {
|
|
49
49
|
throw new factory.errors.NotFound(factory.order.OrderType.Order);
|
|
50
50
|
}
|
|
@@ -122,7 +122,7 @@ function fixOrderAsPurpose(params) {
|
|
|
122
122
|
page: 1,
|
|
123
123
|
project: { id: { $eq: params.project.id } },
|
|
124
124
|
orderNumbers: [purposeOrderNumber]
|
|
125
|
-
}, { inclusion: { customer: 1, orderNumber: 1, typeOf: 1 }
|
|
125
|
+
}, { inclusion: { customer: 1, orderNumber: 1, typeOf: 1 } });
|
|
126
126
|
order = orders.shift();
|
|
127
127
|
if (order === undefined) {
|
|
128
128
|
throw new factory.errors.NotFound('Order as purpose');
|
|
@@ -70,7 +70,7 @@ function fixOrderAndTransaction(params) {
|
|
|
70
70
|
limit: 1,
|
|
71
71
|
page: 1,
|
|
72
72
|
paymentMethods: { paymentMethodIds: [paymentMethodId] }
|
|
73
|
-
}, { inclusion: { orderNumber: 1 }
|
|
73
|
+
}, { inclusion: { orderNumber: 1 } })).shift();
|
|
74
74
|
if (orderByPaymentMethodId === undefined) {
|
|
75
75
|
throw new factory.errors.NotFound(factory.order.OrderType.Order);
|
|
76
76
|
}
|
|
@@ -407,8 +407,7 @@ function validateFromLocation(project, fromLocationBeforeStart, issuedThrough) {
|
|
|
407
407
|
orderNumbers: [String(fromLocation.orderNumber)],
|
|
408
408
|
confirmationNumbers: [String(fromLocation.confirmationNumber)]
|
|
409
409
|
}, {
|
|
410
|
-
inclusion: { identifier: 1, orderStatus: 1 }
|
|
411
|
-
exclusion: {}
|
|
410
|
+
inclusion: { identifier: 1, orderStatus: 1 }
|
|
412
411
|
});
|
|
413
412
|
const order = orders.shift();
|
|
414
413
|
if (order === undefined) {
|
|
@@ -464,8 +463,7 @@ function validateToLocation(project, toLocationBeforeStart, issuedThrough) {
|
|
|
464
463
|
}, {
|
|
465
464
|
inclusion: {
|
|
466
465
|
identifier: 1
|
|
467
|
-
}
|
|
468
|
-
exclusion: {}
|
|
466
|
+
}
|
|
469
467
|
});
|
|
470
468
|
const order = orders.shift();
|
|
471
469
|
if (order === undefined) {
|
|
@@ -131,8 +131,7 @@ function fixOrders(params) {
|
|
|
131
131
|
inclusion: {
|
|
132
132
|
confirmationNumber: 1, dateReturned: 1, orderDate: 1, orderNumber: 1, orderStatus: 1,
|
|
133
133
|
paymentMethods: 1, price: 1, project: 1, seller: 1, typeOf: 1
|
|
134
|
-
}
|
|
135
|
-
exclusion: {}
|
|
134
|
+
}
|
|
136
135
|
}
|
|
137
136
|
// {
|
|
138
137
|
// // acceptedOffers: 0, // カスタム返品ポリシーに必要
|
|
@@ -111,8 +111,7 @@ function confirm(params) {
|
|
|
111
111
|
inclusion: {
|
|
112
112
|
confirmationNumber: 1, customer: 1, identifier: 1, orderDate: 1, orderNumber: 1, orderStatus: 1,
|
|
113
113
|
orderedItem: 1, paymentMethods: 1, price: 1, priceCurrency: 1, project: 1, seller: 1, typeOf: 1
|
|
114
|
-
}
|
|
115
|
-
exclusion: {}
|
|
114
|
+
}
|
|
116
115
|
});
|
|
117
116
|
// デフォルトEメールメッセージを検索
|
|
118
117
|
let emailMessageOnOrderReturned;
|
package/package.json
CHANGED