@chevre/domain 25.2.0-alpha.9 → 26.0.0-alpha.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/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.d.ts +16 -9
- package/lib/chevre/repo/action.js +99 -180
- package/lib/chevre/repo/adminTask.d.ts +37 -0
- package/lib/chevre/repo/adminTask.js +163 -0
- package/lib/chevre/repo/aggregateOffer.d.ts +3 -14
- package/lib/chevre/repo/aggregateOffer.js +16 -125
- package/lib/chevre/repo/aggregateTask.d.ts +37 -0
- package/lib/chevre/repo/aggregateTask.js +136 -0
- package/lib/chevre/repo/asyncAction.d.ts +69 -0
- package/lib/chevre/repo/asyncAction.js +237 -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/asyncAction.d.ts +13 -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/scheduledTasks.d.ts +16 -0
- package/lib/chevre/repo/mongoose/schemas/scheduledTasks.js +103 -0
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +4 -0
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +6 -1
- 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/scheduledTask.d.ts +90 -0
- package/lib/chevre/repo/scheduledTask.js +223 -0
- 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/task.d.ts +30 -71
- package/lib/chevre/repo/task.js +59 -345
- 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 +20 -0
- package/lib/chevre/repository.js +46 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/aggregation/system.d.ts +2 -2
- package/lib/chevre/service/aggregation/system.js +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/exportTasksById.js +1 -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/assetTransaction/refund.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/exportTasksById.js +1 -1
- package/lib/chevre/service/assetTransaction/reserveCOA/cancel.js +1 -67
- 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 +12 -6
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +12 -4
- 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/event/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/offer/event/voidTransactionByActionId.d.ts +1 -1
- 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 +20 -9
- package/lib/chevre/service/offer/onEventChanged.js +2 -2
- package/lib/chevre/service/order/confirmPayTransaction.js +1 -1
- 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/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +3 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.d.ts +0 -3
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +73 -44
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.d.ts +5 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/createSendEmailMessageTaskIfNotExist.js +53 -33
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +6 -4
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +3 -7
- package/lib/chevre/service/order/onOrderUpdated.js +1 -1
- 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 +7 -5
- package/lib/chevre/service/payment/any/factory.d.ts +7 -7
- package/lib/chevre/service/payment/any/factory.js +18 -21
- package/lib/chevre/service/payment/any/findAcceptAction.d.ts +7 -1
- package/lib/chevre/service/payment/any/findAcceptAction.js +34 -15
- package/lib/chevre/service/payment/any/findAuthorizeAction.d.ts +4 -0
- package/lib/chevre/service/payment/any/findAuthorizeAction.js +20 -9
- package/lib/chevre/service/payment/any/findCheckAction.d.ts +4 -0
- package/lib/chevre/service/payment/any/findCheckAction.js +20 -9
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.d.ts +2 -0
- package/lib/chevre/service/payment/any/invalidatePaymentUrl.js +5 -67
- package/lib/chevre/service/payment/any/onPayActionCompleted.js +1 -1
- package/lib/chevre/service/payment/any/onRefundActionCompletedOrFailed.js +1 -1
- 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/onPendingReservationCanceled.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +20 -11
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +1 -1
- 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/scheduledTask.d.ts +11 -0
- package/lib/chevre/service/scheduledTask.js +40 -0
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.d.ts +14 -0
- package/lib/chevre/service/scheduledTaskHandler/onOperationFailed.js +56 -0
- package/lib/chevre/service/scheduledTaskHandler.d.ts +12 -0
- package/lib/chevre/service/scheduledTaskHandler.js +66 -0
- 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 +3 -8
- 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 +2 -2
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onOfferCatalogUpdated.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.d.ts +2 -2
- package/lib/chevre/service/task/onResourceUpdated.js +10 -9
- 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/returnPayTransaction.js +1 -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/task/voidReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/taskHandler/onOperationFailed/informTaskIfNeeded.js +1 -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.d.ts +1 -1
- 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 +32 -4
- package/lib/chevre/service/transaction/placeOrder/confirm/prepareUnitPriceOfferConditions.js +10 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +5 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +6 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +23 -9
- package/lib/chevre/service/transaction/placeOrder/confirm.d.ts +6 -5
- package/lib/chevre/service/transaction/placeOrder/confirm.js +30 -40
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
- 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/transaction/returnOrder.js +1 -1
- package/lib/chevre/service.d.ts +8 -0
- package/lib/chevre/service.js +23 -1
- package/lib/chevre/taskSettings.d.ts +3 -4
- 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
|
@@ -27,6 +27,7 @@ const schemaDefinition = {
|
|
|
27
27
|
dateReturned: Date,
|
|
28
28
|
orderedItem: [mongoose_1.SchemaTypes.Mixed],
|
|
29
29
|
identifier: { type: String, required: true }, // 注文取引IDとして再定義(2026-06-22~)
|
|
30
|
+
paymentMethodId: { type: String, required: false }, // 注文取引から移行(2026-07-12~)
|
|
30
31
|
// 以下廃止(2026-06-13~)
|
|
31
32
|
// identifier: SchemaTypes.Mixed, // 廃止するためにMixed化(2026-06-12~)
|
|
32
33
|
// isGift: Boolean,
|
|
@@ -343,6 +344,15 @@ const indexes = [
|
|
|
343
344
|
}
|
|
344
345
|
}
|
|
345
346
|
],
|
|
347
|
+
[
|
|
348
|
+
{ paymentMethodId: 1, orderDate: -1 },
|
|
349
|
+
{
|
|
350
|
+
name: 'paymentMethodId',
|
|
351
|
+
partialFilterExpression: {
|
|
352
|
+
paymentMethodId: { $exists: true }
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
],
|
|
346
356
|
[
|
|
347
357
|
{ price: 1, orderDate: -1 },
|
|
348
358
|
{
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
+
import { IVirtuals } from '../virtuals';
|
|
3
|
+
import { factory } from '../../../factory';
|
|
4
|
+
type IDocType = Pick<factory.task.ITask<factory.taskName>, 'data' | 'dateAborted' | 'executionResults' | 'description' | 'executor' | 'lastTriedAt' | 'name' | 'numberOfTried' | 'project' | 'remainingNumberOfTries' | 'runsAt' | 'status'> & {
|
|
5
|
+
/**
|
|
6
|
+
* ttlの基準にするので必須
|
|
7
|
+
*/
|
|
8
|
+
expires: Date;
|
|
9
|
+
};
|
|
10
|
+
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
11
|
+
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
12
|
+
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
13
|
+
declare const modelName = "ScheduledTask";
|
|
14
|
+
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
15
|
+
declare function createSchema(): ISchema;
|
|
16
|
+
export { createSchema, IDocType, IModel, indexes, modelName };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.modelName = exports.indexes = void 0;
|
|
4
|
+
exports.createSchema = createSchema;
|
|
5
|
+
const mongoose_1 = require("mongoose");
|
|
6
|
+
const writeConcern_1 = require("../writeConcern");
|
|
7
|
+
const settings_1 = require("../../../settings");
|
|
8
|
+
const modelName = 'ScheduledTask';
|
|
9
|
+
exports.modelName = modelName;
|
|
10
|
+
const schemaDefinition = {
|
|
11
|
+
description: String, // add(2025-03-30~)
|
|
12
|
+
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
13
|
+
name: { type: String, required: true },
|
|
14
|
+
status: { type: String, required: true },
|
|
15
|
+
runsAt: { type: Date, required: true },
|
|
16
|
+
expires: { type: Date, required: true },
|
|
17
|
+
remainingNumberOfTries: { type: Number, required: true },
|
|
18
|
+
numberOfTried: { type: Number, required: true },
|
|
19
|
+
lastTriedAt: Date,
|
|
20
|
+
executionResults: [mongoose_1.SchemaTypes.Mixed],
|
|
21
|
+
executor: mongoose_1.SchemaTypes.Mixed,
|
|
22
|
+
data: mongoose_1.SchemaTypes.Mixed,
|
|
23
|
+
dateAborted: Date,
|
|
24
|
+
};
|
|
25
|
+
const schemaOptions = {
|
|
26
|
+
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
27
|
+
autoCreate: false,
|
|
28
|
+
collection: 'scheduledTasks',
|
|
29
|
+
id: true,
|
|
30
|
+
read: 'primary',
|
|
31
|
+
writeConcern: writeConcern_1.writeConcern,
|
|
32
|
+
strict: true,
|
|
33
|
+
strictQuery: false,
|
|
34
|
+
timestamps: false,
|
|
35
|
+
versionKey: false,
|
|
36
|
+
toJSON: {
|
|
37
|
+
getters: false,
|
|
38
|
+
virtuals: false,
|
|
39
|
+
minimize: false,
|
|
40
|
+
versionKey: false
|
|
41
|
+
},
|
|
42
|
+
toObject: {
|
|
43
|
+
getters: false,
|
|
44
|
+
virtuals: true,
|
|
45
|
+
minimize: false,
|
|
46
|
+
versionKey: false
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const EXPIRE_AFTER_SECONDS = 0;
|
|
50
|
+
const indexes = [
|
|
51
|
+
[
|
|
52
|
+
{ expires: 1 },
|
|
53
|
+
{
|
|
54
|
+
name: 'ttlByExpires',
|
|
55
|
+
expireAfterSeconds: EXPIRE_AFTER_SECONDS
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
{ runsAt: -1 },
|
|
60
|
+
{ name: 'runsAt' }
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
{ 'project.id': 1, runsAt: -1 },
|
|
64
|
+
{ name: 'projectId' }
|
|
65
|
+
],
|
|
66
|
+
[
|
|
67
|
+
{ name: 1, runsAt: -1 },
|
|
68
|
+
{ name: 'scheduledTaskName' }
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
{ status: 1, runsAt: -1 },
|
|
72
|
+
{ name: 'status' }
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
{ status: 1, name: 1, runsAt: 1 },
|
|
76
|
+
{ name: 'runScheduledTaskIfExists' }
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
{ status: 1, remainingNumberOfTries: 1, lastTriedAt: 1 },
|
|
80
|
+
{
|
|
81
|
+
name: 'retryOrAbortScheduledTasks',
|
|
82
|
+
partialFilterExpression: {
|
|
83
|
+
lastTriedAt: { $exists: true }
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
];
|
|
88
|
+
exports.indexes = indexes;
|
|
89
|
+
/**
|
|
90
|
+
* 予定タスクスキーマ
|
|
91
|
+
*/
|
|
92
|
+
let schema;
|
|
93
|
+
function createSchema() {
|
|
94
|
+
if (schema === undefined) {
|
|
95
|
+
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
96
|
+
if (settings_1.MONGO_AUTO_INDEX) {
|
|
97
|
+
indexes.forEach((indexParams) => {
|
|
98
|
+
schema?.index(...indexParams);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return schema;
|
|
103
|
+
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../virtuals';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
type IDocType = Omit<factory.task.ITask<factory.taskName>, 'id'
|
|
4
|
+
type IDocType = Omit<factory.task.ITask<factory.taskName>, 'id'> & {
|
|
5
|
+
/**
|
|
6
|
+
* 非同期アクション移行前のタスクには残っている(2026-07-29時点)
|
|
7
|
+
*/
|
|
8
|
+
expires?: Date;
|
|
9
|
+
};
|
|
5
10
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
6
11
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
7
12
|
type ISchema = Schema<IDocType, IModel, Record<string, never>, Record<string, never>, IVirtuals, Record<string, never>, ISchemaDefinition, IDocType>;
|
|
@@ -214,19 +214,19 @@ const indexes = [
|
|
|
214
214
|
alternateName: { $exists: true }
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
+
],
|
|
218
|
+
// add unique index(dev)(2025-03-28~)
|
|
219
|
+
// add unique index(test,prod)(2026-07-08~)
|
|
220
|
+
[
|
|
221
|
+
{ identifier: 1 },
|
|
222
|
+
{
|
|
223
|
+
unique: true,
|
|
224
|
+
name: 'uniqueIdentifier',
|
|
225
|
+
partialFilterExpression: {
|
|
226
|
+
identifier: { $exists: true }
|
|
227
|
+
}
|
|
228
|
+
}
|
|
217
229
|
]
|
|
218
|
-
// eslint-disable-next-line no-warning-comments
|
|
219
|
-
// TODO add unique index(2025-03-28~)
|
|
220
|
-
// [
|
|
221
|
-
// { identifier: 1 },
|
|
222
|
-
// {
|
|
223
|
-
// unique: true,
|
|
224
|
-
// name: 'uniqueIdentifier',
|
|
225
|
-
// partialFilterExpression: {
|
|
226
|
-
// identifier: { $exists: true }
|
|
227
|
-
// }
|
|
228
|
-
// }
|
|
229
|
-
// ]
|
|
230
230
|
];
|
|
231
231
|
exports.indexes = indexes;
|
|
232
232
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Connection, FilterQuery } from 'mongoose';
|
|
1
|
+
import type { Connection, FilterQuery, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
3
|
type INoteDigitalDocument = factory.creativeWork.noteDigitalDocument.INoteDigitalDocument;
|
|
5
4
|
type IKeyOfProjection = keyof INoteDigitalDocument;
|
|
@@ -29,7 +28,7 @@ export declare class NoteRepo {
|
|
|
29
28
|
*/
|
|
30
29
|
update: boolean;
|
|
31
30
|
}): Promise<{
|
|
32
|
-
bulkWriteResult?: BulkWriteResult;
|
|
31
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
33
32
|
modifiedNotes?: {
|
|
34
33
|
id: string;
|
|
35
34
|
}[];
|
|
@@ -42,7 +41,7 @@ export declare class NoteRepo {
|
|
|
42
41
|
id: string;
|
|
43
42
|
typeOf: factory.creativeWork.noteDigitalDocument.IAbout['typeOf'];
|
|
44
43
|
};
|
|
45
|
-
}): Promise<DeleteResult>;
|
|
44
|
+
}): Promise<mongo.DeleteResult>;
|
|
46
45
|
unsetUnnecessaryFields(params: {
|
|
47
46
|
filter: any;
|
|
48
47
|
$unset: any;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Connection, FilterQuery } from 'mongoose';
|
|
1
|
+
import type { Connection, FilterQuery, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
3
|
type INoteAboutOrder = factory.creativeWork.noteDigitalDocument.INoteAboutOrder;
|
|
5
4
|
type IKeyOfProjection = keyof INoteAboutOrder;
|
|
@@ -21,7 +20,7 @@ export declare class NoteAboutOrderRepo {
|
|
|
21
20
|
*/
|
|
22
21
|
upsertOrderNoteByIdentifier(params: Pick<INoteAboutOrder, 'about' | 'creator' | 'identifier' | 'project' | 'provider' | 'text' | 'version'>[], options: {
|
|
23
22
|
overwrite: boolean;
|
|
24
|
-
}): Promise<BulkWriteResult | undefined>;
|
|
23
|
+
}): Promise<mongo.BulkWriteResult | undefined>;
|
|
25
24
|
updateById(params: {
|
|
26
25
|
id: string;
|
|
27
26
|
attributes: Pick<INoteAboutOrder, 'text' | 'editor'>;
|
|
@@ -128,7 +128,7 @@ declare abstract class OfferInCatalogReadOnlyRepo {
|
|
|
128
128
|
*/
|
|
129
129
|
id: string;
|
|
130
130
|
}[]>;
|
|
131
|
-
abstract
|
|
132
|
-
abstract
|
|
131
|
+
abstract countUnitPriceOffers(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
|
|
132
|
+
abstract findUnitPriceOffers(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<IOfferInCatalog[]>;
|
|
133
133
|
}
|
|
134
134
|
export { KeyOfOffer, IProjection, IOfferInCatalog, IPriceSpecificationConditionsOnSearchWithSortIndex, OfferInCatalogReadOnlyRepo };
|
|
@@ -137,8 +137,8 @@ export declare class OfferRepo implements OfferInCatalogReadOnlyRepo {
|
|
|
137
137
|
};
|
|
138
138
|
unacceptedPaymentMethod: string[];
|
|
139
139
|
}): Promise<boolean>;
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
countUnitPriceOffers(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
|
|
141
|
+
findUnitPriceOffers(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection): Promise<IOfferInCatalog[]>;
|
|
142
142
|
/**
|
|
143
143
|
* サブカタログから集計オファーIDリストを検索する
|
|
144
144
|
*/
|
|
@@ -109,7 +109,7 @@ class OfferRepo {
|
|
|
109
109
|
const searchOffersConditions = {
|
|
110
110
|
parentOffer: { id: { $in: sortedOfferIds } }
|
|
111
111
|
};
|
|
112
|
-
offers = await this.
|
|
112
|
+
offers = await this.findUnitPriceOffers(searchOffersConditions, params.projection);
|
|
113
113
|
}
|
|
114
114
|
return { offers };
|
|
115
115
|
}
|
|
@@ -165,7 +165,7 @@ class OfferRepo {
|
|
|
165
165
|
? { availableAtOrFrom: { id: { $eq: params.availableAtOrFrom.id } } } // store.idでのフィルターをmongoで処理(2023-01-27~)
|
|
166
166
|
: undefined
|
|
167
167
|
};
|
|
168
|
-
offers = await this.
|
|
168
|
+
offers = await this.findUnitPriceOffers(searchOffersConditions, params.projection);
|
|
169
169
|
}
|
|
170
170
|
return offers;
|
|
171
171
|
}
|
|
@@ -227,7 +227,7 @@ class OfferRepo {
|
|
|
227
227
|
...(typeof params.limit === 'number') ? { limit: params.limit } : undefined,
|
|
228
228
|
...(typeof params.page === 'number') ? { page: params.page } : undefined
|
|
229
229
|
};
|
|
230
|
-
offers = await this.
|
|
230
|
+
offers = await this.findUnitPriceOffers(searchOffersConditions, params.projection);
|
|
231
231
|
}
|
|
232
232
|
return { offers, sortedOfferIds };
|
|
233
233
|
}
|
|
@@ -370,12 +370,13 @@ class OfferRepo {
|
|
|
370
370
|
.exec();
|
|
371
371
|
return doc !== null;
|
|
372
372
|
}
|
|
373
|
-
async
|
|
373
|
+
async countUnitPriceOffers(params) {
|
|
374
374
|
const matchStages = aggregateOffer_1.AggregateOfferRepo.CREATE_MATCH_STAGE(params);
|
|
375
375
|
const result = await this.aggregateOfferModel.aggregate([
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
}
|
|
376
|
+
// // offers.length:1の前提であるため、unwindは不要(2026-07-23~)
|
|
377
|
+
// {
|
|
378
|
+
// $unwind: { path: '$offers' }
|
|
379
|
+
// },
|
|
379
380
|
...matchStages,
|
|
380
381
|
{
|
|
381
382
|
$count: 'offerCount'
|
|
@@ -384,19 +385,63 @@ class OfferRepo {
|
|
|
384
385
|
.exec();
|
|
385
386
|
return (result.length > 0) ? result[0].offerCount : 0;
|
|
386
387
|
}
|
|
387
|
-
|
|
388
|
+
// findUnitPriceOffersへ移行(2026-07-23~)
|
|
389
|
+
// /**
|
|
390
|
+
// * @deprecated use findUnitPriceOffers
|
|
391
|
+
// */
|
|
392
|
+
// public async search(
|
|
393
|
+
// params: factory.unitPriceOffer.ISearchConditions,
|
|
394
|
+
// projection?: IProjection
|
|
395
|
+
// ): Promise<IOfferInCatalog[]> {
|
|
396
|
+
// const matchStages = AggregateOfferRepo.CREATE_MATCH_STAGE(params);
|
|
397
|
+
// const projectStage = OfferRepo.CREATE_AGGREGATE_OFFERS_PROJECTION({ ...projection });
|
|
398
|
+
// const sortByPrice = params.sort?.['priceSpecification.price'];
|
|
399
|
+
// const sortByIdentifier = params.sort?.identifier;
|
|
400
|
+
// const aggregate = this.aggregateOfferModel.aggregate<IOfferInCatalog>([
|
|
401
|
+
// {
|
|
402
|
+
// $unwind: {
|
|
403
|
+
// path: '$offers',
|
|
404
|
+
// includeArrayIndex: OFFERS_ARRAY_INDEX_NAME
|
|
405
|
+
// }
|
|
406
|
+
// },
|
|
407
|
+
// ...matchStages,
|
|
408
|
+
// ...(typeof sortByPrice === 'number' || typeof sortByIdentifier === 'number')
|
|
409
|
+
// ? [
|
|
410
|
+
// {
|
|
411
|
+
// $sort: {
|
|
412
|
+
// ...(typeof sortByPrice === 'number')
|
|
413
|
+
// ? { 'offers.priceSpecification.price': sortByPrice }
|
|
414
|
+
// : undefined,
|
|
415
|
+
// ...(typeof sortByIdentifier === 'number')
|
|
416
|
+
// ? { 'offers.identifier': sortByIdentifier }
|
|
417
|
+
// : undefined
|
|
418
|
+
// }
|
|
419
|
+
// }
|
|
420
|
+
// ]
|
|
421
|
+
// : [],
|
|
422
|
+
// { $project: projectStage }
|
|
423
|
+
// ]);
|
|
424
|
+
// /* istanbul ignore else */
|
|
425
|
+
// if (typeof params.limit === 'number' && params.limit > 0) {
|
|
426
|
+
// const page: number = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
427
|
+
// aggregate.limit(params.limit * page)
|
|
428
|
+
// .skip(params.limit * (page - 1));
|
|
429
|
+
// }
|
|
430
|
+
// return aggregate.exec();
|
|
431
|
+
// }
|
|
432
|
+
async findUnitPriceOffers(params, projection) {
|
|
388
433
|
const matchStages = aggregateOffer_1.AggregateOfferRepo.CREATE_MATCH_STAGE(params);
|
|
389
434
|
const projectStage = OfferRepo.CREATE_AGGREGATE_OFFERS_PROJECTION({ ...projection });
|
|
390
435
|
const sortByPrice = params.sort?.['priceSpecification.price'];
|
|
391
436
|
const sortByIdentifier = params.sort?.identifier;
|
|
392
437
|
const aggregate = this.aggregateOfferModel.aggregate([
|
|
438
|
+
...matchStages, // match -> unwind(2026-07-23~)
|
|
393
439
|
{
|
|
394
440
|
$unwind: {
|
|
395
441
|
path: '$offers',
|
|
396
442
|
includeArrayIndex: OFFERS_ARRAY_INDEX_NAME
|
|
397
443
|
}
|
|
398
444
|
},
|
|
399
|
-
...matchStages,
|
|
400
445
|
...(typeof sortByPrice === 'number' || typeof sortByIdentifier === 'number')
|
|
401
446
|
? [
|
|
402
447
|
{
|
|
@@ -416,8 +461,11 @@ class OfferRepo {
|
|
|
416
461
|
/* istanbul ignore else */
|
|
417
462
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
418
463
|
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
419
|
-
|
|
420
|
-
|
|
464
|
+
// support skip -> limit(2026-07-23~)
|
|
465
|
+
// aggregate.limit(params.limit * page)
|
|
466
|
+
// .skip(params.limit * (page - 1));
|
|
467
|
+
aggregate.skip(params.limit * (page - 1))
|
|
468
|
+
.limit(params.limit);
|
|
421
469
|
}
|
|
422
470
|
return aggregate.exec();
|
|
423
471
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Connection, FilterQuery } from 'mongoose';
|
|
1
|
+
import type { Connection, FilterQuery, mongo } from 'mongoose';
|
|
3
2
|
import { factory } from '../factory';
|
|
4
3
|
import { IDocType } from './mongoose/schemas/offerCatalog';
|
|
5
4
|
export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty'> & {
|
|
@@ -49,7 +48,7 @@ export declare class OfferCatalogRepo {
|
|
|
49
48
|
*/
|
|
50
49
|
itemListElementType: factory.offerCatalog.IItemListElement['typeOf'];
|
|
51
50
|
}): Promise<{
|
|
52
|
-
bulkWriteResult?: BulkWriteResult;
|
|
51
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
53
52
|
modifiedCatalogs?: {
|
|
54
53
|
id: string;
|
|
55
54
|
}[];
|
|
@@ -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
|
export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty' | 'relatedOffer'> & {
|
|
5
4
|
numberOfItems?: number;
|
|
@@ -42,7 +41,7 @@ export declare class OfferCatalogItemRepo {
|
|
|
42
41
|
*/
|
|
43
42
|
productType: factory.product.ProductType;
|
|
44
43
|
}): Promise<{
|
|
45
|
-
bulkWriteResult?: BulkWriteResult;
|
|
44
|
+
bulkWriteResult?: mongo.BulkWriteResult;
|
|
46
45
|
modifiedCatalogs?: {
|
|
47
46
|
id: string;
|
|
48
47
|
}[];
|
|
@@ -135,6 +135,7 @@ export declare class OrderRepo {
|
|
|
135
135
|
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.order.IOrder, "id"> & {
|
|
136
136
|
acceptedOffers?: factory.order.IAcceptedOffer[];
|
|
137
137
|
identifier?: string;
|
|
138
|
+
paymentMethodId?: string;
|
|
138
139
|
} & {
|
|
139
140
|
_id: import("mongoose").Types.ObjectId;
|
|
140
141
|
} & {
|
|
@@ -142,6 +143,7 @@ export declare class OrderRepo {
|
|
|
142
143
|
}, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<factory.order.IOrder, "id"> & {
|
|
143
144
|
acceptedOffers?: factory.order.IAcceptedOffer[];
|
|
144
145
|
identifier?: string;
|
|
146
|
+
paymentMethodId?: string;
|
|
145
147
|
} & {
|
|
146
148
|
_id: import("mongoose").Types.ObjectId;
|
|
147
149
|
} & {
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -848,24 +848,24 @@ class OrderRepo {
|
|
|
848
848
|
})
|
|
849
849
|
.exec();
|
|
850
850
|
}
|
|
851
|
-
// public async
|
|
852
|
-
//
|
|
853
|
-
//
|
|
854
|
-
// identifier: string;
|
|
851
|
+
// public async savePaymentMethodId4migaration(params: {
|
|
852
|
+
// id: string;
|
|
853
|
+
// paymentMethod: IPaymentMethodByPaymentUrl;
|
|
855
854
|
// }) {
|
|
856
|
-
// const {
|
|
857
|
-
//
|
|
855
|
+
// const { paymentMethodId } = params.paymentMethod;
|
|
856
|
+
// if (typeof paymentMethodId !== 'string' || paymentMethodId === '') {
|
|
857
|
+
// throw new factory.errors.ArgumentNull('paymentMethod.paymentMethodId');
|
|
858
|
+
// }
|
|
859
|
+
// // 注文ドキュメントにも保管する(2026-07-12~)
|
|
860
|
+
// return this.orderModel.findOneAndUpdate(
|
|
858
861
|
// {
|
|
859
|
-
//
|
|
860
|
-
//
|
|
861
|
-
// typeOf: { $eq: factory.order.OrderType.Order }
|
|
862
|
+
// identifier: { $eq: params.id },
|
|
863
|
+
// paymentMethodId: { $exists: false }
|
|
862
864
|
// },
|
|
863
|
-
// {
|
|
864
|
-
//
|
|
865
|
-
// ...(typeof identifier === 'string') ? { identifier } : undefined
|
|
866
|
-
// }
|
|
867
|
-
// }
|
|
865
|
+
// { $set: { paymentMethodId } },
|
|
866
|
+
// { projection: { _id: 1 } }
|
|
868
867
|
// )
|
|
868
|
+
// .lean()
|
|
869
869
|
// .exec();
|
|
870
870
|
// }
|
|
871
871
|
async aggregateOrder(params) {
|
|
@@ -11,14 +11,25 @@ export type IOrderInTransaction = Pick<factory.order.IOrder, 'orderNumber' | 'pr
|
|
|
11
11
|
acceptedOffers: factory.order.IAcceptedOffer[];
|
|
12
12
|
customer?: factory.order.ICustomer;
|
|
13
13
|
seller?: factory.order.ISeller;
|
|
14
|
+
confirmationNumber?: string;
|
|
14
15
|
};
|
|
15
16
|
/**
|
|
16
17
|
* typeOf: Orderへドキュメント変換時の編集フィールド
|
|
17
18
|
*/
|
|
18
|
-
export type IPlacingOrder = Pick<factory.order.IOrder, '
|
|
19
|
+
export type IPlacingOrder = Pick<factory.order.IOrder, 'orderDate' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | 'typeOf'> & {
|
|
19
20
|
url?: never;
|
|
20
21
|
identifier?: never;
|
|
21
22
|
name?: never;
|
|
23
|
+
/**
|
|
24
|
+
* 上書きしてはいけない
|
|
25
|
+
* 注文取引進行中にセット済であり上書きしてはいけない
|
|
26
|
+
*/
|
|
27
|
+
orderNumber?: never;
|
|
28
|
+
/**
|
|
29
|
+
* 上書きしてはいけない
|
|
30
|
+
* 注文取引進行中にセット済であり上書きしてはいけない
|
|
31
|
+
*/
|
|
32
|
+
confirmationNumber?: never;
|
|
22
33
|
/**
|
|
23
34
|
* 上書きしてはいけない
|
|
24
35
|
*/
|
|
@@ -56,11 +67,19 @@ export type IMinimizedAcceptedOffer = Pick<factory.order.IOptimizedAcceptedOffer
|
|
|
56
67
|
priceSpecification?: never;
|
|
57
68
|
name?: never;
|
|
58
69
|
};
|
|
70
|
+
export interface IPaymentMethodByPaymentUrl {
|
|
71
|
+
/**
|
|
72
|
+
* 決済採用時に発行済の決済方法ID
|
|
73
|
+
* 決済承認時に指定が可能
|
|
74
|
+
*/
|
|
75
|
+
paymentMethodId: string;
|
|
76
|
+
}
|
|
59
77
|
/**
|
|
60
78
|
* 取引中注文リポジトリ
|
|
61
79
|
*/
|
|
62
80
|
export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
63
81
|
private readonly orderModel;
|
|
82
|
+
private readonly transactionModel;
|
|
64
83
|
constructor(connection: Connection);
|
|
65
84
|
createPlaceOrderIfNotExists(params: Pick<IOrderInTransaction, 'orderNumber' | 'project' | 'identifier' | 'broker' | 'seller' | 'customer'>): Promise<import("mongoose").UpdateWriteOpResult | undefined>;
|
|
66
85
|
/**
|
|
@@ -94,6 +113,11 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
|
94
113
|
project: {
|
|
95
114
|
id: string;
|
|
96
115
|
};
|
|
116
|
+
}, options: {
|
|
117
|
+
/**
|
|
118
|
+
* 注文取引タイプのドキュメントのみを参照対象にするかどうか
|
|
119
|
+
*/
|
|
120
|
+
onlyPlaceOrder: boolean;
|
|
97
121
|
}): Promise<(Pick<factory.order.IAcceptedOffer, 'id' | 'itemOffered' | 'offeredThrough' | 'serialNumber' | 'typeOf'> & {
|
|
98
122
|
priceSpecification?: factory.order.ITicketPriceSpecification;
|
|
99
123
|
})[]>;
|
|
@@ -127,6 +151,49 @@ export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
|
127
151
|
setCustomerByIdentifier(params: Pick<IOrderInTransaction, 'project' | 'identifier'> & {
|
|
128
152
|
customer: factory.order.ICustomer;
|
|
129
153
|
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
154
|
+
/**
|
|
155
|
+
* 確認番号を参照する
|
|
156
|
+
*/
|
|
157
|
+
findConfirmationNumberByIdentifier(params: {
|
|
158
|
+
identifier: string;
|
|
159
|
+
}): Promise<string | undefined>;
|
|
160
|
+
/**
|
|
161
|
+
* 注文ドキュメントに確認番号を保管する
|
|
162
|
+
* 確認番号未発行の場合のみ保管される
|
|
163
|
+
*/
|
|
164
|
+
saveConfirmationNumberIfNotExist(params: {
|
|
165
|
+
identifier: string;
|
|
166
|
+
confirmationNumber: string;
|
|
167
|
+
}, options: {
|
|
168
|
+
/**
|
|
169
|
+
* 注文取引タイプのドキュメントのみを参照対象にするかどうか
|
|
170
|
+
*/
|
|
171
|
+
onlyPlaceOrder: boolean;
|
|
172
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
173
|
+
/**
|
|
174
|
+
* 特定の進行中取引の決済方法IDを保管する
|
|
175
|
+
* transactionsへの保管としてひとまず定義(2026-07-11~)
|
|
176
|
+
*/
|
|
177
|
+
savePaymentMethodId(params: {
|
|
178
|
+
id: string;
|
|
179
|
+
paymentMethod: IPaymentMethodByPaymentUrl;
|
|
180
|
+
}, options: {
|
|
181
|
+
savePaymentMethodIdInTransaction: boolean;
|
|
182
|
+
}): Promise<void>;
|
|
183
|
+
/**
|
|
184
|
+
* 進行中取引に保管された採用済決済方法を検索する
|
|
185
|
+
* 注文ドキュメントから参照する(2026-07-13~)
|
|
186
|
+
*/
|
|
187
|
+
findInProgressPaymentMethodId(params: {
|
|
188
|
+
id: string;
|
|
189
|
+
}): Promise<string | undefined>;
|
|
190
|
+
/**
|
|
191
|
+
* 保管された採用済決済方法を検索する
|
|
192
|
+
* 注文ドキュメントから参照する(2026-07-13~)
|
|
193
|
+
*/
|
|
194
|
+
findPaymentMethodId(params: {
|
|
195
|
+
id: string;
|
|
196
|
+
}): Promise<string | undefined>;
|
|
130
197
|
deleteByIdentifier(params: {
|
|
131
198
|
identifier: string;
|
|
132
199
|
}): Promise<import("mongodb").DeleteResult>;
|