@chevre/domain 24.1.0-alpha.4 → 24.1.0-alpha.40
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/credentials.d.ts +4 -16
- package/lib/chevre/credentials.js +11 -39
- package/lib/chevre/emailMessageBuilder.js +4 -12
- package/lib/chevre/index.d.ts +1 -1
- package/lib/chevre/index.js +2 -2
- 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 +45 -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 +25 -0
- package/lib/chevre/repo/setting/integration.js +86 -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 -2
- package/lib/chevre/service/notification/notifyAbortedTasksByEmail.js +1 -1
- package/lib/chevre/service/notification/notifyByEmail.js +0 -6
- 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/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 -2
- 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 -2
- 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
|
@@ -4,7 +4,6 @@ exports.AccountingReportRepo = void 0;
|
|
|
4
4
|
const errorHandler_1 = require("../errorHandler");
|
|
5
5
|
const factory_1 = require("../factory");
|
|
6
6
|
const accountingReport_1 = require("./mongoose/schemas/accountingReport");
|
|
7
|
-
const DEFAULT_SEARCH_LIMIT = 100;
|
|
8
7
|
/**
|
|
9
8
|
* 経理レポートリポジトリ
|
|
10
9
|
*/
|
|
@@ -49,30 +48,6 @@ class AccountingReportRepo {
|
|
|
49
48
|
$match: { 'mainEntity.orderDate': { $lte: orderDateLte } }
|
|
50
49
|
});
|
|
51
50
|
}
|
|
52
|
-
// discontinue(2026-05-01~)
|
|
53
|
-
// const reservationForStartDateGte = params.order?.acceptedOffers?.itemOffered?.reservationFor?.startDate?.$gte;
|
|
54
|
-
// if (reservationForStartDateGte instanceof Date) {
|
|
55
|
-
// matchStages.push({
|
|
56
|
-
// $match: {
|
|
57
|
-
// 'mainEntity.acceptedOffers.itemOffered.reservationFor.startDate': {
|
|
58
|
-
// $exists: true,
|
|
59
|
-
// $gte: reservationForStartDateGte
|
|
60
|
-
// }
|
|
61
|
-
// }
|
|
62
|
-
// });
|
|
63
|
-
// }
|
|
64
|
-
// discontinue(2026-05-01~)
|
|
65
|
-
// const reservationForStartDateLte = params.order?.acceptedOffers?.itemOffered?.reservationFor?.startDate?.$lte;
|
|
66
|
-
// if (reservationForStartDateLte instanceof Date) {
|
|
67
|
-
// matchStages.push({
|
|
68
|
-
// $match: {
|
|
69
|
-
// 'mainEntity.acceptedOffers.itemOffered.reservationFor.startDate': {
|
|
70
|
-
// $exists: true,
|
|
71
|
-
// $lte: reservationForStartDateLte
|
|
72
|
-
// }
|
|
73
|
-
// }
|
|
74
|
-
// });
|
|
75
|
-
// }
|
|
76
51
|
return matchStages;
|
|
77
52
|
}
|
|
78
53
|
async syncMainEntity(params) {
|
|
@@ -137,18 +112,16 @@ class AccountingReportRepo {
|
|
|
137
112
|
throw new factory_1.factory.errors.NotFound(this.accountingReportModel.modelName);
|
|
138
113
|
}
|
|
139
114
|
}
|
|
140
|
-
async
|
|
141
|
-
const
|
|
142
|
-
const page = (typeof params.page === 'number') ? Math.max(params.page, 1) : 1;
|
|
143
|
-
const unwindAcceptedOffers = params.$unwindAcceptedOffers === '1';
|
|
115
|
+
async findAccountingReports(params) {
|
|
116
|
+
const { limit, page } = params;
|
|
144
117
|
const matchStages = AccountingReportRepo.CREATE_MONGO_CONDITIONS(params);
|
|
145
118
|
const aggregate = this.accountingReportModel.aggregate([
|
|
119
|
+
...matchStages,
|
|
146
120
|
// pipelineの順序に注意
|
|
147
121
|
// @see https://docs.mongodb.com/manual/reference/operator/aggregation/sort/
|
|
148
122
|
{ $sort: { 'mainEntity.orderDate': factory_1.factory.sortType.Descending } },
|
|
149
123
|
{ $unwind: '$hasPart' },
|
|
150
|
-
|
|
151
|
-
...matchStages,
|
|
124
|
+
// hasPart内に対する検索条件は存在しないため、unwind後のmatchは不要
|
|
152
125
|
{
|
|
153
126
|
$project: {
|
|
154
127
|
_id: 0,
|
|
@@ -159,10 +132,9 @@ class AccountingReportRepo {
|
|
|
159
132
|
}
|
|
160
133
|
}
|
|
161
134
|
]);
|
|
162
|
-
return aggregate
|
|
163
|
-
.limit(limit * page)
|
|
135
|
+
return aggregate
|
|
164
136
|
.skip(limit * (page - 1))
|
|
165
|
-
|
|
137
|
+
.limit(limit)
|
|
166
138
|
.exec();
|
|
167
139
|
}
|
|
168
140
|
async unsetUnnecessaryFields(params) {
|
|
@@ -30,7 +30,7 @@ export type IRecipeAsActionAttributes<T extends factory.recipe.RecipeCategory> =
|
|
|
30
30
|
export type IMinimizedPurchaseNumberAuthResult = Pick<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberAuthResult, 'mkknmiNumSum' | 'resultInfo' | 'ykknmiNumSum'> & {
|
|
31
31
|
knyknrNoInfoOut: Omit<factory.action.check.paymentMethod.movieTicket.IPurchaseNumberInfo, 'ykknInfo' | 'mkknInfo'>[] | null;
|
|
32
32
|
};
|
|
33
|
-
export type IKeyOfProjection = keyof IAction<factory.actionType> | keyof IAction<factory.actionType.AuthorizeAction> | keyof IAction<factory.actionType.
|
|
33
|
+
export type IKeyOfProjection = keyof IAction<factory.actionType> | keyof IAction<factory.actionType.AuthorizeAction> | keyof IAction<factory.actionType.ReplaceAction> | 'identifier';
|
|
34
34
|
export declare const AVAILABLE_PROJECT_FIELDS: IKeyOfProjection[];
|
|
35
35
|
/**
|
|
36
36
|
* アクション状態管理リポジトリ
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Connection } from 'mongoose';
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
3
|
type ISubReservationAsFindResult = Pick<factory.reservation.eventReservation.IReservation, 'underName' | 'id'> & {
|
|
4
|
-
price?: factory.reservation.eventReservation.IPrice;
|
|
5
4
|
reservedTicket?: Pick<factory.reservation.eventReservation.IReservedTicket, 'ticketType'>;
|
|
6
5
|
reservationFor?: factory.assetTransaction.reserve.IReservationFor;
|
|
7
6
|
};
|
|
@@ -12,54 +12,6 @@ class ReserveTransactionRepo {
|
|
|
12
12
|
constructor(connection) {
|
|
13
13
|
this.transactionModel = connection.model(assetTransaction_1.modelName, (0, assetTransaction_1.createSchema)());
|
|
14
14
|
}
|
|
15
|
-
// /**
|
|
16
|
-
// * 予約取引から予約を検索する
|
|
17
|
-
// */
|
|
18
|
-
// public async findSubReservationsByReservationNumber(
|
|
19
|
-
// params: {
|
|
20
|
-
// reservationNumber: string;
|
|
21
|
-
// }
|
|
22
|
-
// ): Promise<ISubReservationAsFindResult[]> {
|
|
23
|
-
// const aggregate = this.transactionModel.aggregate<ISubReservationAsFindResult>([
|
|
24
|
-
// {
|
|
25
|
-
// $match: {
|
|
26
|
-
// typeOf: { $eq: factory.assetTransactionType.Reserve },
|
|
27
|
-
// transactionNumber: { $eq: params.reservationNumber }
|
|
28
|
-
// }
|
|
29
|
-
// },
|
|
30
|
-
// {
|
|
31
|
-
// $unwind: {
|
|
32
|
-
// path: '$object.subReservation'
|
|
33
|
-
// // includeArrayIndex: 'elementIndex'
|
|
34
|
-
// }
|
|
35
|
-
// },
|
|
36
|
-
// // {
|
|
37
|
-
// // $match: {
|
|
38
|
-
// // typeOf: { $eq: factory.assetTransactionType.Reserve },
|
|
39
|
-
// // transactionNumber: { $eq: params.reservationNumber }
|
|
40
|
-
// // }
|
|
41
|
-
// // },
|
|
42
|
-
// {
|
|
43
|
-
// $project: {
|
|
44
|
-
// _id: 0,
|
|
45
|
-
// id: '$object.subReservation.id',
|
|
46
|
-
// price: '$object.subReservation.price',
|
|
47
|
-
// underName: '$object.underName',
|
|
48
|
-
// reservedTicket: {
|
|
49
|
-
// ticketType: '$object.subReservation.reservedTicket.ticketType',
|
|
50
|
-
// }
|
|
51
|
-
// }
|
|
52
|
-
// }
|
|
53
|
-
// ]);
|
|
54
|
-
// // if (typeof filter.limit === 'number' && filter.limit > 0) {
|
|
55
|
-
// // const page: number = (typeof filter.page === 'number' && filter.page > 0) ? filter.page : 1;
|
|
56
|
-
// // aggregate.limit(filter.limit * page)
|
|
57
|
-
// // .skip(filter.limit * (page - 1));
|
|
58
|
-
// // }
|
|
59
|
-
// return aggregate
|
|
60
|
-
// .option({ maxTimeMS: MONGO_MAX_TIME_MS })
|
|
61
|
-
// .exec();
|
|
62
|
-
// }
|
|
63
15
|
/**
|
|
64
16
|
* 予約取引から予約を検索する
|
|
65
17
|
* limitはしない
|
|
@@ -91,12 +43,14 @@ class ReserveTransactionRepo {
|
|
|
91
43
|
$project: {
|
|
92
44
|
_id: 0,
|
|
93
45
|
id: '$object.subReservation.id',
|
|
94
|
-
price: '$object.subReservation.price',
|
|
95
46
|
underName: '$object.underName',
|
|
96
47
|
reservationFor: '$object.reservationFor',
|
|
97
48
|
reservedTicket: {
|
|
98
49
|
ticketType: '$object.subReservation.reservedTicket.ticketType',
|
|
99
|
-
}
|
|
50
|
+
},
|
|
51
|
+
// numSeats: '$object.subReservation.numSeats',
|
|
52
|
+
// price: '$object.subReservation.price',
|
|
53
|
+
// issuedThrough: '$object.issuedThrough',
|
|
100
54
|
}
|
|
101
55
|
}
|
|
102
56
|
]);
|
package/lib/chevre/repo/event.js
CHANGED
|
@@ -798,22 +798,26 @@ class EventRepo {
|
|
|
798
798
|
.sort({ startDate: factory_1.factory.sortType.Descending })
|
|
799
799
|
.cursor();
|
|
800
800
|
}
|
|
801
|
-
//
|
|
801
|
+
// /**
|
|
802
|
+
// * アプリケーションオファー廃止用のメソッド
|
|
803
|
+
// */
|
|
804
|
+
// public async removeAvailableAtOrFrom(params: {
|
|
802
805
|
// id: string;
|
|
803
806
|
// offers: {
|
|
804
807
|
// seller: {
|
|
805
|
-
// makesOffer: factory.event.screeningEvent.ISellerMakesOffer
|
|
808
|
+
// makesOffer: Pick<factory.event.screeningEvent.ISellerMakesOffer, 'availableAtOrFrom'>;
|
|
806
809
|
// };
|
|
807
810
|
// };
|
|
808
|
-
// })
|
|
809
|
-
//
|
|
811
|
+
// }) {
|
|
812
|
+
// return this.eventModel.updateOne(
|
|
810
813
|
// { _id: { $eq: params.id } },
|
|
811
814
|
// {
|
|
812
|
-
// $
|
|
813
|
-
// 'offers.seller.makesOffer':
|
|
815
|
+
// $pull: {
|
|
816
|
+
// 'offers.seller.makesOffer': {
|
|
817
|
+
// 'availableAtOrFrom.id': { $eq: params.offers.seller.makesOffer.availableAtOrFrom.id }
|
|
818
|
+
// }
|
|
814
819
|
// }
|
|
815
|
-
// }
|
|
816
|
-
// { includeResultMetadata: true }
|
|
820
|
+
// }
|
|
817
821
|
// )
|
|
818
822
|
// .exec();
|
|
819
823
|
// }
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { factory } from '../../../factory';
|
|
2
|
+
type IAcceptedOfferByReserveTransaction = Pick<factory.order.IOptimizedAcceptedOffer, 'itemOffered' | 'priceSpecification'>;
|
|
3
|
+
/**
|
|
4
|
+
* 予約取引を注文のitemOfferedへ変換する
|
|
5
|
+
*/
|
|
6
|
+
declare function reserveTransaction2itemOffered(params: Pick<factory.assetTransaction.reserve.ITransaction, 'object'>): IAcceptedOfferByReserveTransaction[];
|
|
7
|
+
export { IAcceptedOfferByReserveTransaction, reserveTransaction2itemOffered };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.reserveTransaction2itemOffered = reserveTransaction2itemOffered;
|
|
4
|
+
function createReservationFor(reservationFor) {
|
|
5
|
+
const { superEvent, ...reservationForWithoutSuperEvent } = reservationFor;
|
|
6
|
+
const { workPerformed, ...superEventWithoutMovie } = superEvent;
|
|
7
|
+
const workPerformedInOrder = {
|
|
8
|
+
typeOf: workPerformed.typeOf,
|
|
9
|
+
id: workPerformed.id,
|
|
10
|
+
identifier: workPerformed.identifier,
|
|
11
|
+
name: workPerformed.name,
|
|
12
|
+
...((typeof workPerformed.duration === 'string') && { duration: workPerformed.duration })
|
|
13
|
+
};
|
|
14
|
+
const superEventInOrder = {
|
|
15
|
+
...superEventWithoutMovie,
|
|
16
|
+
workPerformed: workPerformedInOrder
|
|
17
|
+
};
|
|
18
|
+
return {
|
|
19
|
+
...reservationForWithoutSuperEvent,
|
|
20
|
+
superEvent: superEventInOrder
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function createReservedTicket(reservedTicket) {
|
|
24
|
+
const { issuedBy: _issuedBy, dateIssued: _dateIssued, dateUsed: _dateUsed, ticketToken: _ticketToken, ticketType, ticketNumber: _ticketNumber, ...reservedTicket4order } = reservedTicket;
|
|
25
|
+
const ticketTypeInOrder = {
|
|
26
|
+
typeOf: ticketType.typeOf,
|
|
27
|
+
id: ticketType.id,
|
|
28
|
+
identifier: ticketType.identifier,
|
|
29
|
+
name: ticketType.name,
|
|
30
|
+
...((ticketType.description !== undefined) && { description: ticketType.description }),
|
|
31
|
+
...((ticketType.additionalProperty !== undefined) && { additionalProperty: ticketType.additionalProperty }),
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
...reservedTicket4order,
|
|
35
|
+
ticketType: ticketTypeInOrder
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 予約取引を注文のitemOfferedへ変換する
|
|
40
|
+
*/
|
|
41
|
+
function reserveTransaction2itemOffered(params) {
|
|
42
|
+
const { object } = params;
|
|
43
|
+
// subReservationは配列のはず
|
|
44
|
+
if (!Array.isArray(object.subReservation)) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
// reservationForは存在するはず
|
|
48
|
+
if (object.reservationFor === undefined) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
const { reservationNumber, issuedThrough } = object;
|
|
52
|
+
// イベントを注文用に生成
|
|
53
|
+
const reservationFor = createReservationFor(object.reservationFor);
|
|
54
|
+
return object.subReservation.map((subReservationReserveTransaction) => {
|
|
55
|
+
const { additionalProperty, additionalTicketText, id, programMembershipUsed, typeOf, price } = subReservationReserveTransaction;
|
|
56
|
+
// チケットを注文用に生成
|
|
57
|
+
const reservedTicket = createReservedTicket(subReservationReserveTransaction.reservedTicket);
|
|
58
|
+
const reservationByReserveTransaction = {
|
|
59
|
+
additionalProperty,
|
|
60
|
+
id,
|
|
61
|
+
typeOf,
|
|
62
|
+
reservedTicket,
|
|
63
|
+
reservationNumber,
|
|
64
|
+
issuedThrough,
|
|
65
|
+
reservationFor,
|
|
66
|
+
...((typeof additionalTicketText === 'string') && { additionalTicketText }),
|
|
67
|
+
...((typeof programMembershipUsed?.identifier === 'string') && { programMembershipUsed }),
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
itemOffered: reservationByReserveTransaction,
|
|
71
|
+
...((price !== undefined) && { priceSpecification: price })
|
|
72
|
+
};
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FilterQuery } from 'mongoose';
|
|
2
2
|
import { factory } from '../../../factory';
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function createMongoConditions(params: factory.reservation.eventReservation.ISearchConditions): FilterQuery<import("@chevre/factory/lib/chevre/reservation/event").IReservation>[];
|