@chevre/domain 24.1.0-alpha.4 → 24.1.0-alpha.41
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/README.md +0 -2
- package/lib/chevre/emailMessageBuilder.js +4 -12
- package/lib/chevre/index.d.ts +1 -2
- package/lib/chevre/index.js +1 -3
- package/lib/chevre/repo/acceptedOffer.d.ts +14 -13
- package/lib/chevre/repo/acceptedOffer.js +128 -51
- package/lib/chevre/repo/acceptedOfferInReserve.d.ts +32 -0
- package/lib/chevre/repo/acceptedOfferInReserve.js +84 -0
- package/lib/chevre/repo/accountingReport.d.ts +9 -2
- package/lib/chevre/repo/accountingReport.js +6 -34
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/assetTransaction/reserve.d.ts +0 -1
- package/lib/chevre/repo/assetTransaction/reserve.js +4 -50
- package/lib/chevre/repo/event.js +12 -8
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.d.ts +7 -0
- package/lib/chevre/repo/factory/acceptedOffer/reserveTransaction2itemOffered.js +74 -0
- package/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +1 -1
- package/lib/chevre/repo/factory/reservation/createMongoConditions.js +171 -362
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +42 -42
- package/lib/chevre/repo/mongoose/schemas/order.js +108 -108
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +3 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.js +128 -146
- package/lib/chevre/repo/mongoose/schemas/setting.d.ts +65 -0
- package/lib/chevre/repo/mongoose/schemas/setting.js +2 -1
- package/lib/chevre/repo/order.d.ts +2 -83
- package/lib/chevre/repo/order.js +171 -364
- package/lib/chevre/repo/orderInTransaction.d.ts +48 -6
- package/lib/chevre/repo/orderInTransaction.js +58 -4
- package/lib/chevre/repo/place/hasPOS.js +2 -1
- package/lib/chevre/repo/reservation.d.ts +20 -7
- package/lib/chevre/repo/reservation.js +16 -12
- package/lib/chevre/repo/role.d.ts +1 -15
- package/lib/chevre/repo/role.js +7 -14
- package/lib/chevre/repo/setting/integration.d.ts +26 -0
- package/lib/chevre/repo/setting/integration.js +94 -0
- package/lib/chevre/repo/transaction.d.ts +6 -6
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +11 -0
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +6 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +0 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +14 -11
- package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/check.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorize.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeCreditCard.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/processAuthorizeMovieTicket.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/cancel.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/confirm.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +0 -12
- package/lib/chevre/service/assetTransaction/reserve/start/factory/price.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +1 -1
- package/lib/chevre/service/delivery/factory.d.ts +6 -1
- package/lib/chevre/service/delivery/factory.js +1 -1
- package/lib/chevre/service/delivery/reservation/factory.d.ts +1 -3
- package/lib/chevre/service/delivery/reservation/factory.js +0 -17
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.d.ts +2 -4
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +3 -3
- package/lib/chevre/service/notification/notifyByEmail.d.ts +3 -3
- package/lib/chevre/service/notification/notifyByEmail.js +7 -12
- package/lib/chevre/service/notification/sendEmailMessage.d.ts +2 -3
- package/lib/chevre/service/notification/sendEmailMessage.js +5 -4
- package/lib/chevre/service/offer/any.d.ts +7 -2
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +6 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +13 -15
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.d.ts +6 -1
- package/lib/chevre/service/offer/event/authorize.js +51 -4
- package/lib/chevre/service/offer/event/voidTransaction/processVoidTransaction4chevre.d.ts +1 -1
- 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 +1 -3
- package/lib/chevre/service/order/createAccountingReportIfNotExist.d.ts +1 -3
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +67 -72
- package/lib/chevre/service/order/deleteOrder.js +23 -44
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onPayTransactionConfirmed.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/onReserveTransactionConfirmed.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/paymentDue2Processing.js +9 -11
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/processing2inTransit.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDelivered.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +6 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing.js +2 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +0 -1
- package/lib/chevre/service/order/onOrderUpdated.js +0 -1
- package/lib/chevre/service/order/payOrder.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +4 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +0 -5
- package/lib/chevre/service/order/placeOrder/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder.d.ts +1 -1
- package/lib/chevre/service/order/returnOrder.js +0 -1
- package/lib/chevre/service/order/sendOrder.js +4 -5
- package/lib/chevre/service/payment/any/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/any/person2username.js +0 -1
- package/lib/chevre/service/payment/any/publishPaymentUrl.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/authorize.js +4 -3
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.d.ts +8 -1
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -1
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.d.ts +1 -1
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +2 -2
- package/lib/chevre/service/payment/movieTicket/voidTransaction.d.ts +1 -1
- package/lib/chevre/service/reserve/confirmReservation.js +7 -7
- package/lib/chevre/service/reserve/factory.js +2 -1
- package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
- package/lib/chevre/service/reserve/findByCode.js +4 -1
- package/lib/chevre/service/reserve/findReservations.d.ts +4 -4
- package/lib/chevre/service/reserve/findReservations.js +16 -26
- package/lib/chevre/service/reserve/potentialActions/onPendingReservationCanceled.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +4 -3
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +1 -10
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +0 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationsCreated.js +0 -1
- package/lib/chevre/service/reserve/searchByOrder.js +10 -3
- package/lib/chevre/service/reserve/useReservation.d.ts +1 -1
- package/lib/chevre/service/task/acceptCOAOffer.js +3 -2
- package/lib/chevre/service/task/authorizePayment.js +1 -1
- package/lib/chevre/service/task/cancelPendingReservation.js +1 -1
- package/lib/chevre/service/task/checkMovieTicket.js +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.d.ts +1 -1
- package/lib/chevre/service/task/confirmReserveTransaction.js +5 -2
- package/lib/chevre/service/task/createAccountingReport.js +7 -9
- package/lib/chevre/service/task/importEventCapacitiesFromCOA.js +1 -1
- package/lib/chevre/service/task/importEventsFromCOA.js +1 -1
- package/lib/chevre/service/task/importOffersFromCOA.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated/onHasPOSUpdated.js +0 -1
- package/lib/chevre/service/task/pay.js +1 -1
- package/lib/chevre/service/task/payment/invalidatePaymentUrlByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/payByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/payByTask.js +5 -2
- package/lib/chevre/service/task/payment/refundByTask.d.ts +1 -1
- package/lib/chevre/service/task/payment/voidPaymentByTask.d.ts +1 -1
- package/lib/chevre/service/task/refund.js +1 -1
- package/lib/chevre/service/task/returnReserveTransaction.js +1 -1
- package/lib/chevre/service/task/sendEmailMessage.js +5 -3
- package/lib/chevre/service/task/syncResourcesFromCOA.js +1 -1
- package/lib/chevre/service/task/useReservation.d.ts +2 -2
- package/lib/chevre/service/task/useReservation.js +5 -16
- package/lib/chevre/service/task/voidPayment.js +1 -1
- package/lib/chevre/service/task/voidReserveTransaction.js +1 -1
- package/lib/chevre/service/task.d.ts +0 -7
- package/lib/chevre/service/task.js +10 -2
- package/lib/chevre/service/taskHandler.js +1 -0
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions/sendEmailMessage.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateMovieTicket.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +5 -3
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +0 -1
- package/lib/chevre/service/transaction/placeOrder/updateAgent.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +0 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.js +4 -4
- package/lib/chevre/service/validation/validateOrder.js +7 -79
- package/lib/chevre/settings.d.ts +0 -55
- package/lib/chevre/settings.js +1 -29
- package/lib/chevre/taskSettings.d.ts +5 -7
- package/package.json +2 -2
- package/lib/chevre/credentials/customSearch.d.ts +0 -13
- package/lib/chevre/credentials/customSearch.js +0 -16
- package/lib/chevre/credentials/lineNotify.d.ts +0 -17
- package/lib/chevre/credentials/lineNotify.js +0 -20
- package/lib/chevre/credentials/sendGrid.d.ts +0 -24
- package/lib/chevre/credentials/sendGrid.js +0 -18
- package/lib/chevre/credentials.d.ts +0 -20
- package/lib/chevre/credentials.js +0 -42
|
@@ -1,38 +1,80 @@
|
|
|
1
1
|
import type { Connection } from 'mongoose';
|
|
2
2
|
import { factory } from '../factory';
|
|
3
|
+
import { AcceptedOfferInReserveRepo } from './acceptedOfferInReserve';
|
|
3
4
|
type IOrderInTransaction = Pick<factory.order.IOrder, 'orderNumber' | 'project'> & {
|
|
4
5
|
typeOf: factory.transactionType.PlaceOrder;
|
|
5
6
|
orderDate: Date;
|
|
6
7
|
acceptedOffers: factory.order.IAcceptedOffer[];
|
|
7
8
|
customer?: factory.order.ICustomer;
|
|
8
9
|
};
|
|
10
|
+
type IAcceptedOffer = factory.order.IAcceptedOffer & {
|
|
11
|
+
/**
|
|
12
|
+
* 受け入れ時に指定必須
|
|
13
|
+
*/
|
|
14
|
+
offeredThrough: factory.offer.IOfferedThrough;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* typeOf: Orderへドキュメント変換時の編集フィールド
|
|
18
|
+
*/
|
|
9
19
|
export type IPlacingOrder = Pick<factory.order.IOrder, 'broker' | 'confirmationNumber' | 'identifier' | 'isGift' | 'name' | 'orderDate' | 'orderNumber' | 'orderStatus' | 'orderedItem' | 'paymentMethods' | 'price' | 'priceCurrency' | 'seller' | 'typeOf' | 'url'> & {
|
|
20
|
+
/**
|
|
21
|
+
* 上書きしてはいけない
|
|
22
|
+
*/
|
|
10
23
|
acceptedOffers?: never;
|
|
24
|
+
/**
|
|
25
|
+
* 上書きしてはいけない
|
|
26
|
+
*/
|
|
11
27
|
customer?: never;
|
|
12
28
|
};
|
|
29
|
+
export type IMinimizedReservationFor = Pick<factory.order.IEventAsReservationFor, 'endDate' | 'id' | 'startDate' | 'typeOf'> & {
|
|
30
|
+
location: Pick<factory.order.IEventAsReservationFor['location'], 'branchCode' | 'typeOf'>;
|
|
31
|
+
superEvent: Pick<factory.order.ISuperEvent, 'id' | 'typeOf'> & {
|
|
32
|
+
location: Pick<factory.order.ISuperEvent['location'], 'branchCode' | 'typeOf'>;
|
|
33
|
+
workPerformed: Pick<factory.order.ISuperEvent['workPerformed'], 'identifier' | 'typeOf'>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
export type IMinimizedItemOffered = Pick<factory.order.IEventReservation, 'id' | 'reservationNumber' | 'typeOf'> & {
|
|
37
|
+
reservedTicket: Pick<factory.order.IReservedTicket, 'identifier' | 'ticketedSeat' | 'typeOf'>;
|
|
38
|
+
reservationFor: IMinimizedReservationFor;
|
|
39
|
+
};
|
|
40
|
+
export type IMinimizedAcceptedOffer = Pick<factory.order.IOptimizedAcceptedOffer, 'id' | 'name' | 'offeredThrough' | 'priceSpecification' | 'serialNumber' | 'typeOf'> & {
|
|
41
|
+
itemOffered: IMinimizedItemOffered;
|
|
42
|
+
};
|
|
13
43
|
/**
|
|
14
44
|
* 取引中注文リポジトリ
|
|
15
45
|
*/
|
|
16
|
-
export declare class OrderInTransactionRepo {
|
|
46
|
+
export declare class OrderInTransactionRepo extends AcceptedOfferInReserveRepo {
|
|
17
47
|
private readonly orderModel;
|
|
18
48
|
constructor(connection: Connection);
|
|
19
49
|
/**
|
|
20
50
|
* 取引進行中の注文からacceptedOffersを検索する
|
|
51
|
+
* 予約取引から予約ごとの価格仕様も参照する
|
|
21
52
|
*/
|
|
22
|
-
|
|
23
|
-
orderNumber:
|
|
24
|
-
|
|
53
|
+
findAcceptedOffersWithPriceByOrderNumber(params: {
|
|
54
|
+
orderNumber: string;
|
|
55
|
+
project: {
|
|
56
|
+
id: string;
|
|
25
57
|
};
|
|
26
|
-
}): Promise<factory.order.IAcceptedOffer
|
|
58
|
+
}): Promise<(Omit<factory.order.IAcceptedOffer, 'priceSpecification'> & {
|
|
59
|
+
priceSpecification?: factory.order.ITicketPriceSpecification;
|
|
60
|
+
})[]>;
|
|
27
61
|
/**
|
|
28
62
|
* 注文を受注する
|
|
63
|
+
* typeOf: PlaceOrder -> typeOf: Order
|
|
29
64
|
*/
|
|
30
65
|
placeOrder(order: IPlacingOrder): Promise<void>;
|
|
31
66
|
/**
|
|
32
67
|
* 注文documentがなければ作成し、受け入れられたオファーを追加する
|
|
33
68
|
* このメソッドでdocumentが初めて生成される(typeOf:PlaceOrderとして)
|
|
34
69
|
*/
|
|
35
|
-
acceptOffer(params: Pick<IOrderInTransaction, '
|
|
70
|
+
acceptOffer(params: Pick<IOrderInTransaction, 'orderNumber' | 'project'> & {
|
|
71
|
+
acceptedOffers: IMinimizedAcceptedOffer[] | (Omit<IAcceptedOffer, 'priceSpecification'> & {
|
|
72
|
+
/**
|
|
73
|
+
* COA以外では注文ドキュメントにpriceSpecificationが存在しないのでIFを補完
|
|
74
|
+
*/
|
|
75
|
+
priceSpecification?: factory.order.ITicketPriceSpecification;
|
|
76
|
+
})[];
|
|
77
|
+
}): Promise<import("mongoose").UpdateWriteOpResult | undefined>;
|
|
36
78
|
/**
|
|
37
79
|
* serialNumberからオファーを除外する
|
|
38
80
|
* ホワイトリストとブラックリスト両方に対応
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OrderInTransactionRepo = void 0;
|
|
4
|
+
// import { isDeepStrictEqual } from 'util';
|
|
4
5
|
const factory_1 = require("../factory");
|
|
5
6
|
const order_1 = require("./mongoose/schemas/order");
|
|
7
|
+
const acceptedOfferInReserve_1 = require("./acceptedOfferInReserve");
|
|
8
|
+
// const debug = createDebug('chevre-domain:repo:orderInTransaction');
|
|
6
9
|
/**
|
|
7
10
|
* 取引中注文リポジトリ
|
|
8
11
|
*/
|
|
9
|
-
class OrderInTransactionRepo {
|
|
12
|
+
class OrderInTransactionRepo extends acceptedOfferInReserve_1.AcceptedOfferInReserveRepo {
|
|
10
13
|
orderModel;
|
|
11
14
|
constructor(connection) {
|
|
15
|
+
super(connection);
|
|
12
16
|
this.orderModel = connection.model(order_1.modelName, (0, order_1.createSchema)());
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
19
|
* 取引進行中の注文からacceptedOffersを検索する
|
|
20
|
+
* 予約取引から予約ごとの価格仕様も参照する
|
|
16
21
|
*/
|
|
17
|
-
async
|
|
22
|
+
async findAcceptedOffersWithPriceByOrderNumber(params) {
|
|
18
23
|
const doc = await this.orderModel.findOne({
|
|
19
|
-
orderNumber: { $eq: params.orderNumber
|
|
24
|
+
orderNumber: { $eq: params.orderNumber },
|
|
20
25
|
typeOf: { $eq: factory_1.factory.transactionType.PlaceOrder }
|
|
21
26
|
}, { acceptedOffers: 1 })
|
|
22
27
|
.lean()
|
|
@@ -24,10 +29,59 @@ class OrderInTransactionRepo {
|
|
|
24
29
|
if (doc === null) {
|
|
25
30
|
throw new factory_1.factory.errors.NotFound('orderInTransaction');
|
|
26
31
|
}
|
|
27
|
-
|
|
32
|
+
const isCOA = doc.acceptedOffers.at(0)?.offeredThrough?.identifier === factory_1.factory.service.webAPI.Identifier.COA;
|
|
33
|
+
// COAの場合、予約取引は存在しないのでそのまま返す
|
|
34
|
+
if (isCOA) {
|
|
35
|
+
return doc.acceptedOffers;
|
|
36
|
+
}
|
|
37
|
+
// priceSpecificationを予約取引から補完する(2026-05-12~)
|
|
38
|
+
let acceptedOffersByReserveTransaction = [];
|
|
39
|
+
const reservationNumbers = [...new Set(doc.acceptedOffers.map((aceptedOffer) => aceptedOffer.itemOffered.reservationNumber))];
|
|
40
|
+
if (reservationNumbers.length > 0) {
|
|
41
|
+
acceptedOffersByReserveTransaction = await this.findAcceptedOffersByReservationNumbers({ reservationNumbers });
|
|
42
|
+
}
|
|
43
|
+
return doc.acceptedOffers.map((acceptedOffer) => {
|
|
44
|
+
const acceptedOfferByReserve = acceptedOffersByReserveTransaction.find((acceptedOfferByReserveTransaction) => acceptedOfferByReserveTransaction.itemOffered.id === acceptedOffer.itemOffered.id);
|
|
45
|
+
const priceSpecification = acceptedOfferByReserve?.priceSpecification;
|
|
46
|
+
// COA予約でなければ、予約取引の価格は必ず存在するはず(2026-05-20~)
|
|
47
|
+
if (priceSpecification === undefined) {
|
|
48
|
+
throw new factory_1.factory.errors.Internal(`findAcceptedOffersWithPriceByOrderNumber: priceSpecification undefined. ${acceptedOffer.itemOffered.id}`);
|
|
49
|
+
}
|
|
50
|
+
const itemOffered = acceptedOfferByReserve?.itemOffered;
|
|
51
|
+
// COA予約でなければ、予約取引のitemOfferedは必ず存在するはず(2026-05-25~)
|
|
52
|
+
if (itemOffered === undefined) {
|
|
53
|
+
throw new factory_1.factory.errors.Internal(`findAcceptedOffersWithPriceByOrderNumber: itemOffered undefined. ${acceptedOffer.itemOffered.id}`);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
...acceptedOffer,
|
|
57
|
+
itemOffered,
|
|
58
|
+
priceSpecification
|
|
59
|
+
};
|
|
60
|
+
});
|
|
28
61
|
}
|
|
62
|
+
// /**
|
|
63
|
+
// * 取引進行中の注文からacceptedOffersを検索する
|
|
64
|
+
// */
|
|
65
|
+
// public async findAcceptedOffersByOrderNumber(
|
|
66
|
+
// params: { orderNumber: { $eq: string } }
|
|
67
|
+
// ): Promise<Pick<factory.order.IAcceptedOffer, 'itemOffered' | 'serialNumber'>[]> {
|
|
68
|
+
// const doc = await this.orderModel.findOne<HydratedDocument<Pick<factory.order.IAcceptedOffer, 'itemOffered' | 'serialNumber'>>>(
|
|
69
|
+
// {
|
|
70
|
+
// orderNumber: { $eq: params.orderNumber.$eq },
|
|
71
|
+
// typeOf: { $eq: factory.transactionType.PlaceOrder }
|
|
72
|
+
// },
|
|
73
|
+
// { acceptedOffers: 1 }
|
|
74
|
+
// )
|
|
75
|
+
// .lean<Pick<IOrderInTransaction, 'acceptedOffers'>>()
|
|
76
|
+
// .exec();
|
|
77
|
+
// if (doc === null) {
|
|
78
|
+
// throw new factory.errors.NotFound('orderInTransaction');
|
|
79
|
+
// }
|
|
80
|
+
// return doc.acceptedOffers;
|
|
81
|
+
// }
|
|
29
82
|
/**
|
|
30
83
|
* 注文を受注する
|
|
84
|
+
* typeOf: PlaceOrder -> typeOf: Order
|
|
31
85
|
*/
|
|
32
86
|
async placeOrder(order) {
|
|
33
87
|
if (!(order.orderDate instanceof Date)) {
|
|
@@ -67,7 +67,8 @@ class HasPOSRepo {
|
|
|
67
67
|
throw new factory_1.factory.errors.NotFound(factory_1.factory.placeType.MovieTheater);
|
|
68
68
|
}
|
|
69
69
|
const creatingPOS = {
|
|
70
|
-
|
|
70
|
+
// 互換性維持対応としてidを保管
|
|
71
|
+
id: params.branchCode, // eslint-disable-line @typescript-eslint/no-explicit-any
|
|
71
72
|
branchCode: params.branchCode,
|
|
72
73
|
name: params.name
|
|
73
74
|
};
|
|
@@ -8,9 +8,7 @@ export interface IUpdatePartiallyParams {
|
|
|
8
8
|
export type ICancelResult = UpdateWriteOpResult;
|
|
9
9
|
export type ICheckedInResult = UpdateWriteOpResult;
|
|
10
10
|
type ISavingReservedTicket = Omit<factory.assetTransaction.reserve.ISubReservationReservedTicket, 'ticketType'> & {
|
|
11
|
-
ticketType
|
|
12
|
-
id?: string;
|
|
13
|
-
};
|
|
11
|
+
ticketType?: never;
|
|
14
12
|
};
|
|
15
13
|
/**
|
|
16
14
|
* ドキュメントとして保管する予約
|
|
@@ -22,7 +20,7 @@ export type ICreatingReservation = Omit<factory.reservation.eventReservation.IRe
|
|
|
22
20
|
/**
|
|
23
21
|
* 廃止予定の予約属性
|
|
24
22
|
*/
|
|
25
|
-
export type IDeprecatedField = 'price' | 'underName';
|
|
23
|
+
export type IDeprecatedField = 'price' | 'underName' | 'priceCurrency' | 'issuedThrough' | 'numSeats';
|
|
26
24
|
export type IKeyOfProjection = Exclude<keyof factory.reservation.eventReservation.IReservation, IDeprecatedField> | 'reservedTicket.dateUsed' | 'reservationFor.id' | 'reservationFor.typeOf';
|
|
27
25
|
export type IAttendedReservation = Pick<factory.reservation.eventReservation.IReservation, 'id' | 'typeOf' | 'project' | 'modifiedTime'> & {
|
|
28
26
|
reservationFor: Pick<factory.reservation.eventReservation.IReservationForMinimized, 'id' | 'typeOf'>;
|
|
@@ -37,6 +35,18 @@ export type IReservationAsFindResult = Omit<factory.reservation.eventReservation
|
|
|
37
35
|
* 実データとしてはまだ存在しているが型から廃止(2026-03-26~)
|
|
38
36
|
*/
|
|
39
37
|
underName?: never;
|
|
38
|
+
/**
|
|
39
|
+
* discontinue(2026-05-10~)
|
|
40
|
+
*/
|
|
41
|
+
priceCurrency?: never;
|
|
42
|
+
/**
|
|
43
|
+
* discontinue(2026-05-10~)
|
|
44
|
+
*/
|
|
45
|
+
issuedThrough?: never;
|
|
46
|
+
/**
|
|
47
|
+
* discontinue(2026-05-11~)
|
|
48
|
+
*/
|
|
49
|
+
numSeats?: never;
|
|
40
50
|
};
|
|
41
51
|
/**
|
|
42
52
|
* 予約リポジトリ
|
|
@@ -63,7 +73,6 @@ export declare class ReservationRepo {
|
|
|
63
73
|
};
|
|
64
74
|
provider: factory.reservation.IProvider;
|
|
65
75
|
subReservation: factory.assetTransaction.reserve.IObjectSubReservation[];
|
|
66
|
-
issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
|
|
67
76
|
reservationFor: factory.assetTransaction.reserve.IReservationFor;
|
|
68
77
|
reservationNumber: string;
|
|
69
78
|
underName?: factory.reservation.IUnderName;
|
|
@@ -145,16 +154,20 @@ export declare class ReservationRepo {
|
|
|
145
154
|
}): Promise<string[]>;
|
|
146
155
|
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<import("@chevre/factory/lib/chevre/reservation/event").IReservation, "id"> & {
|
|
147
156
|
_id: string;
|
|
148
|
-
bookingAgent?: any;
|
|
149
157
|
previousReservationStatus?: factory.reservationStatusType;
|
|
158
|
+
price?: never;
|
|
159
|
+
priceCurrency?: never;
|
|
160
|
+
issuedThrough?: never;
|
|
150
161
|
} & Required<{
|
|
151
162
|
_id: string;
|
|
152
163
|
}> & {
|
|
153
164
|
__v: number;
|
|
154
165
|
}, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<import("@chevre/factory/lib/chevre/reservation/event").IReservation, "id"> & {
|
|
155
166
|
_id: string;
|
|
156
|
-
bookingAgent?: any;
|
|
157
167
|
previousReservationStatus?: factory.reservationStatusType;
|
|
168
|
+
price?: never;
|
|
169
|
+
priceCurrency?: never;
|
|
170
|
+
issuedThrough?: never;
|
|
158
171
|
} & Required<{
|
|
159
172
|
_id: string;
|
|
160
173
|
}> & {
|
|
@@ -19,7 +19,7 @@ class ReservationRepo {
|
|
|
19
19
|
* 汎用予約カウント
|
|
20
20
|
*/
|
|
21
21
|
async count(params) {
|
|
22
|
-
const conditions = (0, createMongoConditions_1.
|
|
22
|
+
const conditions = (0, createMongoConditions_1.createMongoConditions)(params);
|
|
23
23
|
return this.reservationModel.countDocuments((conditions.length > 0) ? { $and: conditions } : {})
|
|
24
24
|
.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
25
25
|
.exec();
|
|
@@ -28,7 +28,7 @@ class ReservationRepo {
|
|
|
28
28
|
* 予約検索
|
|
29
29
|
*/
|
|
30
30
|
async findReservations(params, inclusion) {
|
|
31
|
-
const conditions = (0, createMongoConditions_1.
|
|
31
|
+
const conditions = (0, createMongoConditions_1.createMongoConditions)(params);
|
|
32
32
|
let projection;
|
|
33
33
|
if (inclusion !== undefined && inclusion !== null) {
|
|
34
34
|
projection = {
|
|
@@ -114,15 +114,19 @@ class ReservationRepo {
|
|
|
114
114
|
const bulkWriteOps = [];
|
|
115
115
|
if (Array.isArray(params.subReservation)) {
|
|
116
116
|
params.subReservation.forEach((subReservation) => {
|
|
117
|
-
const { price: _discontinuePrice, reservedTicket,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
117
|
+
const { price: _discontinuePrice, reservedTicket, priceCurrency: _discontinuePriceCurrency, // discontinue priceCurrency
|
|
118
|
+
numSeats: _numSeats, // discontinue(2026-05-11~)
|
|
119
|
+
...subReservationWithoutPrice } = subReservation;
|
|
120
|
+
const { ticketType: _ticketType, ...reservedTicketWithoutTicketType } = reservedTicket;
|
|
121
|
+
// discontinue ticketType(2026-05-09~)
|
|
122
|
+
const savingReservedTicket = reservedTicketWithoutTicketType;
|
|
123
|
+
// // 予約ドキュメントのticketTypeを最小化(2026-04-03~)
|
|
124
|
+
// const savingReservedTicket: ISavingReservedTicket = {
|
|
125
|
+
// ...reservedTicketWithoutTicketType,
|
|
126
|
+
// ticketType: {
|
|
127
|
+
// ...((typeof ticketType.id === 'string') && { id: ticketType.id })
|
|
128
|
+
// }
|
|
129
|
+
// };
|
|
126
130
|
// reservationFor最小化(2026-04-06~)
|
|
127
131
|
const { minimizedReservationFor } = (0, minimizeReservationFor_1.minimizeReservationFor)(params.reservationFor);
|
|
128
132
|
const setOnInsert = {
|
|
@@ -132,7 +136,7 @@ class ReservationRepo {
|
|
|
132
136
|
bookingTime: params.bookingTime,
|
|
133
137
|
checkedIn: false,
|
|
134
138
|
attended: false,
|
|
135
|
-
issuedThrough: params.issuedThrough,
|
|
139
|
+
// issuedThrough: params.issuedThrough, // discontinue issuedThrough
|
|
136
140
|
project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
|
|
137
141
|
reservationFor: minimizedReservationFor,
|
|
138
142
|
reservationNumber: params.reservationNumber,
|
|
@@ -59,23 +59,9 @@ export declare class RoleRepo {
|
|
|
59
59
|
} & {
|
|
60
60
|
__v: number;
|
|
61
61
|
}) | null>;
|
|
62
|
-
addMember(params: Pick<IRole, 'member' | 'memberOf' | 'roleName'>): Promise<(import("mongoose").FlattenMaps<{
|
|
63
|
-
typeOf: import("@chevre/factory/lib/chevre/role").RoleType;
|
|
64
|
-
memberOf: {
|
|
65
|
-
typeOf: factory.organizationType.Corporation | factory.organizationType.Project;
|
|
66
|
-
};
|
|
67
|
-
member: {
|
|
68
|
-
typeOf: import("@chevre/factory/lib/chevre/role/organizationRole").IMemberType;
|
|
69
|
-
};
|
|
70
|
-
roleName: import("@chevre/factory/lib/chevre/role/organizationRole").RoleName;
|
|
71
|
-
permissions: string[];
|
|
72
|
-
}> & {
|
|
73
|
-
_id: import("mongoose").Types.ObjectId;
|
|
74
|
-
} & {
|
|
75
|
-
__v: number;
|
|
76
|
-
}) | null>;
|
|
77
62
|
create(params: Pick<IRole, 'member' | 'memberOf' | 'permissions' | 'roleName'>): Promise<{
|
|
78
63
|
id: string;
|
|
79
64
|
}>;
|
|
65
|
+
deleteByRoleName(params: Pick<IRole, 'roleName'>): Promise<import("mongodb").DeleteResult>;
|
|
80
66
|
}
|
|
81
67
|
export {};
|
package/lib/chevre/repo/role.js
CHANGED
|
@@ -139,20 +139,6 @@ class RoleRepo {
|
|
|
139
139
|
.lean()
|
|
140
140
|
.exec();
|
|
141
141
|
}
|
|
142
|
-
async addMember(params) {
|
|
143
|
-
const { roleName, member, memberOf } = params;
|
|
144
|
-
return this.roleModel.findOneAndUpdate({
|
|
145
|
-
roleName: { $eq: roleName },
|
|
146
|
-
'member.typeOf': { $ne: member.typeOf }
|
|
147
|
-
}, {
|
|
148
|
-
$set: { member, memberOf }
|
|
149
|
-
}, {
|
|
150
|
-
new: true,
|
|
151
|
-
projection: { _id: 1 }
|
|
152
|
-
})
|
|
153
|
-
.lean()
|
|
154
|
-
.exec();
|
|
155
|
-
}
|
|
156
142
|
async create(params) {
|
|
157
143
|
const { member, memberOf, permissions, roleName } = params;
|
|
158
144
|
const creatingRole = {
|
|
@@ -167,5 +153,12 @@ class RoleRepo {
|
|
|
167
153
|
const savedId = insertedId;
|
|
168
154
|
return { id: savedId };
|
|
169
155
|
}
|
|
156
|
+
async deleteByRoleName(params) {
|
|
157
|
+
const { roleName } = params;
|
|
158
|
+
return this.roleModel.deleteOne({
|
|
159
|
+
roleName: { $eq: roleName }
|
|
160
|
+
})
|
|
161
|
+
.exec();
|
|
162
|
+
}
|
|
170
163
|
}
|
|
171
164
|
exports.RoleRepo = RoleRepo;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
2
|
+
import { IIntegrationSettings, ISendGridSettings } from '../mongoose/schemas/setting';
|
|
3
|
+
interface IDBOptions {
|
|
4
|
+
connection: Connection;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 外部連携設定リポジトリ
|
|
8
|
+
*/
|
|
9
|
+
export declare class IntegrationSettingRepo {
|
|
10
|
+
private readonly settingModel;
|
|
11
|
+
private readonly defaultOptions;
|
|
12
|
+
private static cachedSettings;
|
|
13
|
+
private static cacheExpiry;
|
|
14
|
+
private static readonly CACHE_TTL_MS;
|
|
15
|
+
constructor(options: IDBOptions);
|
|
16
|
+
/**
|
|
17
|
+
* 設定全体をDBまたはキャッシュから取得する
|
|
18
|
+
*/
|
|
19
|
+
private getAllSettings;
|
|
20
|
+
/**
|
|
21
|
+
* 設定名称から設定を参照する
|
|
22
|
+
*/
|
|
23
|
+
getByKey<T extends keyof IIntegrationSettings>(key: T): Promise<IIntegrationSettings[T]>;
|
|
24
|
+
addSendGridSettings(params: ISendGridSettings): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IntegrationSettingRepo = void 0;
|
|
7
|
+
const debug_1 = __importDefault(require("debug"));
|
|
8
|
+
const factory_1 = require("../../factory");
|
|
9
|
+
const setting_1 = require("../mongoose/schemas/setting");
|
|
10
|
+
const debug = (0, debug_1.default)('chevre-domain:repo:integrationSetting');
|
|
11
|
+
const defaultOptions = {
|
|
12
|
+
abortedTasksWithoutReport: [
|
|
13
|
+
factory_1.factory.taskName.ImportEventCapacitiesFromCOA,
|
|
14
|
+
factory_1.factory.taskName.ImportEventsFromCOA,
|
|
15
|
+
factory_1.factory.taskName.ImportOffersFromCOA,
|
|
16
|
+
],
|
|
17
|
+
numTryConfirmReserveTransaction: 10,
|
|
18
|
+
deliverOrderLimit: 10,
|
|
19
|
+
coa: {
|
|
20
|
+
timeoutReserve: 20000,
|
|
21
|
+
timeoutMaster: 30000
|
|
22
|
+
},
|
|
23
|
+
gmo: {
|
|
24
|
+
timeout: 4000,
|
|
25
|
+
timeoutBackground: 6000
|
|
26
|
+
},
|
|
27
|
+
movieticketReserve: {
|
|
28
|
+
timeoutPay: 5000,
|
|
29
|
+
timeoutRefund: 5000,
|
|
30
|
+
timeoutCheck: 4000,
|
|
31
|
+
minIntervalBetweenPayAndRefund: 10000,
|
|
32
|
+
credentialsExpireInSeconds: 600
|
|
33
|
+
},
|
|
34
|
+
useExperimentalFeature: false
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* 外部連携設定リポジトリ
|
|
38
|
+
*/
|
|
39
|
+
class IntegrationSettingRepo {
|
|
40
|
+
settingModel;
|
|
41
|
+
defaultOptions;
|
|
42
|
+
// static にすることで、クラスが何回 new されてもメモリ上で1つだけ保持される
|
|
43
|
+
static cachedSettings;
|
|
44
|
+
static cacheExpiry = 0;
|
|
45
|
+
static CACHE_TTL_MS = 10 * 60 * 1000; // 10分
|
|
46
|
+
constructor(options) {
|
|
47
|
+
const { connection } = options;
|
|
48
|
+
this.settingModel = connection.model(setting_1.modelName, (0, setting_1.createSchema)());
|
|
49
|
+
this.defaultOptions = defaultOptions;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* 設定全体をDBまたはキャッシュから取得する
|
|
53
|
+
*/
|
|
54
|
+
async getAllSettings() {
|
|
55
|
+
const now = Date.now();
|
|
56
|
+
// static プロパティにアクセスするため、クラス名(IntegrationSettingRepo)経由で参照
|
|
57
|
+
if (IntegrationSettingRepo.cachedSettings !== undefined && now < IntegrationSettingRepo.cacheExpiry) {
|
|
58
|
+
debug('cache exist!', JSON.stringify(IntegrationSettingRepo.cachedSettings));
|
|
59
|
+
return IntegrationSettingRepo.cachedSettings;
|
|
60
|
+
}
|
|
61
|
+
const settingDoc = await this.settingModel.findOne({ 'project.id': { $eq: '*' } }, {
|
|
62
|
+
_id: 0,
|
|
63
|
+
integration: 1
|
|
64
|
+
})
|
|
65
|
+
.lean()
|
|
66
|
+
.exec();
|
|
67
|
+
// キャッシュを更新
|
|
68
|
+
if (settingDoc?.integration !== undefined) {
|
|
69
|
+
// console.log('docuemnt exist!');
|
|
70
|
+
IntegrationSettingRepo.cachedSettings = settingDoc.integration;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
IntegrationSettingRepo.cachedSettings = this.defaultOptions;
|
|
74
|
+
}
|
|
75
|
+
IntegrationSettingRepo.cacheExpiry = now + IntegrationSettingRepo.CACHE_TTL_MS;
|
|
76
|
+
return IntegrationSettingRepo.cachedSettings;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 設定名称から設定を参照する
|
|
80
|
+
*/
|
|
81
|
+
async getByKey(key) {
|
|
82
|
+
const settings = await this.getAllSettings();
|
|
83
|
+
return settings[key];
|
|
84
|
+
}
|
|
85
|
+
async addSendGridSettings(params) {
|
|
86
|
+
return this.settingModel.updateOne({ 'project.id': { $eq: '*' } }, {
|
|
87
|
+
$set: {
|
|
88
|
+
'integration.sendGrid': params
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
.exec();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.IntegrationSettingRepo = IntegrationSettingRepo;
|
|
@@ -136,11 +136,11 @@ export declare class TransactionRepo {
|
|
|
136
136
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
137
137
|
startDate: Date;
|
|
138
138
|
endDate?: Date | undefined;
|
|
139
|
-
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
140
139
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
141
|
-
|
|
140
|
+
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
142
141
|
status: factory.transactionStatusType;
|
|
143
142
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
143
|
+
potentialActions?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IPotentialActions | undefined;
|
|
144
144
|
} & {
|
|
145
145
|
_id: import("mongoose").Types.ObjectId;
|
|
146
146
|
} & {
|
|
@@ -156,10 +156,10 @@ export declare class TransactionRepo {
|
|
|
156
156
|
startDate: Date;
|
|
157
157
|
endDate?: Date | undefined;
|
|
158
158
|
agent: import("@chevre/factory/lib/chevre/transaction").IAgent;
|
|
159
|
-
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
160
159
|
recipient?: undefined;
|
|
161
160
|
status: factory.transactionStatusType;
|
|
162
161
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
162
|
+
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
163
163
|
} & {
|
|
164
164
|
_id: import("mongoose").Types.ObjectId;
|
|
165
165
|
} & {
|
|
@@ -174,11 +174,11 @@ export declare class TransactionRepo {
|
|
|
174
174
|
result?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IResult | undefined;
|
|
175
175
|
startDate: Date;
|
|
176
176
|
endDate?: Date | undefined;
|
|
177
|
-
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
178
177
|
instrument?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IInstrument | undefined;
|
|
179
|
-
|
|
178
|
+
agent: import("@chevre/factory/lib/chevre/transaction/placeOrder").IAgent;
|
|
180
179
|
status: factory.transactionStatusType;
|
|
181
180
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
181
|
+
potentialActions?: import("@chevre/factory/lib/chevre/transaction/placeOrder").IPotentialActions | undefined;
|
|
182
182
|
} & {
|
|
183
183
|
_id: import("mongoose").Types.ObjectId;
|
|
184
184
|
} & {
|
|
@@ -194,10 +194,10 @@ export declare class TransactionRepo {
|
|
|
194
194
|
startDate: Date;
|
|
195
195
|
endDate?: Date | undefined;
|
|
196
196
|
agent: import("@chevre/factory/lib/chevre/transaction").IAgent;
|
|
197
|
-
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
198
197
|
recipient?: undefined;
|
|
199
198
|
status: factory.transactionStatusType;
|
|
200
199
|
tasksExportAction?: import("@chevre/factory/lib/chevre/transaction").ITasksExportAction | undefined;
|
|
200
|
+
potentialActions?: import("@chevre/factory/lib/chevre/transaction/returnOrder").IPotentialActions | undefined;
|
|
201
201
|
} & {
|
|
202
202
|
_id: import("mongoose").Types.ObjectId;
|
|
203
203
|
} & {
|
|
@@ -79,6 +79,7 @@ import type { SellerPaymentAcceptedRepo } from './repo/sellerPaymentAccepted';
|
|
|
79
79
|
import type { SellerReturnPolicyRepo } from './repo/sellerReturnPolicy';
|
|
80
80
|
import type { ServiceAvailableHourRepo } from './repo/service/availableHour';
|
|
81
81
|
import type { SettingRepo } from './repo/setting';
|
|
82
|
+
import type { IntegrationSettingRepo } from './repo/setting/integration';
|
|
82
83
|
import type { JWTSettingRepo } from './repo/setting/jwt';
|
|
83
84
|
import type { StockHolderRepo } from './repo/stockHolder';
|
|
84
85
|
import type { TaskRepo } from './repo/task';
|
|
@@ -437,6 +438,10 @@ export declare namespace Setting {
|
|
|
437
438
|
function createInstance(...params: ConstructorParameters<typeof SettingRepo>): Promise<SettingRepo>;
|
|
438
439
|
}
|
|
439
440
|
export declare namespace setting {
|
|
441
|
+
type Integration = IntegrationSettingRepo;
|
|
442
|
+
namespace Integration {
|
|
443
|
+
function createInstance(...params: ConstructorParameters<typeof IntegrationSettingRepo>): Promise<IntegrationSettingRepo>;
|
|
444
|
+
}
|
|
440
445
|
type JWT = JWTSettingRepo;
|
|
441
446
|
namespace JWT {
|
|
442
447
|
function createInstance(...params: ConstructorParameters<typeof JWTSettingRepo>): Promise<JWTSettingRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -911,6 +911,17 @@ var Setting;
|
|
|
911
911
|
})(Setting || (exports.Setting = Setting = {}));
|
|
912
912
|
var setting;
|
|
913
913
|
(function (setting) {
|
|
914
|
+
let Integration;
|
|
915
|
+
(function (Integration) {
|
|
916
|
+
let repo;
|
|
917
|
+
async function createInstance(...params) {
|
|
918
|
+
if (repo === undefined) {
|
|
919
|
+
repo = (await import('./repo/setting/integration.js')).IntegrationSettingRepo;
|
|
920
|
+
}
|
|
921
|
+
return new repo(...params);
|
|
922
|
+
}
|
|
923
|
+
Integration.createInstance = createInstance;
|
|
924
|
+
})(Integration = setting.Integration || (setting.Integration = {}));
|
|
914
925
|
let JWT;
|
|
915
926
|
(function (JWT) {
|
|
916
927
|
let repo;
|
|
@@ -150,7 +150,12 @@ function aggregateReservationByOffer(params) {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
|
-
console.log(
|
|
153
|
+
// console.log(
|
|
154
|
+
// 'aggregateReservationByOffer: reservationCount4offer:', reservationCount4offer,
|
|
155
|
+
// 'aggregateSeatingType:', aggregateSeatingType,
|
|
156
|
+
// 'offer.id:', params.offer.id,
|
|
157
|
+
// 'offer.category:', params.offer.category?.codeValue
|
|
158
|
+
// );
|
|
154
159
|
}
|
|
155
160
|
}
|
|
156
161
|
const { maximumAttendeeCapacity, remainingAttendeeCapacity } = await calculateCapacityByOffer(params)(repos);
|
|
@@ -10,7 +10,6 @@ exports.aggregateScreeningEvent = aggregateScreeningEvent;
|
|
|
10
10
|
const debug_1 = __importDefault(require("debug"));
|
|
11
11
|
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
12
12
|
const factory_1 = require("../../../factory");
|
|
13
|
-
// import { Settings } from '../../../settings';
|
|
14
13
|
const findEventOffers_1 = require("./findEventOffers");
|
|
15
14
|
const debug = (0, debug_1.default)('chevre-domain:service:aggregation');
|
|
16
15
|
/**
|
|
@@ -69,10 +69,11 @@ function createPotentialActions(params) {
|
|
|
69
69
|
const reservationForByReserveTransaction = transaction.object.transaction?.object.reservationFor;
|
|
70
70
|
if (reservationForByReserveTransaction !== undefined && typeof reservationNumber === 'string') {
|
|
71
71
|
const cancelObject = {
|
|
72
|
-
reservationFor
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
// discontinue reservationFor(2026-05-09~)
|
|
73
|
+
// reservationFor: {
|
|
74
|
+
// typeOf: reservationForByReserveTransaction.typeOf,
|
|
75
|
+
// id: String(reservationForByReserveTransaction.id)
|
|
76
|
+
// },
|
|
76
77
|
reservationNumber,
|
|
77
78
|
// ReservationConfirmed->ReservationCancelledのみ処理されるように保証する
|
|
78
79
|
reservationStatus: factory_1.factory.reservationStatusType.ReservationConfirmed,
|
|
@@ -100,13 +101,15 @@ function createPotentialActions(params) {
|
|
|
100
101
|
cancelObject = {
|
|
101
102
|
typeOf: reservation.typeOf,
|
|
102
103
|
id: reservation.id,
|
|
103
|
-
issuedThrough
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
// discontinue issuedThrough(2026-05-08~)
|
|
105
|
+
// issuedThrough: {
|
|
106
|
+
// typeOf: reservation.issuedThrough?.typeOf
|
|
107
|
+
// },
|
|
108
|
+
// discontinue reservationFor(2026-05-09~)
|
|
109
|
+
// reservationFor: {
|
|
110
|
+
// typeOf: reservation.reservationFor.typeOf,
|
|
111
|
+
// id: String(reservation.reservationFor.id)
|
|
112
|
+
// },
|
|
110
113
|
reservationNumber: reservation.reservationNumber,
|
|
111
114
|
// ReservationConfirmed->ReservationCancelledのみ処理されるように保証する
|
|
112
115
|
reservationStatus: factory_1.factory.reservationStatusType.ReservationConfirmed
|