@chevre/domain 25.2.0-alpha.5 → 25.2.0-alpha.50
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/eventEmitter/task.d.ts +2 -1
- package/lib/chevre/factory/customerTelephone2COATelNum.d.ts +3 -0
- package/lib/chevre/factory/customerTelephone2COATelNum.js +22 -0
- package/lib/chevre/repo/action/acceptPay.d.ts +15 -0
- package/lib/chevre/repo/action/acceptPay.js +47 -19
- package/lib/chevre/repo/action/actionProcess.js +57 -57
- package/lib/chevre/repo/action.d.ts +16 -9
- package/lib/chevre/repo/action.js +99 -180
- package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
- package/lib/chevre/repo/aggregateOffer.js +16 -125
- package/lib/chevre/repo/asyncAction.d.ts +64 -0
- package/lib/chevre/repo/asyncAction.js +178 -0
- package/lib/chevre/repo/concurrentLock.d.ts +3 -1
- package/lib/chevre/repo/creativeWork.d.ts +2 -3
- package/lib/chevre/repo/credentials.d.ts +2 -1
- package/lib/chevre/repo/customerType.d.ts +2 -3
- package/lib/chevre/repo/event.d.ts +10 -11
- package/lib/chevre/repo/eventOffer.d.ts +4 -5
- package/lib/chevre/repo/eventSellerMakesOffer.d.ts +2 -3
- package/lib/chevre/repo/eventSeries.d.ts +4 -5
- package/lib/chevre/repo/message.d.ts +1 -1
- package/lib/chevre/repo/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.js +67 -66
- package/lib/chevre/repo/mongoose/schemas/asyncAction.d.ts +11 -0
- package/lib/chevre/repo/mongoose/schemas/asyncAction.js +89 -0
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +10 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/task.js +12 -12
- package/lib/chevre/repo/note.d.ts +3 -4
- package/lib/chevre/repo/noteAboutOrder.d.ts +2 -3
- package/lib/chevre/repo/offer/offerInCatalogReadOnly.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.d.ts +2 -2
- package/lib/chevre/repo/offer/unitPriceInCatalog.js +59 -11
- package/lib/chevre/repo/offerCatalog.d.ts +2 -3
- package/lib/chevre/repo/offerCatalogItem.d.ts +2 -3
- package/lib/chevre/repo/order.d.ts +2 -0
- package/lib/chevre/repo/order.js +14 -14
- package/lib/chevre/repo/orderInTransaction.d.ts +68 -1
- package/lib/chevre/repo/orderInTransaction.js +181 -3
- package/lib/chevre/repo/passport.d.ts +2 -1
- package/lib/chevre/repo/person.d.ts +0 -15
- package/lib/chevre/repo/person.js +122 -108
- package/lib/chevre/repo/place/entranceGate.d.ts +4 -5
- package/lib/chevre/repo/place/movieTheater.d.ts +3 -4
- package/lib/chevre/repo/place/screeningRoom.d.ts +4 -5
- package/lib/chevre/repo/place/seat.d.ts +4 -5
- package/lib/chevre/repo/place/section.d.ts +3 -4
- package/lib/chevre/repo/priceSpecification.d.ts +4 -4
- package/lib/chevre/repo/product.d.ts +3 -4
- package/lib/chevre/repo/rateLimit/offer.d.ts +3 -1
- package/lib/chevre/repo/rateLimit/offer.js +0 -12
- package/lib/chevre/repo/reservation.d.ts +2 -3
- package/lib/chevre/repo/sellerMakesOffer.d.ts +3 -4
- package/lib/chevre/repo/stockHolder.d.ts +1 -1
- package/lib/chevre/repo/stockHolder.js +0 -146
- package/lib/chevre/repo/transaction/placeOrder.d.ts +2 -45
- package/lib/chevre/repo/transaction/placeOrder.js +43 -83
- package/lib/chevre/repo/transaction.d.ts +2 -2
- package/lib/chevre/repo/transactionNumberCounter.js +0 -34
- package/lib/chevre/repo/transactionProcess.d.ts +2 -1
- package/lib/chevre/repo/transactionProcess.js +0 -13
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +12 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +3 -4
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/asyncAction.d.ts +16 -0
- package/lib/chevre/service/asyncAction.js +36 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.d.ts +15 -0
- package/lib/chevre/service/asyncActionHandler/onOperationFailed.js +42 -0
- package/lib/chevre/service/asyncActionHandler.d.ts +13 -0
- package/lib/chevre/service/asyncActionHandler.js +89 -0
- package/lib/chevre/service/notification/factory.d.ts +2 -4
- package/lib/chevre/service/notification/factory.js +26 -24
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +11 -5
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +11 -3
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -5
- package/lib/chevre/service/offer/event/authorize/factory.js +93 -75
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -4
- package/lib/chevre/service/offer/event/authorize.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.d.ts +6 -7
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/factory.js +10 -10
- package/lib/chevre/service/offer/eventServiceByCOA/authorize/validateAcceptedOffers.js +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +15 -12
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +0 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.js +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.d.ts +4 -0
- package/lib/chevre/service/offer/eventServiceByCOA/findAcceptAction.js +22 -9
- package/lib/chevre/service/order/deleteOrder.d.ts +5 -1
- package/lib/chevre/service/order/deleteOrder.js +8 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionCanceled.js +19 -11
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +2 -2
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +1 -7
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +2 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +2 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +95 -33
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +4 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +2 -6
- package/lib/chevre/service/order/payOrder.d.ts +2 -0
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.d.ts +2 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +13 -58
- package/lib/chevre/service/order/placeOrder/factory.js +3 -21
- package/lib/chevre/service/order/placeOrder.d.ts +4 -5
- package/lib/chevre/service/order/placeOrder.js +20 -31
- package/lib/chevre/service/payment/any/authorize/fixOrderAsNeeded.js +1 -2
- package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +3 -2
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +4 -3
- package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +3 -31
- package/lib/chevre/service/payment/any/authorize.js +13 -37
- package/lib/chevre/service/payment/any/factory.d.ts +7 -7
- package/lib/chevre/service/payment/any/factory.js +19 -22
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +3 -1
- package/lib/chevre/service/payment/any/findAcceptAction.js +14 -6
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +4 -66
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +4 -0
- package/lib/chevre/service/payment/any/publishPaymentUrl.js +4 -18
- package/lib/chevre/service/payment/any/voidPayTransaction.d.ts +2 -0
- package/lib/chevre/service/payment/any/voidPayTransaction.js +1 -23
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +5 -9
- package/lib/chevre/service/reserve/adminFindReservations.d.ts +15 -0
- package/lib/chevre/service/reserve/adminFindReservations.js +35 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +17 -8
- package/lib/chevre/service/reserve/searchByOrder.js +2 -6
- package/lib/chevre/service/reserve.d.ts +2 -2
- package/lib/chevre/service/reserve.js +3 -3
- package/lib/chevre/service/task/aggregateOffers.d.ts +2 -2
- package/lib/chevre/service/task/aggregateOffers.js +2 -1
- package/lib/chevre/service/task/aggregateScreeningEvent.d.ts +2 -2
- package/lib/chevre/service/task/aggregateScreeningEvent.js +2 -1
- package/lib/chevre/service/task/authorizePayment.js +3 -1
- package/lib/chevre/service/task/cancelReservation.d.ts +2 -2
- package/lib/chevre/service/task/cancelReservation.js +2 -1
- package/lib/chevre/service/task/confirmPayTransaction.js +0 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +2 -7
- package/lib/chevre/service/task/deleteTransaction.d.ts +2 -2
- package/lib/chevre/service/task/deleteTransaction.js +2 -1
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +2 -2
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +4 -3
- package/lib/chevre/service/task/onEventChanged.d.ts +2 -2
- package/lib/chevre/service/task/onEventChanged.js +2 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +2 -2
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +4 -1
- package/lib/chevre/service/task/onResourceUpdated/onAggregateOfferUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated.js +2 -1
- package/lib/chevre/service/task/placeOrder.d.ts +2 -2
- package/lib/chevre/service/task/placeOrder.js +6 -3
- package/lib/chevre/service/task/publishPaymentUrl.js +7 -3
- package/lib/chevre/service/task/refund.d.ts +2 -2
- package/lib/chevre/service/task/refund.js +4 -10
- package/lib/chevre/service/task/reserve.d.ts +2 -2
- package/lib/chevre/service/task/reserve.js +2 -1
- package/lib/chevre/service/task/returnOrder.d.ts +2 -2
- package/lib/chevre/service/task/returnOrder.js +2 -1
- package/lib/chevre/service/task/sendOrder.d.ts +2 -2
- package/lib/chevre/service/task/sendOrder.js +2 -1
- package/lib/chevre/service/task/voidPayTransaction.js +3 -7
- package/lib/chevre/service/task/voidPayment.d.ts +2 -2
- package/lib/chevre/service/task/voidPayment.js +2 -1
- package/lib/chevre/service/taskHandler/onOperationFailed.js +1 -1
- package/lib/chevre/service/taskHandler.d.ts +2 -2
- package/lib/chevre/service/taskHandler.js +36 -37
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.d.ts +15 -0
- package/lib/chevre/service/transaction/deleteTransaction/deletePayTransactionsByPlaceOrder.js +51 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.d.ts +23 -0
- package/lib/chevre/service/transaction/deleteTransaction/deleteReservationsByPlaceOrder.js +64 -0
- package/lib/chevre/service/transaction/deleteTransaction.js +15 -152
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.d.ts +28 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +11 -12
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.d.ts +4 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +6 -7
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.d.ts +35 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +15 -11
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +11 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +53 -32
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +33 -78
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.d.ts +4 -7
- package/lib/chevre/service/transaction/placeOrder/publishConfirmationNumberIfNotExist.js +33 -15
- package/lib/chevre/service/transaction/placeOrder/start.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.d.ts +20 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent/fixCustomer.js +63 -0
- package/lib/chevre/service/transaction/placeOrder/updateAgent.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +17 -86
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/service.d.ts +4 -0
- package/lib/chevre/service.js +12 -1
- package/lib/chevre/taskSettings.d.ts +1 -3
- package/package.json +8 -11
- package/lib/chevre/service/order/findConfirmedPlaceOrder.d.ts +0 -13
- package/lib/chevre/service/order/findConfirmedPlaceOrder.js +0 -32
- package/lib/chevre/service/reserve/findReservations.d.ts +0 -33
- package/lib/chevre/service/reserve/findReservations.js +0 -61
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { AnyExpression, Connection, Document, FilterQuery, PipelineStage } from 'mongoose';
|
|
1
|
+
import { AnyExpression, Connection, Document, FilterQuery, PipelineStage, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
3
|
import { IDocType as IAggregateOfferDocType } from './mongoose/schemas/aggregateOffer';
|
|
5
4
|
type IMatchStage = PipelineStage.Match;
|
|
@@ -13,7 +12,7 @@ export declare class AggregateOfferRepo {
|
|
|
13
12
|
constructor(connection: Connection);
|
|
14
13
|
static CREATE_MATCH_STAGE(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): IMatchStage[];
|
|
15
14
|
static CREATE_AGGREGATE_OFFERS_PROJECTION(params: IProjection): Record<string, AnyExpression>;
|
|
16
|
-
|
|
15
|
+
findAggregateOffers(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<Pick<factory.aggregateOffer.IAggregateOffer, 'id' | 'offers' | 'typeOf'>[]>;
|
|
17
16
|
pushIncludedInDataCatalog(params: {
|
|
18
17
|
project: {
|
|
19
18
|
id: string;
|
|
@@ -80,7 +79,7 @@ export declare class AggregateOfferRepo {
|
|
|
80
79
|
*/
|
|
81
80
|
productType: factory.product.ProductType;
|
|
82
81
|
}): Promise<{
|
|
83
|
-
bulkWriteResult?: BulkWriteResult;
|
|
82
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
84
83
|
modifiedOffers?: {
|
|
85
84
|
id: string;
|
|
86
85
|
}[];
|
|
@@ -110,15 +109,5 @@ export declare class AggregateOfferRepo {
|
|
|
110
109
|
};
|
|
111
110
|
};
|
|
112
111
|
}): Promise<import("mongoose").UpdateWriteOpResult | undefined>;
|
|
113
|
-
countIncludedInDataCatalog(params: {
|
|
114
|
-
id: {
|
|
115
|
-
$eq: string;
|
|
116
|
-
};
|
|
117
|
-
}): Promise<{
|
|
118
|
-
includedInDataCatalogCount: number;
|
|
119
|
-
}[]>;
|
|
120
|
-
maxIncludedInDataCatalogCount(): Promise<{
|
|
121
|
-
includedInDataCatalogCount: number;
|
|
122
|
-
}[]>;
|
|
123
112
|
}
|
|
124
113
|
export {};
|
|
@@ -374,11 +374,11 @@ class AggregateOfferRepo {
|
|
|
374
374
|
_id: 0,
|
|
375
375
|
id: '$_id',
|
|
376
376
|
typeOf: '$typeOf',
|
|
377
|
-
project: '$project',
|
|
378
377
|
offers: [{ $first: '$offers' }],
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
378
|
+
// project: '$project', // discontinue(2026-07-24~)
|
|
379
|
+
// highPrice: { $max: '$offers.priceSpecification.price' }, // offers.length:1に限定につき廃止(2026-07-24~)
|
|
380
|
+
// lowPrice: { $min: '$offers.priceSpecification.price' }, // offers.length:1に限定につき廃止(2026-07-24~)
|
|
381
|
+
// offerCount: { $size: '$offers' } // offers.length:1に限定につき廃止(2026-07-24~)
|
|
382
382
|
};
|
|
383
383
|
const positiveProjectionFields = Object.keys(params)
|
|
384
384
|
.filter((key) => params[key] !== 0);
|
|
@@ -389,11 +389,10 @@ class AggregateOfferRepo {
|
|
|
389
389
|
_id: 0,
|
|
390
390
|
id: '$_id',
|
|
391
391
|
typeOf: '$typeOf',
|
|
392
|
-
project: '$project',
|
|
393
|
-
//
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
offerCount: { $size: '$offers' }
|
|
392
|
+
// project: '$project', // discontinue(2026-07-24~)
|
|
393
|
+
// highPrice: { $max: '$offers.priceSpecification.price' }, // offers.length:1に限定につき廃止(2026-07-24~)
|
|
394
|
+
// lowPrice: { $min: '$offers.priceSpecification.price' }, // offers.length:1に限定につき廃止(2026-07-24~)
|
|
395
|
+
// offerCount: { $size: '$offers' } // offers.length:1に限定につき廃止(2026-07-24~)
|
|
397
396
|
};
|
|
398
397
|
const offersProjection = {};
|
|
399
398
|
positiveProjectionFields.forEach((field) => {
|
|
@@ -410,7 +409,7 @@ class AggregateOfferRepo {
|
|
|
410
409
|
}
|
|
411
410
|
return projectStage;
|
|
412
411
|
}
|
|
413
|
-
async
|
|
412
|
+
async findAggregateOffers(params, projection) {
|
|
414
413
|
const matchStages = AggregateOfferRepo.CREATE_MATCH_STAGE(params);
|
|
415
414
|
const projectStage = AggregateOfferRepo.CREATE_AGGREGATE_OFFERS_PROJECTION({ ...projection });
|
|
416
415
|
const sortByPrice = params.sort?.['priceSpecification.price'];
|
|
@@ -436,8 +435,11 @@ class AggregateOfferRepo {
|
|
|
436
435
|
/* istanbul ignore else */
|
|
437
436
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
438
437
|
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
439
|
-
|
|
440
|
-
|
|
438
|
+
// support skip -> limit(2026-07-24~)
|
|
439
|
+
// aggregate.limit(params.limit * page)
|
|
440
|
+
// .skip(params.limit * (page - 1));
|
|
441
|
+
aggregate.skip(params.limit * (page - 1))
|
|
442
|
+
.limit(params.limit);
|
|
441
443
|
}
|
|
442
444
|
return aggregate.exec();
|
|
443
445
|
}
|
|
@@ -499,25 +501,6 @@ class AggregateOfferRepo {
|
|
|
499
501
|
}, { projection: { _id: 1 } })
|
|
500
502
|
.exec();
|
|
501
503
|
}
|
|
502
|
-
// 単価オファー最適化作業における一時的な処理
|
|
503
|
-
// public async optimizeOffers() {
|
|
504
|
-
// return this.aggregateOfferModel.updateMany(
|
|
505
|
-
// {
|
|
506
|
-
// $or: [
|
|
507
|
-
// { 'offers.id': { $exists: true } },
|
|
508
|
-
// { 'offers.project': { $exists: true } }
|
|
509
|
-
// ]
|
|
510
|
-
// },
|
|
511
|
-
// {
|
|
512
|
-
// $set: {},
|
|
513
|
-
// $unset: {
|
|
514
|
-
// 'offers.0.id': 1,
|
|
515
|
-
// 'offers.0.project': 1
|
|
516
|
-
// }
|
|
517
|
-
// }
|
|
518
|
-
// )
|
|
519
|
-
// .exec();
|
|
520
|
-
// }
|
|
521
504
|
getCursor(conditions, projection) {
|
|
522
505
|
return this.aggregateOfferModel.find(conditions, projection)
|
|
523
506
|
.sort({ 'offers.identifier': factory_1.factory.sortType.Ascending })
|
|
@@ -530,15 +513,12 @@ class AggregateOfferRepo {
|
|
|
530
513
|
async save(params) {
|
|
531
514
|
let doc;
|
|
532
515
|
let aggregateOfferId;
|
|
533
|
-
// const { $unset, ...paramsWithoutUnset } = params;
|
|
534
516
|
const { ...paramsWithoutUnset } = params;
|
|
535
|
-
// let savedUnitPriceOffer: factory.unitPriceOffer.IUnitPriceOffer;
|
|
536
517
|
if (typeof params.id !== 'string' || params.id.length === 0) {
|
|
537
518
|
const { default: uniqid } = await import('uniqid');
|
|
538
519
|
const newId = uniqid();
|
|
539
520
|
aggregateOfferId = newId;
|
|
540
521
|
// サブオファー最適化(2023-12-22~)
|
|
541
|
-
// savedUnitPriceOffer = { ...paramsWithoutUnset, id };
|
|
542
522
|
const { id, project, ...savedUnitPriceOffer } = paramsWithoutUnset; // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
543
523
|
const aggregateOffer = {
|
|
544
524
|
typeOf: factory_1.factory.offerType.AggregateOffer,
|
|
@@ -552,18 +532,7 @@ class AggregateOfferRepo {
|
|
|
552
532
|
}
|
|
553
533
|
else {
|
|
554
534
|
aggregateOfferId = params.id;
|
|
555
|
-
|
|
556
|
-
// await this.search(
|
|
557
|
-
// {
|
|
558
|
-
// limit: 1,
|
|
559
|
-
// page: 1,
|
|
560
|
-
// project: { id: { $eq: params.project.id } },
|
|
561
|
-
// id: { $eq: params.id }
|
|
562
|
-
// },
|
|
563
|
-
// { identifier: 1, project: 1, typeOf: 1 }
|
|
564
|
-
// );
|
|
565
|
-
// const originalUnitPriceOffer = unitPriceOffers.shift();
|
|
566
|
-
const aggregateOffers = await this.search({
|
|
535
|
+
const aggregateOffers = await this.findAggregateOffers({
|
|
567
536
|
limit: 1,
|
|
568
537
|
page: 1,
|
|
569
538
|
project: { id: { $eq: params.project.id } },
|
|
@@ -579,26 +548,17 @@ class AggregateOfferRepo {
|
|
|
579
548
|
// サブオファー最適化(2023-12-22~)
|
|
580
549
|
const subOffer = {
|
|
581
550
|
...updateFields,
|
|
582
|
-
// id: originalUnitPriceOffer.id,
|
|
583
551
|
identifier: originalUnitPriceOffer.identifier,
|
|
584
|
-
// project: originalUnitPriceOffer.project,
|
|
585
552
|
typeOf: originalUnitPriceOffer.typeOf
|
|
586
553
|
};
|
|
587
|
-
doc = await this.aggregateOfferModel.findOneAndUpdate(
|
|
588
|
-
// { 'offers.id': params.id },
|
|
589
|
-
{ _id: params.id }, // _idに変更(2023-12-22~)
|
|
554
|
+
doc = await this.aggregateOfferModel.findOneAndUpdate({ _id: params.id }, // _idに変更(2023-12-22~)
|
|
590
555
|
{
|
|
591
556
|
$set: {
|
|
592
|
-
// 'offers.$[offer]': savedUnitPriceOffer
|
|
593
557
|
'offers.0': subOffer // _idに変更(2023-12-22~)
|
|
594
558
|
}
|
|
595
559
|
}, {
|
|
596
560
|
upsert: false,
|
|
597
561
|
new: true
|
|
598
|
-
// _idに変更(2023-12-22~)
|
|
599
|
-
// arrayFilters: [
|
|
600
|
-
// { 'offer.id': { $eq: params.id } }
|
|
601
|
-
// ]
|
|
602
562
|
})
|
|
603
563
|
.exec();
|
|
604
564
|
}
|
|
@@ -676,7 +636,6 @@ class AggregateOfferRepo {
|
|
|
676
636
|
async saveManyByIdentifier4sskts(params) {
|
|
677
637
|
const { default: uniqid } = await import('uniqid');
|
|
678
638
|
const insertBulkWriteOps = [];
|
|
679
|
-
// const updateBulkWriteOps: AnyBulkWriteOperation[] = [];
|
|
680
639
|
if (Array.isArray(params)) {
|
|
681
640
|
params.forEach((p) => {
|
|
682
641
|
const newOfferId = uniqid();
|
|
@@ -710,7 +669,6 @@ class AggregateOfferRepo {
|
|
|
710
669
|
}
|
|
711
670
|
if (insertBulkWriteOps.length > 0) {
|
|
712
671
|
await this.aggregateOfferModel.bulkWrite(insertBulkWriteOps, { ordered: false });
|
|
713
|
-
// await this.aggregateOfferModel.bulkWrite(updateBulkWriteOps, { ordered: false });
|
|
714
672
|
}
|
|
715
673
|
}
|
|
716
674
|
/**
|
|
@@ -724,13 +682,6 @@ class AggregateOfferRepo {
|
|
|
724
682
|
'project.id': { $eq: params.project.id },
|
|
725
683
|
'offers.addOn.itemOffered.id': { $exists: true, $in: params.addOn.itemOffered.id.$in }
|
|
726
684
|
};
|
|
727
|
-
// const updatingOffers = <Pick<factory.unitPriceOffer.IUnitPriceOffer, 'id' | 'identifier'>[]>await this.search(
|
|
728
|
-
// {
|
|
729
|
-
// project: { id: { $eq: params.project.id } },
|
|
730
|
-
// addOn: { itemOffered: { id: { $in: params.addOn.itemOffered.id.$in } } }
|
|
731
|
-
// },
|
|
732
|
-
// { identifier: 1 }
|
|
733
|
-
// );
|
|
734
685
|
return this.aggregateOfferModel.updateMany(conditions, {
|
|
735
686
|
$pull: {
|
|
736
687
|
'offers.$[offer].addOn': {
|
|
@@ -743,66 +694,6 @@ class AggregateOfferRepo {
|
|
|
743
694
|
]
|
|
744
695
|
})
|
|
745
696
|
.exec();
|
|
746
|
-
// if (updatingOffers.length > 0) {
|
|
747
|
-
// // no op
|
|
748
|
-
// }
|
|
749
|
-
// return result;
|
|
750
|
-
}
|
|
751
|
-
async countIncludedInDataCatalog(params) {
|
|
752
|
-
const aggregate = this.aggregateOfferModel.aggregate([
|
|
753
|
-
{
|
|
754
|
-
$match: {
|
|
755
|
-
_id: { $eq: params.id.$eq }
|
|
756
|
-
}
|
|
757
|
-
},
|
|
758
|
-
{
|
|
759
|
-
$project: {
|
|
760
|
-
_id: 0,
|
|
761
|
-
includedInDataCatalogCount: {
|
|
762
|
-
$cond: {
|
|
763
|
-
if: { $isArray: '$includedInDataCatalog' },
|
|
764
|
-
then: { $size: '$includedInDataCatalog' },
|
|
765
|
-
else: 0
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
]);
|
|
771
|
-
return aggregate.exec();
|
|
772
|
-
}
|
|
773
|
-
async maxIncludedInDataCatalogCount() {
|
|
774
|
-
const aggregate = this.aggregateOfferModel.aggregate([
|
|
775
|
-
// {
|
|
776
|
-
// $match: {
|
|
777
|
-
// _id: { $eq: params.id.$eq }
|
|
778
|
-
// }
|
|
779
|
-
// },
|
|
780
|
-
{
|
|
781
|
-
$project: {
|
|
782
|
-
_id: 0,
|
|
783
|
-
includedInDataCatalogCount: {
|
|
784
|
-
$cond: {
|
|
785
|
-
if: { $isArray: '$includedInDataCatalog' },
|
|
786
|
-
then: { $size: '$includedInDataCatalog' },
|
|
787
|
-
else: 0
|
|
788
|
-
}
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
},
|
|
792
|
-
{
|
|
793
|
-
$group: {
|
|
794
|
-
_id: null,
|
|
795
|
-
maxCount: { $max: '$includedInDataCatalogCount' }
|
|
796
|
-
}
|
|
797
|
-
},
|
|
798
|
-
{
|
|
799
|
-
$project: {
|
|
800
|
-
_id: 0,
|
|
801
|
-
maxCount: '$maxCount'
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
]);
|
|
805
|
-
return aggregate.exec();
|
|
806
697
|
}
|
|
807
698
|
}
|
|
808
699
|
exports.AggregateOfferRepo = AggregateOfferRepo;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
2
|
+
import { factory } from '../factory';
|
|
3
|
+
import { IModel, IDocType } from './mongoose/schemas/asyncAction';
|
|
4
|
+
import type { IExecutableTask } from '../taskSettings';
|
|
5
|
+
type ISavingTask = Pick<factory.task.IAttributes<factory.taskName>, 'data' | 'executionResults' | 'expires' | 'name' | 'project' | 'runsAt' | 'status'> & {
|
|
6
|
+
expires: Date;
|
|
7
|
+
};
|
|
8
|
+
export type IExecutableAsyncAction = Pick<IExecutableTask<factory.taskName>, 'data' | 'expires' | 'id' | 'name' | 'project' | 'runsAt' | 'status'>;
|
|
9
|
+
type IKeyOfProjection = keyof factory.task.ITask<factory.taskName>;
|
|
10
|
+
/**
|
|
11
|
+
* 非同期アクションリポジトリ
|
|
12
|
+
*/
|
|
13
|
+
export declare class AsyncActionRepo {
|
|
14
|
+
readonly asyncActionModel: IModel;
|
|
15
|
+
constructor(connection: Connection);
|
|
16
|
+
/**
|
|
17
|
+
* Readyタスクをひとつ追加する
|
|
18
|
+
*/
|
|
19
|
+
addReadyAsyncAction(params: Pick<ISavingTask, 'data' | 'expires' | 'name' | 'project' | 'runsAt'> & {
|
|
20
|
+
alternateName?: never;
|
|
21
|
+
identifier?: never;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
id: string;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Ready -> Running
|
|
27
|
+
*/
|
|
28
|
+
executeAsyncActionById(params: {
|
|
29
|
+
id: string;
|
|
30
|
+
executor: {
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
33
|
+
}): Promise<IExecutableAsyncAction | null>;
|
|
34
|
+
/**
|
|
35
|
+
* 非同期アクションの状態を参照する
|
|
36
|
+
*/
|
|
37
|
+
findAsyncActionById(params: {
|
|
38
|
+
id: {
|
|
39
|
+
$eq: string;
|
|
40
|
+
};
|
|
41
|
+
project: {
|
|
42
|
+
id: {
|
|
43
|
+
$eq: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
name: factory.taskName;
|
|
47
|
+
}, inclusion: IKeyOfProjection[]): Promise<(IDocType & {
|
|
48
|
+
id: string;
|
|
49
|
+
} | undefined)>;
|
|
50
|
+
/**
|
|
51
|
+
* タスクIDから実行結果とステータスを保管する
|
|
52
|
+
* Abortedの場合、dateAbortedもセットする
|
|
53
|
+
*/
|
|
54
|
+
setExecutionResultAndStatus(params: {
|
|
55
|
+
/**
|
|
56
|
+
* タスクID
|
|
57
|
+
*/
|
|
58
|
+
id: string;
|
|
59
|
+
}, update: {
|
|
60
|
+
status: factory.taskStatus.Executed | factory.taskStatus.Aborted;
|
|
61
|
+
executionResult: factory.task.IExecutionResult;
|
|
62
|
+
}): Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsyncActionRepo = void 0;
|
|
4
|
+
const factory_1 = require("../factory");
|
|
5
|
+
const settings_1 = require("../settings");
|
|
6
|
+
const asyncAction_1 = require("./mongoose/schemas/asyncAction");
|
|
7
|
+
const executableTaskProjection = {
|
|
8
|
+
_id: 0,
|
|
9
|
+
id: { $toString: '$_id' },
|
|
10
|
+
// 必要最低限にprojection(2024-04-23~)
|
|
11
|
+
data: 1,
|
|
12
|
+
name: 1,
|
|
13
|
+
status: 1,
|
|
14
|
+
project: 1,
|
|
15
|
+
runsAt: 1,
|
|
16
|
+
expires: 1
|
|
17
|
+
};
|
|
18
|
+
const AVAILABLE_PROJECT_FIELDS = [
|
|
19
|
+
'project',
|
|
20
|
+
'name',
|
|
21
|
+
'status',
|
|
22
|
+
'runsAt',
|
|
23
|
+
'lastTriedAt',
|
|
24
|
+
'executionResults',
|
|
25
|
+
'executor',
|
|
26
|
+
'data',
|
|
27
|
+
'dateAborted',
|
|
28
|
+
'expires'
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* 非同期アクションリポジトリ
|
|
32
|
+
*/
|
|
33
|
+
class AsyncActionRepo {
|
|
34
|
+
asyncActionModel;
|
|
35
|
+
constructor(connection) {
|
|
36
|
+
this.asyncActionModel = connection.model(asyncAction_1.modelName, (0, asyncAction_1.createSchema)());
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Readyタスクをひとつ追加する
|
|
40
|
+
*/
|
|
41
|
+
async addReadyAsyncAction(params) {
|
|
42
|
+
const { expires } = params;
|
|
43
|
+
if (!(expires instanceof Date)) {
|
|
44
|
+
throw new factory_1.factory.errors.Argument('expires', 'must be Date');
|
|
45
|
+
}
|
|
46
|
+
const savingTask = {
|
|
47
|
+
...params,
|
|
48
|
+
status: factory_1.factory.taskStatus.Ready,
|
|
49
|
+
executionResults: []
|
|
50
|
+
};
|
|
51
|
+
const result = await this.asyncActionModel.insertMany(savingTask, { rawResult: true });
|
|
52
|
+
const id = result.insertedIds?.[0]?.toHexString();
|
|
53
|
+
if (typeof id !== 'string') {
|
|
54
|
+
throw new factory_1.factory.errors.Internal('task not saved');
|
|
55
|
+
}
|
|
56
|
+
return { id };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Ready -> Running
|
|
60
|
+
*/
|
|
61
|
+
async executeAsyncActionById(params) {
|
|
62
|
+
const now = new Date();
|
|
63
|
+
const doc = await this.asyncActionModel.findOneAndUpdate({
|
|
64
|
+
_id: { $eq: params.id },
|
|
65
|
+
status: { $eq: factory_1.factory.taskStatus.Ready }, // Readyのものしか実行しない
|
|
66
|
+
runsAt: { $lt: now },
|
|
67
|
+
expires: { $gt: now }, // ワンタイムタスクなのでexpiresは必ず存在する
|
|
68
|
+
}, {
|
|
69
|
+
$set: {
|
|
70
|
+
status: factory_1.factory.taskStatus.Running, // 実行中に変更
|
|
71
|
+
lastTriedAt: now,
|
|
72
|
+
executor: params.executor
|
|
73
|
+
},
|
|
74
|
+
}, { new: true, projection: executableTaskProjection })
|
|
75
|
+
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
76
|
+
.lean() // lean(2024-09-26~)
|
|
77
|
+
.exec();
|
|
78
|
+
if (doc === null) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
return doc;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 非同期アクションの状態を参照する
|
|
85
|
+
*/
|
|
86
|
+
async findAsyncActionById(params, inclusion) {
|
|
87
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
88
|
+
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
89
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
// no op
|
|
93
|
+
}
|
|
94
|
+
const projection = {
|
|
95
|
+
_id: 0,
|
|
96
|
+
id: { $toString: '$_id' },
|
|
97
|
+
...Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1])))
|
|
98
|
+
};
|
|
99
|
+
const query = this.asyncActionModel.findOne({
|
|
100
|
+
_id: { $eq: params.id.$eq },
|
|
101
|
+
'project.id': { $eq: params.project.id.$eq },
|
|
102
|
+
name: { $eq: params.name }
|
|
103
|
+
}, projection);
|
|
104
|
+
const doc = await query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
105
|
+
.lean()
|
|
106
|
+
.exec();
|
|
107
|
+
if (doc === null) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
return doc;
|
|
111
|
+
}
|
|
112
|
+
// /**
|
|
113
|
+
// * Readyのままで期限切れのタスクをExpiredに変更する
|
|
114
|
+
// */
|
|
115
|
+
// public async makeExpiredMany(params: {
|
|
116
|
+
// expiresLt: Date;
|
|
117
|
+
// }): Promise<UpdateWriteOpResult> {
|
|
118
|
+
// const { expiresLt } = params;
|
|
119
|
+
// if (!(expiresLt instanceof Date)) {
|
|
120
|
+
// throw new factory.errors.Argument('expiresLt', 'must be Date');
|
|
121
|
+
// }
|
|
122
|
+
// return this.asyncActionModel.updateMany(
|
|
123
|
+
// {
|
|
124
|
+
// status: { $eq: factory.taskStatus.Ready },
|
|
125
|
+
// expires: { $lt: expiresLt }
|
|
126
|
+
// },
|
|
127
|
+
// {
|
|
128
|
+
// $set: {
|
|
129
|
+
// status: factory.taskStatus.Expired
|
|
130
|
+
// }
|
|
131
|
+
// }
|
|
132
|
+
// )
|
|
133
|
+
// .exec();
|
|
134
|
+
// }
|
|
135
|
+
// /**
|
|
136
|
+
// * taskNameに関わらず、Runningのまま放置された非同期アクションをAbortedに変更する
|
|
137
|
+
// */
|
|
138
|
+
// public async abortMany(params: {
|
|
139
|
+
// intervalInMinutes: number;
|
|
140
|
+
// }): Promise<UpdateWriteOpResult> {
|
|
141
|
+
// const lastTriedAtShoudBeLessThan = moment()
|
|
142
|
+
// .add(-params.intervalInMinutes, 'minutes')
|
|
143
|
+
// .toDate();
|
|
144
|
+
// return this.asyncActionModel.updateMany(
|
|
145
|
+
// {
|
|
146
|
+
// status: { $eq: factory.taskStatus.Running },
|
|
147
|
+
// lastTriedAt: {
|
|
148
|
+
// $exists: true,
|
|
149
|
+
// $lt: lastTriedAtShoudBeLessThan
|
|
150
|
+
// }
|
|
151
|
+
// },
|
|
152
|
+
// {
|
|
153
|
+
// $set: {
|
|
154
|
+
// status: factory.taskStatus.Aborted,
|
|
155
|
+
// dateAborted: new Date()
|
|
156
|
+
// }
|
|
157
|
+
// }
|
|
158
|
+
// )
|
|
159
|
+
// .exec();
|
|
160
|
+
// }
|
|
161
|
+
/**
|
|
162
|
+
* タスクIDから実行結果とステータスを保管する
|
|
163
|
+
* Abortedの場合、dateAbortedもセットする
|
|
164
|
+
*/
|
|
165
|
+
async setExecutionResultAndStatus(params, update) {
|
|
166
|
+
const { id } = params;
|
|
167
|
+
const { status, executionResult } = update;
|
|
168
|
+
await this.asyncActionModel.updateOne({ _id: { $eq: id } }, {
|
|
169
|
+
$set: {
|
|
170
|
+
status,
|
|
171
|
+
...(status === factory_1.factory.taskStatus.Aborted) ? { dateAborted: executionResult.endDate } : undefined // 2025-08-04~
|
|
172
|
+
},
|
|
173
|
+
$push: { executionResults: executionResult }
|
|
174
|
+
})
|
|
175
|
+
.exec();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.AsyncActionRepo = AsyncActionRepo;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { createClient } from 'redis';
|
|
2
2
|
import { AbstractConcurrentLockRepo, ILockParams, IUnlockParams } from './concurrentLockAbstract';
|
|
3
|
+
type RedisClientType = ReturnType<typeof createClient>;
|
|
3
4
|
/**
|
|
4
5
|
* 同時実行ロックリポジトリ
|
|
5
6
|
*/
|
|
@@ -12,3 +13,4 @@ export declare class ConcurrentLockRepo implements AbstractConcurrentLockRepo {
|
|
|
12
13
|
lock(params: ILockParams): Promise<void>;
|
|
13
14
|
unlock(params: IUnlockParams): Promise<void>;
|
|
14
15
|
}
|
|
16
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Connection, FilterQuery, Types } from 'mongoose';
|
|
1
|
+
import { Connection, FilterQuery, Types, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
3
|
import { IDocType } from './mongoose/schemas/creativeWork';
|
|
5
4
|
type IKeyOfProjection = keyof factory.creativeWork.movie.ICreativeWork;
|
|
@@ -32,7 +31,7 @@ export declare class CreativeWorkRepo {
|
|
|
32
31
|
[key in keyof factory.creativeWork.movie.ICreativeWork]?: 1;
|
|
33
32
|
};
|
|
34
33
|
}[]): Promise<{
|
|
35
|
-
bulkWriteResult?: BulkWriteResult;
|
|
34
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
36
35
|
}>;
|
|
37
36
|
/**
|
|
38
37
|
* コンテンツを検索する
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { COA } from '@motionpicture/coa-service';
|
|
2
|
-
import type {
|
|
2
|
+
import type { createClient } from 'redis';
|
|
3
3
|
interface IOptions {
|
|
4
4
|
scope: string;
|
|
5
5
|
expireInSeconds: number;
|
|
6
6
|
}
|
|
7
|
+
type RedisClientType = ReturnType<typeof createClient>;
|
|
7
8
|
/**
|
|
8
9
|
* 認証情報リポジトリ
|
|
9
10
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { Connection, FilterQuery } from 'mongoose';
|
|
1
|
+
import type { Connection, FilterQuery, mongo } from 'mongoose';
|
|
3
2
|
import { ICustomerType } from './mongoose/schemas/customerType';
|
|
4
3
|
import { factory } from '../factory';
|
|
5
4
|
type IKeyOfProjection = keyof ICustomerType;
|
|
@@ -17,6 +16,6 @@ export declare class CustomerTypeRepo {
|
|
|
17
16
|
saveManyByCodeValue(params: {
|
|
18
17
|
attributes: ICustomerType;
|
|
19
18
|
upsert?: boolean;
|
|
20
|
-
}[]): Promise<BulkWriteResult | undefined>;
|
|
19
|
+
}[]): Promise<mongo.BulkWriteResult | undefined>;
|
|
21
20
|
}
|
|
22
21
|
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Connection, FilterQuery } from 'mongoose';
|
|
1
|
+
import { Connection, FilterQuery, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
3
|
import * as EventFactory from '../factory/event';
|
|
5
4
|
export interface IAttributes4patchUpdate {
|
|
@@ -83,7 +82,7 @@ export declare class EventRepo {
|
|
|
83
82
|
*/
|
|
84
83
|
update: boolean;
|
|
85
84
|
}): Promise<{
|
|
86
|
-
bulkWriteResult?: BulkWriteResult;
|
|
85
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
87
86
|
modifiedEvents: {
|
|
88
87
|
id: string;
|
|
89
88
|
}[];
|
|
@@ -202,7 +201,7 @@ export declare class EventRepo {
|
|
|
202
201
|
organizer: {
|
|
203
202
|
id: string;
|
|
204
203
|
};
|
|
205
|
-
}): Promise<
|
|
204
|
+
}): Promise<mongo.DeleteResult>;
|
|
206
205
|
deleteManyEventsByScreeningRoom(params: {
|
|
207
206
|
project: {
|
|
208
207
|
id: string;
|
|
@@ -219,7 +218,7 @@ export declare class EventRepo {
|
|
|
219
218
|
id: string;
|
|
220
219
|
};
|
|
221
220
|
};
|
|
222
|
-
}): Promise<
|
|
221
|
+
}): Promise<mongo.DeleteResult>;
|
|
223
222
|
deleteManyBySuperEventId(params: {
|
|
224
223
|
project: {
|
|
225
224
|
id: string;
|
|
@@ -227,7 +226,7 @@ export declare class EventRepo {
|
|
|
227
226
|
superEvent: {
|
|
228
227
|
id: string;
|
|
229
228
|
};
|
|
230
|
-
}): Promise<
|
|
229
|
+
}): Promise<mongo.DeleteResult>;
|
|
231
230
|
deleteManyBySuperEventLocationId(params: {
|
|
232
231
|
project: {
|
|
233
232
|
id: string;
|
|
@@ -237,7 +236,7 @@ export declare class EventRepo {
|
|
|
237
236
|
id: string;
|
|
238
237
|
};
|
|
239
238
|
};
|
|
240
|
-
}): Promise<
|
|
239
|
+
}): Promise<mongo.DeleteResult>;
|
|
241
240
|
/**
|
|
242
241
|
* 興行(プロダクト)から削除する
|
|
243
242
|
*/
|
|
@@ -252,7 +251,7 @@ export declare class EventRepo {
|
|
|
252
251
|
};
|
|
253
252
|
};
|
|
254
253
|
};
|
|
255
|
-
}): Promise<
|
|
254
|
+
}): Promise<mongo.DeleteResult>;
|
|
256
255
|
deleteManyEventsEndedByProject(params: {
|
|
257
256
|
typeOf: {
|
|
258
257
|
$in: factory.eventType.ScreeningEvent[];
|
|
@@ -263,7 +262,7 @@ export declare class EventRepo {
|
|
|
263
262
|
endDate: {
|
|
264
263
|
$lte: Date;
|
|
265
264
|
};
|
|
266
|
-
}): Promise<
|
|
265
|
+
}): Promise<mongo.DeleteResult>;
|
|
267
266
|
deleteManyEventsEnded(params: {
|
|
268
267
|
typeOf: {
|
|
269
268
|
$eq: factory.eventType.ScreeningEvent;
|
|
@@ -271,7 +270,7 @@ export declare class EventRepo {
|
|
|
271
270
|
endDate: {
|
|
272
271
|
$lte: Date;
|
|
273
272
|
};
|
|
274
|
-
}): Promise<
|
|
273
|
+
}): Promise<mongo.DeleteResult>;
|
|
275
274
|
deleteByProject(params: {
|
|
276
275
|
project: {
|
|
277
276
|
id: string;
|
|
@@ -283,7 +282,7 @@ export declare class EventRepo {
|
|
|
283
282
|
updateAggregationById(params: {
|
|
284
283
|
id: string;
|
|
285
284
|
}, update: IUpdateAggregateReservationParams): Promise<void>;
|
|
286
|
-
bulkWrite(bulkWriteOps: any[]): Promise<BulkWriteResult & {
|
|
285
|
+
bulkWrite(bulkWriteOps: any[]): Promise<mongo.BulkWriteResult & {
|
|
287
286
|
mongoose?: {
|
|
288
287
|
validationErrors: import("mongoose").Error[];
|
|
289
288
|
} | undefined;
|