@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
|
@@ -22,19 +22,19 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
-
import { AnyExpression, Connection, FilterQuery, QueryOptions } from 'mongoose';
|
|
25
|
+
import { AnyExpression, Connection, FilterQuery, QueryOptions, Types } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
|
-
export type
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
export type ISellerWithId = Pick<factory.seller.ISeller, 'additionalProperty' | 'branchCode' | 'hasMerchantReturnPolicy' | 'id' | 'makesOffer' | 'name' | 'project' | 'telephone' | 'typeOf' | 'url'> & {
|
|
28
|
+
id: string;
|
|
29
|
+
};
|
|
30
|
+
type ISavingSeller = Pick<factory.seller.ISeller, 'additionalProperty' | 'branchCode' | 'hasMerchantReturnPolicy' | 'id' | 'makesOffer' | 'name' | 'project' | 'telephone' | 'typeOf' | 'url'>;
|
|
31
|
+
interface IUnset {
|
|
30
32
|
$unset?: {
|
|
31
33
|
[key: string]: 1;
|
|
32
34
|
};
|
|
33
35
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
export interface IMemberSearchConditions {
|
|
36
|
+
type ISellerByAggregate = Pick<ISellerWithId, 'additionalProperty' | 'branchCode' | 'hasMerchantReturnPolicy' | 'id' | 'name' | 'project' | 'telephone' | 'typeOf' | 'url'>;
|
|
37
|
+
interface IMemberSearchConditions {
|
|
38
38
|
/**
|
|
39
39
|
* 販売者メンバーで絞る場合
|
|
40
40
|
*/
|
|
@@ -46,7 +46,7 @@ export interface IMemberSearchConditions {
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
type IKeyOfProjection = keyof
|
|
49
|
+
type IKeyOfProjection = keyof ISellerWithId;
|
|
50
50
|
/**
|
|
51
51
|
* 販売者リポジトリ
|
|
52
52
|
* 対応決済方法については
|
|
@@ -75,9 +75,7 @@ export declare class SellerRepo {
|
|
|
75
75
|
/**
|
|
76
76
|
* 販売者検索
|
|
77
77
|
*/
|
|
78
|
-
|
|
79
|
-
id: string;
|
|
80
|
-
})[]>;
|
|
78
|
+
projectFields(conditions: factory.seller.ISearchConditions & IMemberSearchConditions, inclusion: IKeyOfProjection[], exclusion: IKeyOfProjection[]): Promise<ISellerWithId[]>;
|
|
81
79
|
/**
|
|
82
80
|
* 販売者を削除する
|
|
83
81
|
*/
|
|
@@ -98,8 +96,60 @@ export declare class SellerRepo {
|
|
|
98
96
|
addAvailableAtOrFrom(params: {
|
|
99
97
|
id: string;
|
|
100
98
|
makesOffer: factory.seller.IMakesOffer;
|
|
101
|
-
}): Promise<
|
|
102
|
-
getCursor(conditions: FilterQuery<factory.seller.ISeller>, projection: any): import("mongoose").Cursor<
|
|
99
|
+
}): Promise<void>;
|
|
100
|
+
getCursor(conditions: FilterQuery<factory.seller.ISeller>, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, {
|
|
101
|
+
url?: string | undefined;
|
|
102
|
+
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
103
|
+
name: import("@chevre/factory/lib/multilingualString").IMultilingualString;
|
|
104
|
+
typeOf: factory.organizationType.Corporation;
|
|
105
|
+
additionalProperty?: import("@chevre/factory/lib/propertyValue").IPropertyValue<string>[] | undefined;
|
|
106
|
+
location?: import("@chevre/factory/lib/place").IPlace | undefined;
|
|
107
|
+
telephone?: string | undefined;
|
|
108
|
+
hasMerchantReturnPolicy?: factory.seller.IHasMerchantReturnPolicy | undefined;
|
|
109
|
+
branchCode: string;
|
|
110
|
+
makesOffer?: factory.seller.IMakesOffer[] | undefined;
|
|
111
|
+
paymentAccepted?: factory.seller.IPaymentAccepted[] | undefined;
|
|
112
|
+
}> & Omit<{
|
|
113
|
+
url?: string | undefined;
|
|
114
|
+
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
115
|
+
name: import("@chevre/factory/lib/multilingualString").IMultilingualString;
|
|
116
|
+
typeOf: factory.organizationType.Corporation;
|
|
117
|
+
additionalProperty?: import("@chevre/factory/lib/propertyValue").IPropertyValue<string>[] | undefined;
|
|
118
|
+
location?: import("@chevre/factory/lib/place").IPlace | undefined;
|
|
119
|
+
telephone?: string | undefined;
|
|
120
|
+
hasMerchantReturnPolicy?: factory.seller.IHasMerchantReturnPolicy | undefined;
|
|
121
|
+
branchCode: string;
|
|
122
|
+
makesOffer?: factory.seller.IMakesOffer[] | undefined;
|
|
123
|
+
paymentAccepted?: factory.seller.IPaymentAccepted[] | undefined;
|
|
124
|
+
} & {
|
|
125
|
+
_id: Types.ObjectId;
|
|
126
|
+
}, never>, QueryOptions<import("mongoose").Document<unknown, {}, {
|
|
127
|
+
url?: string | undefined;
|
|
128
|
+
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
129
|
+
name: import("@chevre/factory/lib/multilingualString").IMultilingualString;
|
|
130
|
+
typeOf: factory.organizationType.Corporation;
|
|
131
|
+
additionalProperty?: import("@chevre/factory/lib/propertyValue").IPropertyValue<string>[] | undefined;
|
|
132
|
+
location?: import("@chevre/factory/lib/place").IPlace | undefined;
|
|
133
|
+
telephone?: string | undefined;
|
|
134
|
+
hasMerchantReturnPolicy?: factory.seller.IHasMerchantReturnPolicy | undefined;
|
|
135
|
+
branchCode: string;
|
|
136
|
+
makesOffer?: factory.seller.IMakesOffer[] | undefined;
|
|
137
|
+
paymentAccepted?: factory.seller.IPaymentAccepted[] | undefined;
|
|
138
|
+
}> & Omit<{
|
|
139
|
+
url?: string | undefined;
|
|
140
|
+
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
141
|
+
name: import("@chevre/factory/lib/multilingualString").IMultilingualString;
|
|
142
|
+
typeOf: factory.organizationType.Corporation;
|
|
143
|
+
additionalProperty?: import("@chevre/factory/lib/propertyValue").IPropertyValue<string>[] | undefined;
|
|
144
|
+
location?: import("@chevre/factory/lib/place").IPlace | undefined;
|
|
145
|
+
telephone?: string | undefined;
|
|
146
|
+
hasMerchantReturnPolicy?: factory.seller.IHasMerchantReturnPolicy | undefined;
|
|
147
|
+
branchCode: string;
|
|
148
|
+
makesOffer?: factory.seller.IMakesOffer[] | undefined;
|
|
149
|
+
paymentAccepted?: factory.seller.IPaymentAccepted[] | undefined;
|
|
150
|
+
} & {
|
|
151
|
+
_id: Types.ObjectId;
|
|
152
|
+
}, never>>>;
|
|
103
153
|
unsetUnnecessaryFields(params: {
|
|
104
154
|
filter: any;
|
|
105
155
|
$unset: any;
|
|
@@ -25,6 +25,17 @@ const mongoose_1 = require("mongoose");
|
|
|
25
25
|
const seller_1 = require("./mongoose/schemas/seller");
|
|
26
26
|
const factory = require("../factory");
|
|
27
27
|
const settings_1 = require("../settings");
|
|
28
|
+
const AVAILABLE_PROJECT_FIELDS = [
|
|
29
|
+
'additionalProperty',
|
|
30
|
+
'branchCode',
|
|
31
|
+
'hasMerchantReturnPolicy',
|
|
32
|
+
'makesOffer',
|
|
33
|
+
'name',
|
|
34
|
+
'project',
|
|
35
|
+
'typeOf',
|
|
36
|
+
'url',
|
|
37
|
+
'telephone'
|
|
38
|
+
];
|
|
28
39
|
/**
|
|
29
40
|
* 販売者リポジトリ
|
|
30
41
|
* 対応決済方法については
|
|
@@ -191,32 +202,46 @@ class SellerRepo {
|
|
|
191
202
|
* 販売者を保管する
|
|
192
203
|
*/
|
|
193
204
|
save(params) {
|
|
205
|
+
var _a, _b;
|
|
194
206
|
return __awaiter(this, void 0, void 0, function* () {
|
|
195
207
|
let doc;
|
|
208
|
+
let savedId;
|
|
196
209
|
const savingId = params.id;
|
|
197
210
|
if (typeof savingId === 'string') {
|
|
198
211
|
if (savingId === '') {
|
|
199
212
|
throw new factory.errors.ArgumentNull('id');
|
|
200
213
|
}
|
|
201
214
|
// 上書き禁止属性を除外(2022-08-24~)
|
|
202
|
-
const
|
|
215
|
+
const _c = params.attributes, { id, branchCode, project, typeOf, $unset } = _c, updateFields = __rest(_c, ["id", "branchCode", "project", "typeOf", "$unset"]);
|
|
203
216
|
const filter = {
|
|
204
217
|
_id: { $eq: savingId },
|
|
205
218
|
'project.id': { $eq: project.id }
|
|
206
219
|
};
|
|
207
220
|
const update = Object.assign({ $set: updateFields }, ($unset !== undefined && $unset !== null) ? { $unset } : undefined);
|
|
208
|
-
const options = {
|
|
221
|
+
const options = {
|
|
222
|
+
upsert: false,
|
|
223
|
+
new: true,
|
|
224
|
+
projection: { _id: 1, id: { $toString: '$_id' } }
|
|
225
|
+
};
|
|
209
226
|
doc = yield this.sellerModel.findOneAndUpdate(filter, update, options)
|
|
227
|
+
.lean()
|
|
210
228
|
.exec();
|
|
229
|
+
if (doc === null) {
|
|
230
|
+
throw new factory.errors.NotFound(this.sellerModel.modelName);
|
|
231
|
+
}
|
|
232
|
+
savedId = savingId;
|
|
211
233
|
}
|
|
212
234
|
else {
|
|
213
|
-
const
|
|
214
|
-
doc =
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
235
|
+
const _d = params.attributes, { id, $unset } = _d, createParams = __rest(_d, ["id", "$unset"]);
|
|
236
|
+
// doc = await this.sellerModel.create<ISavingSeller>(createParams);
|
|
237
|
+
const result = yield this.sellerModel.insertMany(createParams, { rawResult: true });
|
|
238
|
+
const insertedId = (_b = (_a = result.insertedIds) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.toHexString();
|
|
239
|
+
if (typeof insertedId !== 'string') {
|
|
240
|
+
throw new factory.errors.Internal(`seller not saved unexpectedly. result:${JSON.stringify(result)}`);
|
|
241
|
+
}
|
|
242
|
+
savedId = insertedId;
|
|
218
243
|
}
|
|
219
|
-
return
|
|
244
|
+
return { id: savedId };
|
|
220
245
|
});
|
|
221
246
|
}
|
|
222
247
|
/**
|
|
@@ -249,29 +274,38 @@ class SellerRepo {
|
|
|
249
274
|
/**
|
|
250
275
|
* 販売者検索
|
|
251
276
|
*/
|
|
252
|
-
|
|
277
|
+
projectFields(conditions, inclusion, exclusion) {
|
|
253
278
|
var _a;
|
|
254
279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
255
280
|
const andConditions = SellerRepo.CREATE_MONGO_CONDITIONS(conditions);
|
|
256
|
-
let
|
|
281
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
257
282
|
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
258
|
-
inclusion.
|
|
259
|
-
projection[field] = 1;
|
|
260
|
-
});
|
|
283
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
261
284
|
}
|
|
262
285
|
else {
|
|
263
|
-
projection = {
|
|
264
|
-
__v: 0,
|
|
265
|
-
createdAt: 0,
|
|
266
|
-
updatedAt: 0,
|
|
267
|
-
paymentAccepted: 0 // 除外(2023-12-01~)
|
|
268
|
-
};
|
|
269
286
|
if (Array.isArray(exclusion) && exclusion.length > 0) {
|
|
270
|
-
|
|
271
|
-
projection[field] = 0;
|
|
272
|
-
});
|
|
287
|
+
positiveProjectionFields = positiveProjectionFields.filter((key) => !exclusion.includes(key));
|
|
273
288
|
}
|
|
274
289
|
}
|
|
290
|
+
const projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
|
|
291
|
+
// let projection: { [key: string]: number } = {};
|
|
292
|
+
// if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
293
|
+
// inclusion.forEach((field) => {
|
|
294
|
+
// projection[field] = 1;
|
|
295
|
+
// });
|
|
296
|
+
// } else {
|
|
297
|
+
// projection = {
|
|
298
|
+
// __v: 0,
|
|
299
|
+
// createdAt: 0,
|
|
300
|
+
// updatedAt: 0,
|
|
301
|
+
// paymentAccepted: 0 // 除外(2023-12-01~)
|
|
302
|
+
// };
|
|
303
|
+
// if (Array.isArray(exclusion) && exclusion.length > 0) {
|
|
304
|
+
// exclusion.forEach((field) => {
|
|
305
|
+
// projection[field] = 0;
|
|
306
|
+
// });
|
|
307
|
+
// }
|
|
308
|
+
// }
|
|
275
309
|
const query = this.sellerModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, projection);
|
|
276
310
|
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
277
311
|
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
@@ -284,8 +318,8 @@ class SellerRepo {
|
|
|
284
318
|
query.sort({ branchCode: conditions.sort.branchCode });
|
|
285
319
|
}
|
|
286
320
|
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
287
|
-
.
|
|
288
|
-
.
|
|
321
|
+
.lean() // 2024-08-22~
|
|
322
|
+
.exec();
|
|
289
323
|
});
|
|
290
324
|
}
|
|
291
325
|
/**
|
|
@@ -294,9 +328,9 @@ class SellerRepo {
|
|
|
294
328
|
deleteById(params) {
|
|
295
329
|
return __awaiter(this, void 0, void 0, function* () {
|
|
296
330
|
yield this.sellerModel.findOneAndRemove({
|
|
297
|
-
_id: params.id,
|
|
331
|
+
_id: { $eq: params.id },
|
|
298
332
|
'project.id': { $eq: params.project.id }
|
|
299
|
-
})
|
|
333
|
+
}, { projection: { _id: 1 } })
|
|
300
334
|
.exec();
|
|
301
335
|
});
|
|
302
336
|
}
|
|
@@ -313,7 +347,7 @@ class SellerRepo {
|
|
|
313
347
|
}
|
|
314
348
|
addAvailableAtOrFrom(params) {
|
|
315
349
|
return __awaiter(this, void 0, void 0, function* () {
|
|
316
|
-
|
|
350
|
+
yield this.sellerModel.findOneAndUpdate({ _id: { $eq: params.id } }, { $push: { makesOffer: params.makesOffer } }, { projection: { _id: 1 } })
|
|
317
351
|
.exec();
|
|
318
352
|
});
|
|
319
353
|
}
|
|
@@ -22,8 +22,9 @@
|
|
|
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,
|
|
25
|
+
import type { Connection, UpdateWriteOpResult } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
|
+
import { IModel } from './mongoose/schemas/task';
|
|
27
28
|
interface IAggregationByStatus {
|
|
28
29
|
taskCount: number;
|
|
29
30
|
avgLatency: number;
|
|
@@ -55,7 +56,7 @@ type IProjection = {
|
|
|
55
56
|
* タスクリポジトリ
|
|
56
57
|
*/
|
|
57
58
|
export declare class TaskRepo {
|
|
58
|
-
readonly taskModel:
|
|
59
|
+
readonly taskModel: IModel;
|
|
59
60
|
constructor(connection: Connection);
|
|
60
61
|
static CREATE_MONGO_CONDITIONS(params: factory.task.ISearchConditions): any[];
|
|
61
62
|
saveOne(savingTask: factory.task.IAttributes<factory.taskName>, options: IOptionOnCreate): Promise<{
|
|
@@ -191,7 +192,67 @@ export declare class TaskRepo {
|
|
|
191
192
|
$nin?: factory.taskName[];
|
|
192
193
|
};
|
|
193
194
|
}): Promise<number>;
|
|
194
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<
|
|
195
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, {
|
|
196
|
+
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
197
|
+
identifier?: string | undefined;
|
|
198
|
+
name: factory.taskName;
|
|
199
|
+
expires?: Date | undefined;
|
|
200
|
+
data: any;
|
|
201
|
+
status: factory.taskStatus;
|
|
202
|
+
runsAt: Date;
|
|
203
|
+
remainingNumberOfTries: number;
|
|
204
|
+
lastTriedAt?: Date | undefined;
|
|
205
|
+
numberOfTried: number;
|
|
206
|
+
executionResults: import("@chevre/factory/lib/task").IExecutionResult[];
|
|
207
|
+
executor?: import("@chevre/factory/lib/task").IExecutor | undefined;
|
|
208
|
+
dateAborted?: Date | undefined;
|
|
209
|
+
}> & Omit<{
|
|
210
|
+
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
211
|
+
identifier?: string | undefined;
|
|
212
|
+
name: factory.taskName;
|
|
213
|
+
expires?: Date | undefined;
|
|
214
|
+
data: any;
|
|
215
|
+
status: factory.taskStatus;
|
|
216
|
+
runsAt: Date;
|
|
217
|
+
remainingNumberOfTries: number;
|
|
218
|
+
lastTriedAt?: Date | undefined;
|
|
219
|
+
numberOfTried: number;
|
|
220
|
+
executionResults: import("@chevre/factory/lib/task").IExecutionResult[];
|
|
221
|
+
executor?: import("@chevre/factory/lib/task").IExecutor | undefined;
|
|
222
|
+
dateAborted?: Date | undefined;
|
|
223
|
+
} & {
|
|
224
|
+
_id: import("mongoose").Types.ObjectId;
|
|
225
|
+
}, never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, {
|
|
226
|
+
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
227
|
+
identifier?: string | undefined;
|
|
228
|
+
name: factory.taskName;
|
|
229
|
+
expires?: Date | undefined;
|
|
230
|
+
data: any;
|
|
231
|
+
status: factory.taskStatus;
|
|
232
|
+
runsAt: Date;
|
|
233
|
+
remainingNumberOfTries: number;
|
|
234
|
+
lastTriedAt?: Date | undefined;
|
|
235
|
+
numberOfTried: number;
|
|
236
|
+
executionResults: import("@chevre/factory/lib/task").IExecutionResult[];
|
|
237
|
+
executor?: import("@chevre/factory/lib/task").IExecutor | undefined;
|
|
238
|
+
dateAborted?: Date | undefined;
|
|
239
|
+
}> & Omit<{
|
|
240
|
+
project: Pick<factory.project.IProject, "id" | "typeOf">;
|
|
241
|
+
identifier?: string | undefined;
|
|
242
|
+
name: factory.taskName;
|
|
243
|
+
expires?: Date | undefined;
|
|
244
|
+
data: any;
|
|
245
|
+
status: factory.taskStatus;
|
|
246
|
+
runsAt: Date;
|
|
247
|
+
remainingNumberOfTries: number;
|
|
248
|
+
lastTriedAt?: Date | undefined;
|
|
249
|
+
numberOfTried: number;
|
|
250
|
+
executionResults: import("@chevre/factory/lib/task").IExecutionResult[];
|
|
251
|
+
executor?: import("@chevre/factory/lib/task").IExecutor | undefined;
|
|
252
|
+
dateAborted?: Date | undefined;
|
|
253
|
+
} & {
|
|
254
|
+
_id: import("mongoose").Types.ObjectId;
|
|
255
|
+
}, never>>>;
|
|
195
256
|
unsetUnnecessaryFields(params: {
|
|
196
257
|
filter: any;
|
|
197
258
|
$unset: any;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Connection
|
|
1
|
+
import type { Connection } from 'mongoose';
|
|
2
|
+
import { IModel } from './mongoose/schemas/telemetry';
|
|
2
3
|
/**
|
|
3
4
|
* 測定リポジトリ
|
|
4
5
|
*/
|
|
5
6
|
export declare class TelemetryRepo {
|
|
6
|
-
readonly telemetryModel:
|
|
7
|
+
readonly telemetryModel: IModel;
|
|
7
8
|
constructor(connection: Connection);
|
|
8
9
|
}
|
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
2
|
import * as factory from '../factory';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
typeOf: factory.organizationType.Corporation | factory.organizationType.Project;
|
|
6
|
-
}
|
|
7
|
-
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
|
-
}
|
|
3
|
+
import { ITicket, ITicketIssuedBy } from './mongoose/schemas/ticket';
|
|
4
|
+
export { ITicket };
|
|
21
5
|
type IIssueParams = Pick<ITicket, 'ticketToken'> & {
|
|
22
6
|
project: {
|
|
23
7
|
id: string;
|
|
@@ -42,6 +26,7 @@ interface ISearchConditions {
|
|
|
42
26
|
$eq?: string;
|
|
43
27
|
};
|
|
44
28
|
}
|
|
29
|
+
type IKeyOfProjection = keyof ITicket;
|
|
45
30
|
/**
|
|
46
31
|
* チケットリポジトリ
|
|
47
32
|
*/
|
|
@@ -53,6 +38,5 @@ export declare class TicketRepo {
|
|
|
53
38
|
* 承認コードからチケットを発行する
|
|
54
39
|
*/
|
|
55
40
|
issueByTicketToken(params: IIssueParams): Promise<Pick<ITicket, 'id'>>;
|
|
56
|
-
|
|
41
|
+
projectFields(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<ITicket[]>;
|
|
57
42
|
}
|
|
58
|
-
export {};
|
|
@@ -13,6 +13,13 @@ exports.TicketRepo = void 0;
|
|
|
13
13
|
const factory = require("../factory");
|
|
14
14
|
const settings_1 = require("../settings");
|
|
15
15
|
const ticket_1 = require("./mongoose/schemas/ticket");
|
|
16
|
+
const AVAILABLE_PROJECT_FIELDS = [
|
|
17
|
+
'project',
|
|
18
|
+
'typeOf',
|
|
19
|
+
'ticketToken',
|
|
20
|
+
'dateIssued',
|
|
21
|
+
'issuedBy'
|
|
22
|
+
];
|
|
16
23
|
/**
|
|
17
24
|
* チケットリポジトリ
|
|
18
25
|
*/
|
|
@@ -41,6 +48,7 @@ class TicketRepo {
|
|
|
41
48
|
* 承認コードからチケットを発行する
|
|
42
49
|
*/
|
|
43
50
|
issueByTicketToken(params) {
|
|
51
|
+
var _a, _b;
|
|
44
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
53
|
const { ticketToken, project, issuedBy } = params;
|
|
46
54
|
const ticketIssuedBy = (typeof (issuedBy === null || issuedBy === void 0 ? void 0 : issuedBy.id) === 'string' && issuedBy.typeOf === factory.organizationType.Corporation)
|
|
@@ -53,19 +61,24 @@ class TicketRepo {
|
|
|
53
61
|
ticketToken,
|
|
54
62
|
typeOf: 'Ticket'
|
|
55
63
|
};
|
|
56
|
-
const
|
|
57
|
-
|
|
64
|
+
const result = yield this.ticketModel.insertMany(creatingTicket, { rawResult: true });
|
|
65
|
+
const insertedId = (_b = (_a = result.insertedIds) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.toHexString();
|
|
66
|
+
if (typeof insertedId !== 'string') {
|
|
67
|
+
throw new factory.errors.Internal(`ticket not saved unexpectedly. result:${JSON.stringify(result)}`);
|
|
68
|
+
}
|
|
69
|
+
return { id: insertedId };
|
|
58
70
|
});
|
|
59
71
|
}
|
|
60
|
-
|
|
72
|
+
projectFields(params, inclusion) {
|
|
61
73
|
var _a;
|
|
62
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
75
|
const conditions = TicketRepo.CREATE_MONGO_CONDITIONS(params);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
});
|
|
76
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
77
|
+
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
78
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
79
|
+
}
|
|
80
|
+
const projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
|
|
81
|
+
const query = this.ticketModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
|
|
69
82
|
if (typeof params.limit === 'number' && params.limit > 0) {
|
|
70
83
|
const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
|
|
71
84
|
query.limit(params.limit)
|
|
@@ -75,8 +88,8 @@ class TicketRepo {
|
|
|
75
88
|
query.sort({ dateIssued: params.sort.dateIssued });
|
|
76
89
|
}
|
|
77
90
|
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
78
|
-
.
|
|
79
|
-
.
|
|
91
|
+
.lean() // 2024-08-20~
|
|
92
|
+
.exec();
|
|
80
93
|
});
|
|
81
94
|
}
|
|
82
95
|
}
|
|
@@ -52,7 +52,7 @@ export type IStartedTransaction = Pick<factory.transaction.ITransaction<factory.
|
|
|
52
52
|
export declare class TransactionRepo {
|
|
53
53
|
private readonly transactionModel;
|
|
54
54
|
constructor(connection: Connection);
|
|
55
|
-
static CREATE_MONGO_CONDITIONS(params: factory.transaction.ISearchConditions<factory.transactionType>): FilterQuery<import("@chevre/factory/lib/assetTransaction/
|
|
55
|
+
static CREATE_MONGO_CONDITIONS(params: factory.transaction.ISearchConditions<factory.transactionType>): FilterQuery<import("@chevre/factory/lib/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/assetTransaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/assetTransaction/registerService").ITransaction | import("@chevre/factory/lib/assetTransaction/reserve").ITransaction>[];
|
|
56
56
|
/**
|
|
57
57
|
* 取引を開始する
|
|
58
58
|
*/
|
|
@@ -60,14 +60,14 @@ export declare class TransactionRepo {
|
|
|
60
60
|
/**
|
|
61
61
|
* 特定取引検索
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
projectFieldsById<T extends factory.transactionType>(params: {
|
|
64
64
|
typeOf: T;
|
|
65
65
|
id: string;
|
|
66
66
|
}, inclusion: IKeyOfProjection<T>[]): Promise<factory.transaction.ITransaction<T>>;
|
|
67
67
|
/**
|
|
68
68
|
* 進行中の取引を取得する
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
projectFieldsInProgressById<T extends factory.transactionType>(params: {
|
|
71
71
|
typeOf: T;
|
|
72
72
|
id: string;
|
|
73
73
|
}, inclusion: IKeyOfProjection<T>[]): Promise<ITransactionInProgress<T>>;
|
|
@@ -158,7 +158,7 @@ export declare class TransactionRepo {
|
|
|
158
158
|
status: {
|
|
159
159
|
$in: factory.transactionStatusType[];
|
|
160
160
|
};
|
|
161
|
-
}): Promise<Pick<import("@chevre/factory/lib/transaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/transaction/returnOrder").ITransaction, "
|
|
161
|
+
}): Promise<Pick<import("@chevre/factory/lib/transaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/transaction/returnOrder").ITransaction, "id" | "typeOf" | "status">[]>;
|
|
162
162
|
/**
|
|
163
163
|
* set task status exported by transaction id
|
|
164
164
|
* IDでタスクをエクスポート済に変更する
|
|
@@ -185,7 +185,7 @@ export declare class TransactionRepo {
|
|
|
185
185
|
/**
|
|
186
186
|
* 取引を検索する
|
|
187
187
|
*/
|
|
188
|
-
|
|
188
|
+
projectFields<T extends factory.transactionType, F extends IKeyOfProjection<T>>(params: factory.transaction.ISearchConditions<T> & {
|
|
189
189
|
inclusion: F[];
|
|
190
190
|
}): Promise<(Pick<factory.transaction.ITransaction<T>, F> & {
|
|
191
191
|
id: string;
|
|
@@ -201,14 +201,6 @@ export declare class TransactionRepo {
|
|
|
201
201
|
};
|
|
202
202
|
};
|
|
203
203
|
}): Promise<void>;
|
|
204
|
-
findByIdAndUpdate4migrate(params: {
|
|
205
|
-
id: string;
|
|
206
|
-
update: {
|
|
207
|
-
$set?: {
|
|
208
|
-
'object.paymentMethods'?: factory.transaction.placeOrder.IPaymentMethodByPaymentUrl;
|
|
209
|
-
};
|
|
210
|
-
};
|
|
211
|
-
}): Promise<void>;
|
|
212
204
|
saveOrderNumberIfNotExist(params: {
|
|
213
205
|
id: string;
|
|
214
206
|
orderNumber: string;
|
|
@@ -237,7 +229,31 @@ export declare class TransactionRepo {
|
|
|
237
229
|
$lt: Date;
|
|
238
230
|
};
|
|
239
231
|
}): Promise<import("mongodb").DeleteResult>;
|
|
240
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<
|
|
232
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/transaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/transaction/returnOrder").ITransaction> & Omit<(import("@chevre/factory/lib/transaction/moneyTransfer").IAttributes & {
|
|
233
|
+
id: string;
|
|
234
|
+
} & {
|
|
235
|
+
_id: import("mongoose").Types.ObjectId;
|
|
236
|
+
}) | (import("@chevre/factory/lib/transaction/placeOrder").IAttributes & {
|
|
237
|
+
id: string;
|
|
238
|
+
} & {
|
|
239
|
+
_id: import("mongoose").Types.ObjectId;
|
|
240
|
+
}) | (import("@chevre/factory/lib/transaction/returnOrder").IAttributes & {
|
|
241
|
+
id: string;
|
|
242
|
+
} & {
|
|
243
|
+
_id: import("mongoose").Types.ObjectId;
|
|
244
|
+
}), never>, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/transaction/moneyTransfer").ITransaction | import("@chevre/factory/lib/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/transaction/returnOrder").ITransaction> & Omit<(import("@chevre/factory/lib/transaction/moneyTransfer").IAttributes & {
|
|
245
|
+
id: string;
|
|
246
|
+
} & {
|
|
247
|
+
_id: import("mongoose").Types.ObjectId;
|
|
248
|
+
}) | (import("@chevre/factory/lib/transaction/placeOrder").IAttributes & {
|
|
249
|
+
id: string;
|
|
250
|
+
} & {
|
|
251
|
+
_id: import("mongoose").Types.ObjectId;
|
|
252
|
+
}) | (import("@chevre/factory/lib/transaction/returnOrder").IAttributes & {
|
|
253
|
+
id: string;
|
|
254
|
+
} & {
|
|
255
|
+
_id: import("mongoose").Types.ObjectId;
|
|
256
|
+
}), never>>>;
|
|
241
257
|
aggregatePlaceOrder(params: {
|
|
242
258
|
project?: {
|
|
243
259
|
id?: {
|