@chevre/domain 22.2.0-alpha.3 → 22.2.0-alpha.30
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/{projectReservationFieldsById.ts → projectOwnershipInfoFieldsById.ts} +4 -4
- 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 +64 -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/authorization.d.ts +3 -1
- package/lib/chevre/repo/authorization.js +21 -10
- package/lib/chevre/repo/categoryCode.d.ts +18 -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 +12 -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 +23 -7
- package/lib/chevre/repo/ownershipInfo.js +75 -19
- 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/factory.js +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/factory.js +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 +26 -23
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +4 -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 +34 -6
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +22 -22
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +3 -4
- package/lib/chevre/service/offer/event/authorize.d.ts +4 -4
- package/lib/chevre/service/offer/event/authorize.js +3 -2
- package/lib/chevre/service/offer/event/importFromCOA/factory.d.ts +3 -1
- 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 +41 -4
- 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/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/order/sendOrder.js +9 -5
- 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 -6
- package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +26 -34
- package/lib/chevre/service/payment/any.d.ts +3 -3
- 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/ownershipInfo.d.ts +3 -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/authorizePayment.js +0 -2
- 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/validation.d.ts +1 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +36 -2
- package/lib/chevre/service/transaction/placeOrder/confirm.js +2 -2
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.modelName = exports.indexes = exports.createSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const writeConcern_1 = require("../writeConcern");
|
|
6
6
|
const settings_1 = require("../../../settings");
|
|
@@ -22,6 +22,9 @@ const schemaDefinition = {
|
|
|
22
22
|
},
|
|
23
23
|
url: String,
|
|
24
24
|
telephone: String
|
|
25
|
+
// createdAt: SchemaTypes.Mixed,
|
|
26
|
+
// updatedAt: SchemaTypes.Mixed,
|
|
27
|
+
// __v: SchemaTypes.Mixed
|
|
25
28
|
};
|
|
26
29
|
const schemaOptions = {
|
|
27
30
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
@@ -32,10 +35,8 @@ const schemaOptions = {
|
|
|
32
35
|
writeConcern: writeConcern_1.writeConcern,
|
|
33
36
|
strict: true,
|
|
34
37
|
strictQuery: false,
|
|
35
|
-
timestamps:
|
|
36
|
-
|
|
37
|
-
updatedAt: 'updatedAt'
|
|
38
|
-
},
|
|
38
|
+
timestamps: false,
|
|
39
|
+
versionKey: false,
|
|
39
40
|
toJSON: {
|
|
40
41
|
getters: false,
|
|
41
42
|
virtuals: false,
|
|
@@ -49,26 +50,7 @@ const schemaOptions = {
|
|
|
49
50
|
versionKey: false
|
|
50
51
|
}
|
|
51
52
|
};
|
|
52
|
-
/**
|
|
53
|
-
* 販売者スキーマ
|
|
54
|
-
*/
|
|
55
|
-
let schema;
|
|
56
|
-
function createSchema() {
|
|
57
|
-
if (schema === undefined) {
|
|
58
|
-
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
59
|
-
}
|
|
60
|
-
return schema;
|
|
61
|
-
}
|
|
62
|
-
exports.createSchema = createSchema;
|
|
63
53
|
const indexes = [
|
|
64
|
-
[
|
|
65
|
-
{ createdAt: 1 },
|
|
66
|
-
{ name: 'searchByCreatedAt' }
|
|
67
|
-
],
|
|
68
|
-
[
|
|
69
|
-
{ updatedAt: 1 },
|
|
70
|
-
{ name: 'searchByUpdatedAt' }
|
|
71
|
-
],
|
|
72
54
|
[
|
|
73
55
|
{ branchCode: 1 },
|
|
74
56
|
{ name: 'searchByBranchCode' }
|
|
@@ -139,3 +121,19 @@ const indexes = [
|
|
|
139
121
|
]
|
|
140
122
|
];
|
|
141
123
|
exports.indexes = indexes;
|
|
124
|
+
/**
|
|
125
|
+
* 販売者スキーマ
|
|
126
|
+
*/
|
|
127
|
+
let schema;
|
|
128
|
+
function createSchema() {
|
|
129
|
+
if (schema === undefined) {
|
|
130
|
+
schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
|
|
131
|
+
if (settings_1.MONGO_AUTO_INDEX) {
|
|
132
|
+
indexes.forEach((indexParams) => {
|
|
133
|
+
schema === null || schema === void 0 ? void 0 : schema.index(...indexParams);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return schema;
|
|
138
|
+
}
|
|
139
|
+
exports.createSchema = createSchema;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
|
|
1
|
+
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
+
import * as factory from '../../../factory';
|
|
3
|
+
type IDocType = factory.permit.IPermit;
|
|
4
|
+
type IModel = Model<IDocType>;
|
|
5
|
+
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
6
|
+
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
2
7
|
declare const modelName = "ServiceOutput";
|
|
3
|
-
declare function createSchema():
|
|
8
|
+
declare function createSchema(): ISchema;
|
|
4
9
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
5
|
-
export {
|
|
10
|
+
export { createSchema, IModel, indexes, modelName };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.modelName = exports.indexes = exports.createSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const writeConcern_1 = require("../writeConcern");
|
|
6
6
|
const settings_1 = require("../../../settings");
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
|
|
1
|
+
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
+
import * as factory from '../../../factory';
|
|
3
|
+
type IDocType = Omit<factory.task.ITask<factory.taskName>, 'id'>;
|
|
4
|
+
type IModel = Model<IDocType>;
|
|
5
|
+
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
6
|
+
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
2
7
|
declare const modelName = "Task";
|
|
3
8
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
4
|
-
declare function createSchema():
|
|
5
|
-
export {
|
|
9
|
+
declare function createSchema(): ISchema;
|
|
10
|
+
export { createSchema, IModel, indexes, modelName };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.modelName = exports.indexes = exports.createSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const writeConcern_1 = require("../writeConcern");
|
|
6
6
|
const settings_1 = require("../../../settings");
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
|
|
1
|
+
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
+
type IDocType = any;
|
|
3
|
+
type IModel = Model<IDocType>;
|
|
4
|
+
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
5
|
+
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
2
6
|
declare const modelName = "Telemetry";
|
|
3
|
-
declare function createSchema():
|
|
7
|
+
declare function createSchema(): ISchema;
|
|
4
8
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
5
|
-
export {
|
|
9
|
+
export { createSchema, IModel, indexes, modelName };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.modelName = exports.indexes = exports.createSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const writeConcern_1 = require("../writeConcern");
|
|
6
|
+
// import * as factory from '../../../factory';
|
|
6
7
|
const settings_1 = require("../../../settings");
|
|
7
8
|
const modelName = 'Telemetry';
|
|
8
9
|
exports.modelName = modelName;
|
|
@@ -1,5 +1,28 @@
|
|
|
1
|
-
import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
|
|
1
|
+
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
+
import * as factory from '../../../factory';
|
|
3
|
+
export interface ITicketIssuedBy {
|
|
4
|
+
id: string;
|
|
5
|
+
typeOf: factory.organizationType.Corporation | factory.organizationType.Project;
|
|
6
|
+
}
|
|
7
|
+
export interface ITicket {
|
|
8
|
+
/**
|
|
9
|
+
* チケットID(jti)
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
project: {
|
|
13
|
+
id: string;
|
|
14
|
+
typeOf: factory.organizationType.Project;
|
|
15
|
+
};
|
|
16
|
+
typeOf: 'Ticket';
|
|
17
|
+
ticketToken: string;
|
|
18
|
+
dateIssued: Date;
|
|
19
|
+
issuedBy: ITicketIssuedBy;
|
|
20
|
+
}
|
|
21
|
+
type IDocType = Omit<ITicket, 'id'>;
|
|
22
|
+
type IModel = Model<IDocType>;
|
|
23
|
+
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
24
|
+
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
2
25
|
declare const modelName = "Ticket";
|
|
3
26
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
4
|
-
declare function createSchema():
|
|
5
|
-
export {
|
|
27
|
+
declare function createSchema(): ISchema;
|
|
28
|
+
export { createSchema, IModel, indexes, modelName };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.modelName = exports.indexes = exports.createSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const writeConcern_1 = require("../writeConcern");
|
|
6
6
|
const settings_1 = require("../../../settings");
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
|
|
1
|
+
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
+
import * as factory from '../../../factory';
|
|
3
|
+
type IDocType = factory.transaction.ITransaction<factory.transactionType>;
|
|
4
|
+
type IModel = Model<IDocType>;
|
|
5
|
+
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
6
|
+
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
2
7
|
declare const modelName = "Transaction";
|
|
3
8
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
4
|
-
declare function createSchema():
|
|
5
|
-
export {
|
|
9
|
+
declare function createSchema(): ISchema;
|
|
10
|
+
export { createSchema, IModel, indexes, modelName };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.modelName = exports.indexes = exports.createSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
|
-
const factory = require("../../../factory");
|
|
6
5
|
const writeConcern_1 = require("../writeConcern");
|
|
6
|
+
const factory = require("../../../factory");
|
|
7
7
|
const settings_1 = require("../../../settings");
|
|
8
8
|
const modelName = 'Transaction';
|
|
9
9
|
exports.modelName = modelName;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { IndexDefinition, IndexOptions, Schema } from 'mongoose';
|
|
1
|
+
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
|
+
import * as factory from '../../../factory';
|
|
3
|
+
type IDocType = Omit<factory.trip.ITrip<factory.tripType>, 'id'>;
|
|
4
|
+
type IModel = Model<IDocType>;
|
|
5
|
+
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
6
|
+
type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocType>;
|
|
2
7
|
declare const modelName = "Trip";
|
|
3
|
-
declare function createSchema(): Schema;
|
|
4
8
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
5
|
-
|
|
9
|
+
declare function createSchema(): ISchema;
|
|
10
|
+
export { createSchema, IModel, indexes, modelName };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.modelName = exports.indexes = exports.createSchema = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
5
|
const writeConcern_1 = require("../writeConcern");
|
|
6
6
|
const settings_1 = require("../../../settings");
|
|
@@ -39,6 +39,8 @@ const schemaOptions = {
|
|
|
39
39
|
versionKey: false
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
+
const indexes = [];
|
|
43
|
+
exports.indexes = indexes;
|
|
42
44
|
/**
|
|
43
45
|
* トリップスキーマ
|
|
44
46
|
*/
|
|
@@ -50,5 +52,3 @@ function createSchema() {
|
|
|
50
52
|
return schema;
|
|
51
53
|
}
|
|
52
54
|
exports.createSchema = createSchema;
|
|
53
|
-
const indexes = [];
|
|
54
|
-
exports.indexes = indexes;
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import type { BulkWriteResult } from 'mongodb';
|
|
26
|
-
import { AnyExpression, Connection, PipelineStage } from 'mongoose';
|
|
26
|
+
import { AnyExpression, Connection, Document, PipelineStage } from 'mongoose';
|
|
27
27
|
import * as factory from '../factory';
|
|
28
|
+
import { IDocType as IAggregateOfferDocType } from './mongoose/schemas/aggregateOffer';
|
|
28
29
|
type IMatchStage = PipelineStage.Match;
|
|
29
30
|
type KeyOfUnitPriceOffer = keyof Omit<factory.unitPriceOffer.IUnitPriceOffer, 'id'>;
|
|
30
31
|
type IProjection = {
|
|
@@ -216,7 +217,11 @@ export declare class OfferRepo {
|
|
|
216
217
|
};
|
|
217
218
|
};
|
|
218
219
|
}): Promise<import("mongodb").UpdateResult | undefined>;
|
|
219
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<
|
|
220
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
|
|
221
|
+
_id: string;
|
|
222
|
+
}>, never>, import("mongoose").QueryOptions<Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
|
|
223
|
+
_id: string;
|
|
224
|
+
}>, never>>>;
|
|
220
225
|
addAvailableAtOrFrom(params: {
|
|
221
226
|
id: string;
|
|
222
227
|
identifier: string;
|
|
@@ -225,7 +230,9 @@ export declare class OfferRepo {
|
|
|
225
230
|
id: string;
|
|
226
231
|
};
|
|
227
232
|
};
|
|
228
|
-
}): Promise<
|
|
233
|
+
}): Promise<(Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
|
|
234
|
+
_id: string;
|
|
235
|
+
}>, never>) | null>;
|
|
229
236
|
deleteAvailableAtOrFrom(params: {
|
|
230
237
|
id: string;
|
|
231
238
|
offers: {
|
|
@@ -233,7 +240,9 @@ export declare class OfferRepo {
|
|
|
233
240
|
id: string;
|
|
234
241
|
};
|
|
235
242
|
};
|
|
236
|
-
}): Promise<
|
|
243
|
+
}): Promise<(Document<unknown, {}, IAggregateOfferDocType> & Omit<IAggregateOfferDocType & Required<{
|
|
244
|
+
_id: string;
|
|
245
|
+
}>, never>) | null>;
|
|
237
246
|
/**
|
|
238
247
|
* サブカタログから集計オファーIDリストを検索する
|
|
239
248
|
*/
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import type { BulkWriteResult } from 'mongodb';
|
|
26
|
-
import type { Connection } from 'mongoose';
|
|
26
|
+
import type { Connection, Document } from 'mongoose';
|
|
27
27
|
import * as factory from '../factory';
|
|
28
|
+
import { IDocType } from './mongoose/schemas/offerCatalog';
|
|
28
29
|
export type IAggregatedOfferCatalog = Pick<factory.offerCatalog.IOfferCatalog, 'id' | 'name' | 'description' | 'project' | 'typeOf' | 'identifier' | 'itemOffered' | 'additionalProperty'> & {
|
|
29
30
|
numberOfItems?: number;
|
|
30
31
|
itemListElementTypeOf: factory.offerType.Offer | 'OfferCatalog';
|
|
@@ -136,5 +137,17 @@ export declare class OfferCatalogRepo {
|
|
|
136
137
|
id: string;
|
|
137
138
|
};
|
|
138
139
|
}): Promise<void>;
|
|
139
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<
|
|
140
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<Document<unknown, {}, IDocType> & Omit<factory.offerCatalog.IOfferCatalog & {
|
|
141
|
+
_id: string;
|
|
142
|
+
alternateName?: any;
|
|
143
|
+
dateSynced?: Date | undefined;
|
|
144
|
+
} & Required<{
|
|
145
|
+
_id: string;
|
|
146
|
+
}>, never>, import("mongoose").QueryOptions<Document<unknown, {}, IDocType> & Omit<factory.offerCatalog.IOfferCatalog & {
|
|
147
|
+
_id: string;
|
|
148
|
+
alternateName?: any;
|
|
149
|
+
dateSynced?: Date | undefined;
|
|
150
|
+
} & Required<{
|
|
151
|
+
_id: string;
|
|
152
|
+
}>, never>>>;
|
|
140
153
|
}
|
|
@@ -160,7 +160,19 @@ export declare class OrderRepo {
|
|
|
160
160
|
}): Promise<(IOrderWithoutAcceptedOffers & {
|
|
161
161
|
id: string;
|
|
162
162
|
})[]>;
|
|
163
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<
|
|
163
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, Omit<factory.order.IOrder, "id"> & {
|
|
164
|
+
acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
|
|
165
|
+
}> & Omit<Omit<factory.order.IOrder, "id"> & {
|
|
166
|
+
acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
|
|
167
|
+
} & {
|
|
168
|
+
_id: import("mongoose").Types.ObjectId;
|
|
169
|
+
}, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, Omit<factory.order.IOrder, "id"> & {
|
|
170
|
+
acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
|
|
171
|
+
}> & Omit<Omit<factory.order.IOrder, "id"> & {
|
|
172
|
+
acceptedOffers?: factory.order.IAcceptedOffer<factory.order.IItemOffered>[] | undefined;
|
|
173
|
+
} & {
|
|
174
|
+
_id: import("mongoose").Types.ObjectId;
|
|
175
|
+
}, never>>>;
|
|
164
176
|
unsetUnnecessaryFields(params: {
|
|
165
177
|
filter: FilterQuery<factory.order.IOrder>;
|
|
166
178
|
$unset: any;
|
|
@@ -24,7 +24,9 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import type { Connection } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
|
-
export type
|
|
27
|
+
export type IOwnershipInfoWithId = factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
28
30
|
/**
|
|
29
31
|
* 所有権リポジトリ
|
|
30
32
|
*/
|
|
@@ -35,14 +37,16 @@ export declare class OwnershipInfoRepo {
|
|
|
35
37
|
/**
|
|
36
38
|
* なければ作成する
|
|
37
39
|
*/
|
|
38
|
-
createIfNotExistByIdentifier(ownershipInfo:
|
|
39
|
-
findById(params: {
|
|
40
|
+
createIfNotExistByIdentifier(ownershipInfo: Omit<IOwnershipInfoWithId, 'id'>): Promise<{
|
|
40
41
|
id: string;
|
|
41
|
-
}
|
|
42
|
+
}>;
|
|
43
|
+
projectFieldsById(params: {
|
|
44
|
+
id: string;
|
|
45
|
+
}, inclusion?: (keyof IOwnershipInfoWithId)[]): Promise<IOwnershipInfoWithId>;
|
|
42
46
|
/**
|
|
43
47
|
* 所有権を検索する
|
|
44
48
|
*/
|
|
45
|
-
|
|
49
|
+
projectFields(params: factory.ownershipInfo.ISearchConditions, inclusion?: (keyof IOwnershipInfoWithId)[]): Promise<IOwnershipInfoWithId[]>;
|
|
46
50
|
/**
|
|
47
51
|
* 識別子から所有期限を変更する
|
|
48
52
|
* 存在しない場合undefinedを返す
|
|
@@ -53,7 +57,7 @@ export declare class OwnershipInfoRepo {
|
|
|
53
57
|
};
|
|
54
58
|
identifier: string;
|
|
55
59
|
ownedThrough: Date;
|
|
56
|
-
}): Promise<
|
|
60
|
+
}): Promise<Pick<IOwnershipInfoWithId, 'id' | 'identifier'> | undefined>;
|
|
57
61
|
/**
|
|
58
62
|
* 所有者の所有権を全て削除する
|
|
59
63
|
*/
|
|
@@ -93,7 +97,19 @@ export declare class OwnershipInfoRepo {
|
|
|
93
97
|
$lt: Date;
|
|
94
98
|
};
|
|
95
99
|
}): Promise<void>;
|
|
96
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<
|
|
100
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
|
|
101
|
+
_id: string;
|
|
102
|
+
}> & Omit<factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
|
|
103
|
+
_id: string;
|
|
104
|
+
} & Required<{
|
|
105
|
+
_id: string;
|
|
106
|
+
}>, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
|
|
107
|
+
_id: string;
|
|
108
|
+
}> & Omit<factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
|
|
109
|
+
_id: string;
|
|
110
|
+
} & Required<{
|
|
111
|
+
_id: string;
|
|
112
|
+
}>, never>>>;
|
|
97
113
|
/**
|
|
98
114
|
* 所有者を追加する
|
|
99
115
|
*/
|
|
@@ -233,11 +233,14 @@ class OwnershipInfoRepo {
|
|
|
233
233
|
new: true,
|
|
234
234
|
upsert: true,
|
|
235
235
|
projection: {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
_id: 0,
|
|
237
|
+
id: { $toString: '$_id' }
|
|
238
|
+
// __v: 0,
|
|
239
|
+
// createdAt: 0,
|
|
240
|
+
// updatedAt: 0
|
|
239
241
|
}
|
|
240
242
|
})
|
|
243
|
+
.lean()
|
|
241
244
|
.exec();
|
|
242
245
|
}
|
|
243
246
|
catch (error) {
|
|
@@ -254,36 +257,76 @@ class OwnershipInfoRepo {
|
|
|
254
257
|
if (duplicate) {
|
|
255
258
|
// 重複の場合、再度取得
|
|
256
259
|
doc = yield this.ownershipInfoModel.findOne({ identifier: { $eq: ownershipInfo.identifier } }, {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
+
_id: 0,
|
|
261
|
+
id: { $toString: '$_id' }
|
|
262
|
+
// __v: 0,
|
|
263
|
+
// createdAt: 0,
|
|
264
|
+
// updatedAt: 0
|
|
260
265
|
})
|
|
266
|
+
.lean()
|
|
261
267
|
.exec();
|
|
262
268
|
}
|
|
263
269
|
if (doc === undefined || doc === null) {
|
|
264
270
|
throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
|
|
265
271
|
}
|
|
266
|
-
return doc.
|
|
272
|
+
return { id: doc.id };
|
|
267
273
|
});
|
|
268
274
|
}
|
|
269
|
-
|
|
275
|
+
projectFieldsById(params, inclusion) {
|
|
270
276
|
return __awaiter(this, void 0, void 0, function* () {
|
|
271
|
-
|
|
277
|
+
let projection = {
|
|
278
|
+
_id: 0,
|
|
279
|
+
id: { $toString: '$_id' },
|
|
280
|
+
project: 1,
|
|
281
|
+
typeOf: 1,
|
|
282
|
+
identifier: 1,
|
|
283
|
+
ownedBy: 1,
|
|
284
|
+
acquiredFrom: 1,
|
|
285
|
+
ownedFrom: 1,
|
|
286
|
+
ownedThrough: 1,
|
|
287
|
+
typeOfGood: 1
|
|
288
|
+
};
|
|
289
|
+
const positiveProjectionFields = (Array.isArray(inclusion))
|
|
290
|
+
? inclusion.filter((key) => key !== 'id' && String(key) !== '_id')
|
|
291
|
+
: undefined;
|
|
292
|
+
if (Array.isArray(positiveProjectionFields)) {
|
|
293
|
+
projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
|
|
294
|
+
}
|
|
295
|
+
const doc = yield this.ownershipInfoModel.findOne({ _id: { $eq: params.id } }, projection)
|
|
296
|
+
.lean() // lean(2024-08-15~)
|
|
272
297
|
.exec();
|
|
273
298
|
if (doc === null) {
|
|
274
299
|
throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
|
|
275
300
|
}
|
|
276
|
-
return doc
|
|
301
|
+
return doc;
|
|
277
302
|
});
|
|
278
303
|
}
|
|
279
304
|
/**
|
|
280
305
|
* 所有権を検索する
|
|
281
306
|
*/
|
|
282
|
-
|
|
307
|
+
projectFields(params, inclusion) {
|
|
283
308
|
var _a;
|
|
284
309
|
return __awaiter(this, void 0, void 0, function* () {
|
|
285
310
|
const conditions = OwnershipInfoRepo.CREATE_MONGO_CONDITIONS(params);
|
|
286
|
-
|
|
311
|
+
let projection = {
|
|
312
|
+
_id: 0,
|
|
313
|
+
id: { $toString: '$_id' },
|
|
314
|
+
project: 1,
|
|
315
|
+
typeOf: 1,
|
|
316
|
+
identifier: 1,
|
|
317
|
+
ownedBy: 1,
|
|
318
|
+
acquiredFrom: 1,
|
|
319
|
+
ownedFrom: 1,
|
|
320
|
+
ownedThrough: 1,
|
|
321
|
+
typeOfGood: 1
|
|
322
|
+
};
|
|
323
|
+
const positiveProjectionFields = (Array.isArray(inclusion))
|
|
324
|
+
? inclusion.filter((key) => key !== 'id' && String(key) !== '_id')
|
|
325
|
+
: undefined;
|
|
326
|
+
if (Array.isArray(positiveProjectionFields)) {
|
|
327
|
+
projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
|
|
328
|
+
}
|
|
329
|
+
const query = this.ownershipInfoModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
287
330
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
288
331
|
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
289
332
|
query.limit(params.limit)
|
|
@@ -295,8 +338,8 @@ class OwnershipInfoRepo {
|
|
|
295
338
|
query.sort({ ownedFrom: params.sort.ownedFrom });
|
|
296
339
|
}
|
|
297
340
|
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
298
|
-
.
|
|
299
|
-
.
|
|
341
|
+
.lean() // lean(2024-08-19~)
|
|
342
|
+
.exec();
|
|
300
343
|
});
|
|
301
344
|
}
|
|
302
345
|
/**
|
|
@@ -308,8 +351,15 @@ class OwnershipInfoRepo {
|
|
|
308
351
|
return this.ownershipInfoModel.findOneAndUpdate({
|
|
309
352
|
'project.id': { $eq: params.project.id },
|
|
310
353
|
identifier: { $eq: String(params.identifier) }
|
|
311
|
-
}, { ownedThrough: params.ownedThrough }, {
|
|
312
|
-
|
|
354
|
+
}, { ownedThrough: params.ownedThrough }, {
|
|
355
|
+
new: true,
|
|
356
|
+
projection: {
|
|
357
|
+
_id: 0,
|
|
358
|
+
id: { $toString: '$_id' },
|
|
359
|
+
identifier: 1
|
|
360
|
+
}
|
|
361
|
+
})
|
|
362
|
+
.lean()
|
|
313
363
|
.exec()
|
|
314
364
|
.then((doc) => {
|
|
315
365
|
// 存在しない場合も正常にハンドルする
|
|
@@ -317,7 +367,7 @@ class OwnershipInfoRepo {
|
|
|
317
367
|
return;
|
|
318
368
|
}
|
|
319
369
|
else {
|
|
320
|
-
return doc
|
|
370
|
+
return doc;
|
|
321
371
|
}
|
|
322
372
|
});
|
|
323
373
|
});
|
|
@@ -404,7 +454,10 @@ class OwnershipInfoRepo {
|
|
|
404
454
|
};
|
|
405
455
|
}
|
|
406
456
|
if (newOwner !== undefined) {
|
|
407
|
-
const doc = yield this.ownershipInfoModel.findOneAndUpdate({ _id: { $eq: params.id } }, { $addToSet: { ownedBy: newOwner } }, {
|
|
457
|
+
const doc = yield this.ownershipInfoModel.findOneAndUpdate({ _id: { $eq: params.id } }, { $addToSet: { ownedBy: newOwner } }, {
|
|
458
|
+
new: true,
|
|
459
|
+
projection: { _id: 1 }
|
|
460
|
+
})
|
|
408
461
|
.exec();
|
|
409
462
|
if (doc === null) {
|
|
410
463
|
throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
|
|
@@ -420,7 +473,10 @@ class OwnershipInfoRepo {
|
|
|
420
473
|
if (typeof params.ownedBy.id !== 'string' || params.ownedBy.id.length === 0) {
|
|
421
474
|
throw new factory.errors.ArgumentNull('ownedBy.id');
|
|
422
475
|
}
|
|
423
|
-
const doc = yield this.ownershipInfoModel.findOneAndUpdate({ _id: { $eq: params.id } }, { $pull: { ownedBy: { id: params.ownedBy.id } } }, {
|
|
476
|
+
const doc = yield this.ownershipInfoModel.findOneAndUpdate({ _id: { $eq: params.id } }, { $pull: { ownedBy: { id: params.ownedBy.id } } }, {
|
|
477
|
+
new: true,
|
|
478
|
+
projection: { _id: 1 }
|
|
479
|
+
})
|
|
424
480
|
.exec();
|
|
425
481
|
if (doc === null) {
|
|
426
482
|
throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
3
|
type IUnsetKey = keyof Pick<factory.service.paymentService.IService, 'additionalProperty' | 'availableChannel' | 'serviceOutput' | 'serviceType'>;
|
|
4
|
-
type IKeyOfProjection4paymentService = keyof factory.service.paymentService.IService
|
|
4
|
+
type IKeyOfProjection4paymentService = keyof factory.service.paymentService.IService;
|
|
5
5
|
/**
|
|
6
6
|
* 決済サービス検索条件
|
|
7
7
|
*/
|
|
@@ -37,7 +37,7 @@ export declare class PaymentServiceRepo {
|
|
|
37
37
|
/**
|
|
38
38
|
* 決済サービスを検索する
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
projectFields(conditions: ISearchConditions4paymentService, inclusion: IKeyOfProjection4paymentService[], exclusion: IKeyOfProjection4paymentService[]): Promise<(factory.service.paymentService.IService & {
|
|
41
41
|
id: string;
|
|
42
42
|
})[]>;
|
|
43
43
|
deletePaymentServiceById(params: {
|