@chevre/domain 22.2.0-alpha.9 → 22.3.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/example/src/chevre/createProject.ts +19 -0
- package/example/src/chevre/findValidAuthorization.ts +1 -2
- package/example/src/chevre/migrateDeleteTransactionTasks.ts +1 -1
- package/example/src/chevre/{migrateMovieTheaterAdditionalProperties.ts → migrateRoomAdditionalProperties.ts} +17 -17
- package/example/src/chevre/migrateRoomSectionAdditionalProperties.ts +119 -0
- package/example/src/chevre/playAroundTicket.ts +3 -2
- package/example/src/chevre/processAction.ts +3 -1
- package/example/src/chevre/projectFields.ts +42 -0
- package/example/src/chevre/{projectEventFieldsById.ts → projectFieldsById.ts} +7 -12
- package/example/src/chevre/searchActionsByPurpose.ts +38 -0
- package/example/src/chevre/searchProjects.ts +9 -4
- package/example/src/chevre/searchSellersByAggregate.ts +3 -3
- package/example/src/chevre/searchTransactions.ts +1 -1
- package/example/src/chevre/unsetUnnecessaryFields.ts +2 -41
- package/lib/chevre/repo/accountTitle.d.ts +9 -3
- package/lib/chevre/repo/accountingReport.d.ts +2 -15
- package/lib/chevre/repo/action.d.ts +110 -47
- package/lib/chevre/repo/action.js +170 -133
- package/lib/chevre/repo/aggregateReservation.d.ts +1 -14
- package/lib/chevre/repo/assetTransaction.d.ts +134 -7
- package/lib/chevre/repo/assetTransaction.js +2 -2
- package/lib/chevre/repo/categoryCode.d.ts +14 -2
- package/lib/chevre/repo/categoryCode.js +47 -19
- package/lib/chevre/repo/comment.d.ts +5 -1
- package/lib/chevre/repo/creativeWork.d.ts +14 -2
- package/lib/chevre/repo/customer.d.ts +5 -1
- package/lib/chevre/repo/customerType.d.ts +1 -1
- package/lib/chevre/repo/event.d.ts +49 -2
- package/lib/chevre/repo/member.d.ts +5 -1
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +22 -2
- package/lib/chevre/repo/message.d.ts +1 -15
- package/lib/chevre/repo/mongoose/schemas/account.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/account.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountTitle.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/accountTitle.js +2 -2
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/accountTransaction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +22 -3
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/action.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/action.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.d.ts +14 -3
- package/lib/chevre/repo/mongoose/schemas/actionRecipe.js +2 -5
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +12 -12
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +11 -3
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.d.ts +22 -3
- package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/aggregation.d.ts +7 -3
- package/lib/chevre/repo/mongoose/schemas/aggregation.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/authorization.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/categoryCode.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/categoryCode.js +22 -24
- package/lib/chevre/repo/mongoose/schemas/comments.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/comments.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/creativeWork.js +2 -2
- package/lib/chevre/repo/mongoose/schemas/customer.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/customer.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/customerType.d.ts +9 -3
- package/lib/chevre/repo/mongoose/schemas/customerType.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/emailMessages.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/emailMessages.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +19 -3
- package/lib/chevre/repo/mongoose/schemas/event.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/member.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/member.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/message.d.ts +23 -3
- package/lib/chevre/repo/mongoose/schemas/message.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/note.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/note.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/offerCatalog.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/offerCatalogItem.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/order.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/paymentService.d.ts +10 -3
- package/lib/chevre/repo/mongoose/schemas/paymentService.js +13 -4
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +16 -3
- package/lib/chevre/repo/mongoose/schemas/place.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +11 -3
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/product.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/product.js +6 -13
- package/lib/chevre/repo/mongoose/schemas/productModel.d.ts +30 -3
- package/lib/chevre/repo/mongoose/schemas/productModel.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/project.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/project.js +3 -3
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +12 -3
- package/lib/chevre/repo/mongoose/schemas/reservation.js +5 -5
- package/lib/chevre/repo/mongoose/schemas/role.d.ts +9 -3
- package/lib/chevre/repo/mongoose/schemas/role.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/seller.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/seller.js +22 -24
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/serviceOutput.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/task.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/telemetry.d.ts +7 -3
- package/lib/chevre/repo/mongoose/schemas/telemetry.js +2 -1
- package/lib/chevre/repo/mongoose/schemas/ticket.d.ts +26 -3
- package/lib/chevre/repo/mongoose/schemas/ticket.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/transaction.js +2 -2
- package/lib/chevre/repo/mongoose/schemas/trip.d.ts +8 -3
- package/lib/chevre/repo/mongoose/schemas/trip.js +3 -3
- package/lib/chevre/repo/offer.d.ts +13 -4
- package/lib/chevre/repo/offerCatalog.d.ts +15 -2
- package/lib/chevre/repo/order.d.ts +13 -1
- package/lib/chevre/repo/ownershipInfo.d.ts +15 -3
- package/lib/chevre/repo/ownershipInfo.js +40 -11
- package/lib/chevre/repo/paymentService.d.ts +2 -2
- package/lib/chevre/repo/paymentService.js +108 -58
- package/lib/chevre/repo/paymentServiceProvider.d.ts +1 -10
- package/lib/chevre/repo/place/movieTheater.d.ts +54 -2
- package/lib/chevre/repo/priceSpecification.d.ts +42 -1
- package/lib/chevre/repo/product.d.ts +8 -3
- package/lib/chevre/repo/product.js +67 -33
- package/lib/chevre/repo/productModel.d.ts +1 -22
- package/lib/chevre/repo/project.d.ts +25 -5
- package/lib/chevre/repo/project.js +69 -28
- package/lib/chevre/repo/reservation.d.ts +35 -3
- package/lib/chevre/repo/reservation.js +1 -1
- package/lib/chevre/repo/role.d.ts +2 -9
- package/lib/chevre/repo/role.js +20 -10
- package/lib/chevre/repo/seller.d.ts +64 -14
- package/lib/chevre/repo/seller.js +61 -27
- package/lib/chevre/repo/task.d.ts +64 -3
- package/lib/chevre/repo/telemetry.d.ts +3 -2
- package/lib/chevre/repo/ticket.d.ts +4 -20
- package/lib/chevre/repo/ticket.js +23 -10
- package/lib/chevre/repo/transaction.d.ts +30 -14
- package/lib/chevre/repo/transaction.js +106 -77
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +1 -1
- package/lib/chevre/service/aggregation/event/findEventOffers.js +1 -1
- package/lib/chevre/service/aggregation/project.js +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation.js +2 -2
- package/lib/chevre/service/assetTransaction/moneyTransfer.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/pay.js +3 -3
- package/lib/chevre/service/assetTransaction/refund/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/refund.js +3 -3
- package/lib/chevre/service/assetTransaction/registerService.js +4 -6
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.js +9 -11
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start.js +1 -3
- package/lib/chevre/service/code.d.ts +0 -4
- package/lib/chevre/service/code.js +22 -18
- package/lib/chevre/service/event.js +4 -4
- package/lib/chevre/service/moneyTransfer.js +3 -5
- package/lib/chevre/service/notification.js +2 -2
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +3 -3
- package/lib/chevre/service/offer/event/authorize/factory.js +16 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +2 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +3 -2
- package/lib/chevre/service/offer/event/authorize.d.ts +4 -2
- package/lib/chevre/service/offer/event/authorize.js +3 -2
- package/lib/chevre/service/offer/event/importFromCOA.js +2 -2
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +4 -12
- package/lib/chevre/service/offer/event/voidTransaction.js +2 -2
- package/lib/chevre/service/offer/event/voidTransactionByActionId.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.d.ts +2 -2
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/authorize.js +45 -5
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer/factory.d.ts +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +3 -3
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.d.ts +7 -3
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +10 -5
- package/lib/chevre/service/offer/eventServiceByCOA/authorizeByAcceptAction.d.ts +3 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.d.ts +3 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +14 -6
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +8 -5
- package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.d.ts +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/validateAcceptedOffers.js +38 -17
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +1 -1
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +1 -1
- package/lib/chevre/service/offer/product/searchProductOffers.js +1 -3
- package/lib/chevre/service/offer/product.d.ts +4 -2
- package/lib/chevre/service/offer/product.js +12 -12
- package/lib/chevre/service/order/findPlaceOrderTransaction.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderInTransit.js +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/placeOrder/createPlacingOrderFromExistingTransaction.js +3 -3
- package/lib/chevre/service/order/placeOrder.js +1 -1
- package/lib/chevre/service/order/returnOrder.js +1 -1
- package/lib/chevre/service/payment/any/factory.d.ts +1 -1
- package/lib/chevre/service/payment/any/onPaid.d.ts +1 -1
- package/lib/chevre/service/payment/any/onRefund.d.ts +1 -1
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +1 -4
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +21 -26
- package/lib/chevre/service/payment/any.d.ts +3 -1
- package/lib/chevre/service/payment/any.js +21 -13
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard.js +1 -1
- package/lib/chevre/service/payment/creditCard/authorize/processAuthorizeCreditCard3ds.js +1 -1
- package/lib/chevre/service/payment/creditCard/payCreditCard.d.ts +1 -2
- package/lib/chevre/service/payment/creditCard/payCreditCard.js +12 -5
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +13 -3
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
- package/lib/chevre/service/payment/faceToFace.d.ts +2 -2
- package/lib/chevre/service/payment/faceToFace.js +28 -10
- package/lib/chevre/service/payment/movieTicket/authorize.d.ts +0 -1
- package/lib/chevre/service/payment/movieTicket/authorize.js +8 -3
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.d.ts +1 -2
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +12 -4
- package/lib/chevre/service/payment/movieTicket/refundMovieTicket.js +15 -4
- package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
- package/lib/chevre/service/payment/paymentCard.d.ts +2 -2
- package/lib/chevre/service/payment/paymentCard.js +29 -16
- package/lib/chevre/service/payment.d.ts +1 -1
- package/lib/chevre/service/report/telemetry.js +2 -2
- package/lib/chevre/service/reserve/cancelReservation.js +1 -1
- package/lib/chevre/service/reserve/confirmReservation.js +1 -1
- package/lib/chevre/service/task/onAuthorizationCreated.js +20 -16
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +2 -2
- package/lib/chevre/service/task/onResourceUpdated/syncCategoryCode.js +1 -1
- package/lib/chevre/service/task/onResourceUpdated.js +16 -4
- package/lib/chevre/service/task/publishPaymentUrl.js +4 -0
- package/lib/chevre/service/task/returnPayTransaction.js +1 -1
- package/lib/chevre/service/transaction/deleteTransaction.js +2 -2
- package/lib/chevre/service/transaction/moneyTransfer.js +4 -4
- package/lib/chevre/service/transaction/placeOrder/confirm.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasksById.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/start/validateStartRequest.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/start.js +1 -1
- package/lib/chevre/service/transaction/returnOrder/preStart.d.ts +2 -2
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/service/transaction/returnOrder.js +2 -2
- package/lib/chevre/service/transaction.js +1 -1
- package/package.json +4 -4
- package/example/src/chevre/findTransactionById.ts +0 -23
- package/example/src/chevre/findTransactionInProgressById.ts +0 -23
- package/example/src/chevre/migrateTransactionObjectPaymentMethods.ts +0 -154
- package/example/src/chevre/projectReservationFields.ts +0 -31
- package/example/src/chevre/searchActions.ts +0 -40
- package/example/src/chevre/searchProducts.ts +0 -28
|
@@ -24,6 +24,17 @@ exports.PaymentServiceRepo = void 0;
|
|
|
24
24
|
const factory = require("../factory");
|
|
25
25
|
const settings_1 = require("../settings");
|
|
26
26
|
const paymentService_1 = require("./mongoose/schemas/paymentService");
|
|
27
|
+
const AVAILABLE_PROJECT_FIELDS = [
|
|
28
|
+
'project',
|
|
29
|
+
'typeOf',
|
|
30
|
+
'additionalProperty',
|
|
31
|
+
'availableChannel',
|
|
32
|
+
'description',
|
|
33
|
+
'name',
|
|
34
|
+
'productID',
|
|
35
|
+
'serviceOutput',
|
|
36
|
+
'serviceType'
|
|
37
|
+
];
|
|
27
38
|
/**
|
|
28
39
|
* 決済サービスリポジトリ
|
|
29
40
|
*/
|
|
@@ -33,7 +44,7 @@ class PaymentServiceRepo {
|
|
|
33
44
|
}
|
|
34
45
|
// tslint:disable-next-line:max-func-body-length
|
|
35
46
|
static CREATE_MONGO_CONDITIONS(params) {
|
|
36
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
47
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
37
48
|
// MongoDB検索条件
|
|
38
49
|
const andConditions = [];
|
|
39
50
|
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
@@ -54,68 +65,80 @@ class PaymentServiceRepo {
|
|
|
54
65
|
typeOf: { $in: typeOfIn }
|
|
55
66
|
});
|
|
56
67
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
68
|
+
// discontinue(2024-08-20~)
|
|
69
|
+
// const hasOfferCatalogIdEq = params.hasOfferCatalog?.id?.$eq;
|
|
70
|
+
// if (typeof hasOfferCatalogIdEq === 'string') {
|
|
71
|
+
// andConditions.push({
|
|
72
|
+
// 'hasOfferCatalog.id': {
|
|
73
|
+
// $exists: true,
|
|
74
|
+
// $eq: hasOfferCatalogIdEq
|
|
75
|
+
// }
|
|
76
|
+
// });
|
|
77
|
+
// }
|
|
78
|
+
const idEq = (_e = params.id) === null || _e === void 0 ? void 0 : _e.$eq;
|
|
67
79
|
if (typeof idEq === 'string') {
|
|
68
80
|
andConditions.push({ _id: { $eq: idEq } });
|
|
69
81
|
}
|
|
70
|
-
const idIn = (
|
|
82
|
+
const idIn = (_f = params.id) === null || _f === void 0 ? void 0 : _f.$in;
|
|
71
83
|
if (Array.isArray(idIn)) {
|
|
72
84
|
andConditions.push({ _id: { $in: idIn } });
|
|
73
85
|
}
|
|
74
|
-
const productIDEq = (
|
|
86
|
+
const productIDEq = (_g = params.productID) === null || _g === void 0 ? void 0 : _g.$eq;
|
|
75
87
|
if (typeof productIDEq === 'string') {
|
|
76
88
|
andConditions.push({
|
|
77
89
|
productID: { $eq: productIDEq }
|
|
78
90
|
});
|
|
79
91
|
}
|
|
80
|
-
const productIDIn = (
|
|
92
|
+
const productIDIn = (_h = params.productID) === null || _h === void 0 ? void 0 : _h.$in;
|
|
81
93
|
if (Array.isArray(productIDIn)) {
|
|
82
94
|
andConditions.push({
|
|
83
95
|
productID: { $in: productIDIn }
|
|
84
96
|
});
|
|
85
97
|
}
|
|
86
|
-
const productIDRegex = (
|
|
98
|
+
const productIDRegex = (_j = params.productID) === null || _j === void 0 ? void 0 : _j.$regex;
|
|
87
99
|
if (typeof productIDRegex === 'string' && productIDRegex.length > 0) {
|
|
88
100
|
andConditions.push({
|
|
89
101
|
productID: { $regex: new RegExp(productIDRegex) }
|
|
90
102
|
});
|
|
91
103
|
}
|
|
92
|
-
|
|
93
|
-
|
|
104
|
+
// discontinue(2024-08-20~)
|
|
105
|
+
// const offersElemMatch = params.offers?.$elemMatch;
|
|
106
|
+
// if (offersElemMatch !== undefined && offersElemMatch !== null) {
|
|
107
|
+
// andConditions.push({
|
|
108
|
+
// offers: {
|
|
109
|
+
// $elemMatch: offersElemMatch
|
|
110
|
+
// }
|
|
111
|
+
// });
|
|
112
|
+
// }
|
|
113
|
+
const serviceOutputTypeOfEq = (_l = (_k = params.serviceOutput) === null || _k === void 0 ? void 0 : _k.typeOf) === null || _l === void 0 ? void 0 : _l.$eq;
|
|
114
|
+
if (typeof serviceOutputTypeOfEq === 'string') {
|
|
94
115
|
andConditions.push({
|
|
95
|
-
|
|
96
|
-
$
|
|
116
|
+
'serviceOutput.typeOf': {
|
|
117
|
+
$exists: true,
|
|
118
|
+
$eq: serviceOutputTypeOfEq
|
|
97
119
|
}
|
|
98
120
|
});
|
|
99
121
|
}
|
|
100
|
-
const
|
|
101
|
-
if (typeof
|
|
122
|
+
const serviceOutputPaymentMethodAmountCurrencyEq = (_q = (_p = (_o = (_m = params.serviceOutput) === null || _m === void 0 ? void 0 : _m.paymentMethod) === null || _o === void 0 ? void 0 : _o.amount) === null || _p === void 0 ? void 0 : _p.currency) === null || _q === void 0 ? void 0 : _q.$eq;
|
|
123
|
+
if (typeof serviceOutputPaymentMethodAmountCurrencyEq === 'string') {
|
|
102
124
|
andConditions.push({
|
|
103
|
-
'serviceOutput.
|
|
125
|
+
'serviceOutput.paymentMethod.amount.currency': {
|
|
104
126
|
$exists: true,
|
|
105
|
-
$eq:
|
|
127
|
+
$eq: serviceOutputPaymentMethodAmountCurrencyEq
|
|
106
128
|
}
|
|
107
129
|
});
|
|
108
130
|
}
|
|
109
|
-
|
|
110
|
-
|
|
131
|
+
// extend(2024-08-20~)
|
|
132
|
+
const serviceOutputIssuedThroughServiceTypeCodeValueEq = (_u = (_t = (_s = (_r = params.serviceOutput) === null || _r === void 0 ? void 0 : _r.issuedThrough) === null || _s === void 0 ? void 0 : _s.serviceType) === null || _t === void 0 ? void 0 : _t.codeValue) === null || _u === void 0 ? void 0 : _u.$eq;
|
|
133
|
+
if (typeof serviceOutputIssuedThroughServiceTypeCodeValueEq === 'string') {
|
|
111
134
|
andConditions.push({
|
|
112
|
-
'serviceOutput.
|
|
135
|
+
'serviceOutput.issuedThrough.serviceType.codeValue': {
|
|
113
136
|
$exists: true,
|
|
114
|
-
$eq:
|
|
137
|
+
$eq: serviceOutputIssuedThroughServiceTypeCodeValueEq
|
|
115
138
|
}
|
|
116
139
|
});
|
|
117
140
|
}
|
|
118
|
-
const serviceTypeCodeValueEq = (
|
|
141
|
+
const serviceTypeCodeValueEq = (_w = (_v = params.serviceType) === null || _v === void 0 ? void 0 : _v.codeValue) === null || _w === void 0 ? void 0 : _w.$eq;
|
|
119
142
|
if (typeof serviceTypeCodeValueEq === 'string') {
|
|
120
143
|
andConditions.push({
|
|
121
144
|
'serviceType.codeValue': {
|
|
@@ -124,7 +147,7 @@ class PaymentServiceRepo {
|
|
|
124
147
|
}
|
|
125
148
|
});
|
|
126
149
|
}
|
|
127
|
-
const nameRegex = (
|
|
150
|
+
const nameRegex = (_x = params.name) === null || _x === void 0 ? void 0 : _x.$regex;
|
|
128
151
|
if (typeof nameRegex === 'string' && nameRegex.length > 0) {
|
|
129
152
|
const nameRegexExp = new RegExp(nameRegex);
|
|
130
153
|
andConditions.push({
|
|
@@ -145,7 +168,7 @@ class PaymentServiceRepo {
|
|
|
145
168
|
});
|
|
146
169
|
}
|
|
147
170
|
// プロバイダー条件を追加(2023-06-21~)
|
|
148
|
-
const providerIdEq = (
|
|
171
|
+
const providerIdEq = (_z = (_y = params.provider) === null || _y === void 0 ? void 0 : _y.id) === null || _z === void 0 ? void 0 : _z.$eq;
|
|
149
172
|
if (typeof providerIdEq === 'string') {
|
|
150
173
|
andConditions.push({ 'provider.id': { $exists: true, $eq: providerIdEq } });
|
|
151
174
|
}
|
|
@@ -155,70 +178,97 @@ class PaymentServiceRepo {
|
|
|
155
178
|
* 決済サービスを保管する
|
|
156
179
|
*/
|
|
157
180
|
savePaymentService(params) {
|
|
181
|
+
var _a, _b;
|
|
158
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
159
183
|
let doc;
|
|
184
|
+
let savedId;
|
|
160
185
|
if (typeof params.id === 'string') {
|
|
161
186
|
// 上書き禁止属性を除外
|
|
162
|
-
const
|
|
187
|
+
const _c = params.$set, { id, productID, project, typeOf, provider } = _c, setFields = __rest(_c, ["id", "productID", "project", "typeOf", "provider"]);
|
|
163
188
|
switch (typeOf) {
|
|
164
189
|
case factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
165
190
|
case factory.service.paymentService.PaymentServiceType.MovieTicket:
|
|
166
191
|
doc = yield this.paymentServiceModel.findOneAndUpdate({
|
|
167
192
|
_id: { $eq: params.id },
|
|
168
193
|
typeOf: { $eq: typeOf }
|
|
169
|
-
}, {
|
|
194
|
+
}, {
|
|
195
|
+
$set: setFields,
|
|
196
|
+
$unset: params.$unset
|
|
197
|
+
}, { upsert: false, new: true, projection: { _id: 1, id: { $toString: '$_id' } } })
|
|
198
|
+
.lean()
|
|
170
199
|
.exec();
|
|
200
|
+
if (doc === null) {
|
|
201
|
+
throw new factory.errors.NotFound(this.paymentServiceModel.modelName);
|
|
202
|
+
}
|
|
171
203
|
break;
|
|
172
204
|
default:
|
|
173
205
|
throw new factory.errors.NotImplemented(`${typeOf} not implemented`);
|
|
174
206
|
}
|
|
207
|
+
savedId = params.id;
|
|
175
208
|
}
|
|
176
209
|
else {
|
|
177
|
-
const
|
|
210
|
+
const _d = params.$set, { id } = _d, createParams = __rest(_d, ["id"]);
|
|
178
211
|
if (params.createIfNotExist === true) {
|
|
179
212
|
doc = yield this.paymentServiceModel.findOneAndUpdate({
|
|
180
213
|
'project.id': { $eq: createParams.project.id },
|
|
181
214
|
typeOf: { $eq: createParams.typeOf }
|
|
182
|
-
}, { $setOnInsert: createParams }, { new: true, upsert: true, projection: { _id: 1 } })
|
|
215
|
+
}, { $setOnInsert: createParams }, { new: true, upsert: true, projection: { _id: 1, id: { $toString: '$_id' } } })
|
|
216
|
+
.lean()
|
|
183
217
|
.exec();
|
|
218
|
+
if (doc === null) {
|
|
219
|
+
throw new factory.errors.NotFound(this.paymentServiceModel.modelName);
|
|
220
|
+
}
|
|
221
|
+
savedId = doc.id;
|
|
184
222
|
}
|
|
185
223
|
else {
|
|
186
|
-
doc =
|
|
224
|
+
// doc = await this.paymentServiceModel.create(createParams);
|
|
225
|
+
const result = yield this.paymentServiceModel.insertMany(createParams, { rawResult: true });
|
|
226
|
+
const insertedId = (_b = (_a = result.insertedIds) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.toHexString();
|
|
227
|
+
if (typeof insertedId !== 'string') {
|
|
228
|
+
throw new factory.errors.Internal(`paymentService not saved unexpectedly. result:${JSON.stringify(result)}`);
|
|
229
|
+
}
|
|
230
|
+
savedId = insertedId;
|
|
187
231
|
}
|
|
188
232
|
}
|
|
189
|
-
|
|
190
|
-
throw new factory.errors.NotFound(this.paymentServiceModel.modelName);
|
|
191
|
-
}
|
|
192
|
-
return doc.toObject();
|
|
233
|
+
return { id: savedId };
|
|
193
234
|
});
|
|
194
235
|
}
|
|
195
236
|
/**
|
|
196
237
|
* 決済サービスを検索する
|
|
197
238
|
*/
|
|
198
|
-
|
|
239
|
+
projectFields(conditions, inclusion, exclusion) {
|
|
199
240
|
var _a;
|
|
200
241
|
return __awaiter(this, void 0, void 0, function* () {
|
|
201
242
|
const andConditions = PaymentServiceRepo.CREATE_MONGO_CONDITIONS(conditions);
|
|
202
|
-
let
|
|
243
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
203
244
|
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
204
|
-
inclusion.
|
|
205
|
-
projection[field] = 1;
|
|
206
|
-
});
|
|
245
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
207
246
|
}
|
|
208
247
|
else {
|
|
209
|
-
projection = {
|
|
210
|
-
__v: 0,
|
|
211
|
-
createdAt: 0,
|
|
212
|
-
updatedAt: 0,
|
|
213
|
-
offers: 0,
|
|
214
|
-
provider: 0 // paymentServiceProviderRepoへの完全移行につき除外(2023-12-20~)
|
|
215
|
-
};
|
|
216
248
|
if (Array.isArray(exclusion) && exclusion.length > 0) {
|
|
217
|
-
|
|
218
|
-
projection[field] = 0;
|
|
219
|
-
});
|
|
249
|
+
positiveProjectionFields = positiveProjectionFields.filter((key) => !exclusion.includes(key));
|
|
220
250
|
}
|
|
221
251
|
}
|
|
252
|
+
const projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
|
|
253
|
+
// let projection: { [key: string]: number } = {};
|
|
254
|
+
// if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
255
|
+
// inclusion.forEach((field) => {
|
|
256
|
+
// projection[field] = 1;
|
|
257
|
+
// });
|
|
258
|
+
// } else {
|
|
259
|
+
// projection = {
|
|
260
|
+
// __v: 0,
|
|
261
|
+
// createdAt: 0,
|
|
262
|
+
// updatedAt: 0,
|
|
263
|
+
// offers: 0,
|
|
264
|
+
// provider: 0 // paymentServiceProviderRepoへの完全移行につき除外(2023-12-20~)
|
|
265
|
+
// };
|
|
266
|
+
// if (Array.isArray(exclusion) && exclusion.length > 0) {
|
|
267
|
+
// exclusion.forEach((field) => {
|
|
268
|
+
// projection[field] = 0;
|
|
269
|
+
// });
|
|
270
|
+
// }
|
|
271
|
+
// }
|
|
222
272
|
const query = this.paymentServiceModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, projection);
|
|
223
273
|
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
224
274
|
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
@@ -231,13 +281,13 @@ class PaymentServiceRepo {
|
|
|
231
281
|
query.sort({ productID: conditions.sort.productID });
|
|
232
282
|
}
|
|
233
283
|
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
234
|
-
.
|
|
235
|
-
.
|
|
284
|
+
.lean() // 2024-08-20~
|
|
285
|
+
.exec();
|
|
236
286
|
});
|
|
237
287
|
}
|
|
238
288
|
deletePaymentServiceById(params) {
|
|
239
289
|
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
-
yield this.paymentServiceModel.findOneAndDelete({ _id: params.id })
|
|
290
|
+
yield this.paymentServiceModel.findOneAndDelete({ _id: { $eq: params.id } }, { projection: { _id: 1 } })
|
|
241
291
|
.exec();
|
|
242
292
|
});
|
|
243
293
|
}
|
|
@@ -247,7 +297,7 @@ class PaymentServiceRepo {
|
|
|
247
297
|
findAvailableChannel(params) {
|
|
248
298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
249
299
|
let paymentService;
|
|
250
|
-
paymentService = (yield this.
|
|
300
|
+
paymentService = (yield this.projectFields({
|
|
251
301
|
limit: 1,
|
|
252
302
|
page: 1,
|
|
253
303
|
project: { id: { $eq: params.project.id } },
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
import { Connection, FilterQuery } from 'mongoose';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
3
|
type IAvailablePaymentServiceType = factory.service.paymentService.PaymentServiceType.CreditCard | factory.service.paymentService.PaymentServiceType.MovieTicket;
|
|
4
|
-
/**
|
|
5
|
-
* 決済サービス検索条件
|
|
6
|
-
*/
|
|
7
|
-
type ISearchConditions4paymentService = factory.product.ISearchConditions & {
|
|
8
|
-
typeOf?: {
|
|
9
|
-
$eq?: factory.service.paymentService.PaymentServiceType;
|
|
10
|
-
$in?: factory.service.paymentService.PaymentServiceType[];
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
4
|
export type IPublicPaymentServiceByProvider = Pick<factory.service.paymentService.IService, 'name' | 'description' | 'typeOf' | 'id' | 'productID' | 'serviceType' | 'serviceOutput' | 'additionalProperty'> & {
|
|
14
5
|
provider?: {
|
|
15
6
|
credentials?: Pick<factory.service.paymentService.IProviderCredentials, 'shopId' | 'paymentUrl' | 'tokenizationCode'>;
|
|
@@ -46,7 +37,7 @@ export declare class PaymentServiceProviderRepo {
|
|
|
46
37
|
/**
|
|
47
38
|
* 販売者の提供決済サービス(公開情報のみ)検索
|
|
48
39
|
*/
|
|
49
|
-
searchPublicPaymentServicesByProvider(params: Pick<
|
|
40
|
+
searchPublicPaymentServicesByProvider(params: Pick<factory.service.paymentService.ISearchConditions, 'limit' | 'page' | 'sort' | 'project' | 'provider' | 'typeOf'>): Promise<IPublicPaymentServiceByProvider[]>;
|
|
50
41
|
create(params: factory.service.paymentService.IProvider & {
|
|
51
42
|
project: {
|
|
52
43
|
id: string;
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
-
import type { Connection, FilterQuery } from 'mongoose';
|
|
25
|
+
import type { Connection, Document, FilterQuery } from 'mongoose';
|
|
26
26
|
import * as factory from '../../factory';
|
|
27
27
|
export type IScreeningRoomFoundByBranchCode = Pick<factory.place.screeningRoom.IPlace, 'typeOf' | 'branchCode' | 'name' | 'containsPlace' | 'seatCount' | 'parentOrganization'>;
|
|
28
28
|
export type IMovieTheaterIncludingScreeningRooms = factory.place.movieTheater.IPlace & {
|
|
@@ -73,6 +73,58 @@ export declare class MovieTheaterRepo {
|
|
|
73
73
|
id: string;
|
|
74
74
|
};
|
|
75
75
|
}): Promise<void>;
|
|
76
|
-
getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<
|
|
76
|
+
getCursor(conditions: FilterQuery<any>, projection: any): import("mongoose").Cursor<Document<unknown, {}, ((import("@chevre/factory/lib/place/movieTheater").IPlace & {
|
|
77
|
+
hasPOS?: import("@chevre/factory/lib/place/movieTheater").IPOS[] | undefined;
|
|
78
|
+
}) | import("@chevre/factory/lib/place/screeningRoom").IPlace) & {
|
|
79
|
+
alternateName?: any;
|
|
80
|
+
description?: any;
|
|
81
|
+
openingHoursSpecification?: any;
|
|
82
|
+
smokingAllowed?: boolean | undefined;
|
|
83
|
+
sameAs?: any;
|
|
84
|
+
}> & Omit<(import("@chevre/factory/lib/place/movieTheater").IPlace & {
|
|
85
|
+
hasPOS?: import("@chevre/factory/lib/place/movieTheater").IPOS[] | undefined;
|
|
86
|
+
} & {
|
|
87
|
+
alternateName?: any;
|
|
88
|
+
description?: any;
|
|
89
|
+
openingHoursSpecification?: any;
|
|
90
|
+
smokingAllowed?: boolean | undefined;
|
|
91
|
+
sameAs?: any;
|
|
92
|
+
} & {
|
|
93
|
+
_id: import("mongoose").Types.ObjectId;
|
|
94
|
+
}) | (import("@chevre/factory/lib/place/screeningRoom").IPlace & {
|
|
95
|
+
alternateName?: any;
|
|
96
|
+
description?: any;
|
|
97
|
+
openingHoursSpecification?: any;
|
|
98
|
+
smokingAllowed?: boolean | undefined;
|
|
99
|
+
sameAs?: any;
|
|
100
|
+
} & {
|
|
101
|
+
_id: import("mongoose").Types.ObjectId;
|
|
102
|
+
}), never>, import("mongoose").QueryOptions<Document<unknown, {}, ((import("@chevre/factory/lib/place/movieTheater").IPlace & {
|
|
103
|
+
hasPOS?: import("@chevre/factory/lib/place/movieTheater").IPOS[] | undefined;
|
|
104
|
+
}) | import("@chevre/factory/lib/place/screeningRoom").IPlace) & {
|
|
105
|
+
alternateName?: any;
|
|
106
|
+
description?: any;
|
|
107
|
+
openingHoursSpecification?: any;
|
|
108
|
+
smokingAllowed?: boolean | undefined;
|
|
109
|
+
sameAs?: any;
|
|
110
|
+
}> & Omit<(import("@chevre/factory/lib/place/movieTheater").IPlace & {
|
|
111
|
+
hasPOS?: import("@chevre/factory/lib/place/movieTheater").IPOS[] | undefined;
|
|
112
|
+
} & {
|
|
113
|
+
alternateName?: any;
|
|
114
|
+
description?: any;
|
|
115
|
+
openingHoursSpecification?: any;
|
|
116
|
+
smokingAllowed?: boolean | undefined;
|
|
117
|
+
sameAs?: any;
|
|
118
|
+
} & {
|
|
119
|
+
_id: import("mongoose").Types.ObjectId;
|
|
120
|
+
}) | (import("@chevre/factory/lib/place/screeningRoom").IPlace & {
|
|
121
|
+
alternateName?: any;
|
|
122
|
+
description?: any;
|
|
123
|
+
openingHoursSpecification?: any;
|
|
124
|
+
smokingAllowed?: boolean | undefined;
|
|
125
|
+
sameAs?: any;
|
|
126
|
+
} & {
|
|
127
|
+
_id: import("mongoose").Types.ObjectId;
|
|
128
|
+
}), never>>>;
|
|
77
129
|
}
|
|
78
130
|
export {};
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import type { Connection } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
|
+
import { IDocType } from './mongoose/schemas/priceSpecification';
|
|
27
28
|
/**
|
|
28
29
|
* 価格仕様リポジトリ
|
|
29
30
|
*/
|
|
@@ -54,7 +55,47 @@ export declare class PriceSpecificationRepo {
|
|
|
54
55
|
id: string;
|
|
55
56
|
};
|
|
56
57
|
}): Promise<void>;
|
|
57
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<
|
|
58
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, IDocType> & Omit<(import("@chevre/factory/lib/priceSpecification/categoryCodeChargeSpecification").IPriceSpecification & {
|
|
59
|
+
validFrom?: Date | undefined;
|
|
60
|
+
validThrough?: Date | undefined;
|
|
61
|
+
} & {
|
|
62
|
+
_id: import("mongoose").Types.ObjectId;
|
|
63
|
+
}) | (import("@chevre/factory/lib/priceSpecification/movieTicketTypeChargeSpecification").IPriceSpecification & {
|
|
64
|
+
validFrom?: Date | undefined;
|
|
65
|
+
validThrough?: Date | undefined;
|
|
66
|
+
} & {
|
|
67
|
+
_id: import("mongoose").Types.ObjectId;
|
|
68
|
+
}) | (import("@chevre/factory/lib/priceSpecification/unitPriceSpecification").IPriceSpecification & {
|
|
69
|
+
validFrom?: Date | undefined;
|
|
70
|
+
validThrough?: Date | undefined;
|
|
71
|
+
} & {
|
|
72
|
+
_id: import("mongoose").Types.ObjectId;
|
|
73
|
+
}) | (import("@chevre/factory/lib/priceSpecification").IPriceSpecification<factory.priceSpecificationType> & {
|
|
74
|
+
validFrom?: Date | undefined;
|
|
75
|
+
validThrough?: Date | undefined;
|
|
76
|
+
} & {
|
|
77
|
+
_id: import("mongoose").Types.ObjectId;
|
|
78
|
+
}), never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, IDocType> & Omit<(import("@chevre/factory/lib/priceSpecification/categoryCodeChargeSpecification").IPriceSpecification & {
|
|
79
|
+
validFrom?: Date | undefined;
|
|
80
|
+
validThrough?: Date | undefined;
|
|
81
|
+
} & {
|
|
82
|
+
_id: import("mongoose").Types.ObjectId;
|
|
83
|
+
}) | (import("@chevre/factory/lib/priceSpecification/movieTicketTypeChargeSpecification").IPriceSpecification & {
|
|
84
|
+
validFrom?: Date | undefined;
|
|
85
|
+
validThrough?: Date | undefined;
|
|
86
|
+
} & {
|
|
87
|
+
_id: import("mongoose").Types.ObjectId;
|
|
88
|
+
}) | (import("@chevre/factory/lib/priceSpecification/unitPriceSpecification").IPriceSpecification & {
|
|
89
|
+
validFrom?: Date | undefined;
|
|
90
|
+
validThrough?: Date | undefined;
|
|
91
|
+
} & {
|
|
92
|
+
_id: import("mongoose").Types.ObjectId;
|
|
93
|
+
}) | (import("@chevre/factory/lib/priceSpecification").IPriceSpecification<factory.priceSpecificationType> & {
|
|
94
|
+
validFrom?: Date | undefined;
|
|
95
|
+
validThrough?: Date | undefined;
|
|
96
|
+
} & {
|
|
97
|
+
_id: import("mongoose").Types.ObjectId;
|
|
98
|
+
}), never>>>;
|
|
58
99
|
reIndex(): Promise<import("bson").Document>;
|
|
59
100
|
unsetUnnecessaryFields(params: {
|
|
60
101
|
filter: any;
|
|
@@ -24,8 +24,9 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import type { BulkWriteResult } from 'mongodb';
|
|
26
26
|
import type { Connection, FilterQuery } from 'mongoose';
|
|
27
|
+
import { IDocTypeAsProduct } from './mongoose/schemas/product';
|
|
27
28
|
import * as factory from '../factory';
|
|
28
|
-
type
|
|
29
|
+
type IKeyOfProjection = keyof factory.product.IProduct;
|
|
29
30
|
/**
|
|
30
31
|
* プロダクト検索条件
|
|
31
32
|
*/
|
|
@@ -41,7 +42,7 @@ export declare class ProductRepo {
|
|
|
41
42
|
/**
|
|
42
43
|
* プロダクトを検索する
|
|
43
44
|
*/
|
|
44
|
-
|
|
45
|
+
projectFields(conditions: ISearchConditions4product, inclusion: IKeyOfProjection[], exclusion: IKeyOfProjection[]): Promise<(factory.product.IProduct & {
|
|
45
46
|
id: string;
|
|
46
47
|
})[]>;
|
|
47
48
|
deleteProductById(params: {
|
|
@@ -110,7 +111,11 @@ export declare class ProductRepo {
|
|
|
110
111
|
id: string;
|
|
111
112
|
};
|
|
112
113
|
}): Promise<void>;
|
|
113
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<
|
|
114
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, IDocTypeAsProduct & import("./mongoose/schemas/product").IDocTypeAsProductOffer> & Omit<IDocTypeAsProduct & import("./mongoose/schemas/product").IDocTypeAsProductOffer & {
|
|
115
|
+
_id: import("mongoose").Types.ObjectId;
|
|
116
|
+
}, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, IDocTypeAsProduct & import("./mongoose/schemas/product").IDocTypeAsProductOffer> & Omit<IDocTypeAsProduct & import("./mongoose/schemas/product").IDocTypeAsProductOffer & {
|
|
117
|
+
_id: import("mongoose").Types.ObjectId;
|
|
118
|
+
}, never>>>;
|
|
114
119
|
unsetUnnecessaryFields(params: {
|
|
115
120
|
filter: FilterQuery<factory.product.IProduct>;
|
|
116
121
|
$unset: any;
|