@chevre/domain 22.3.0-alpha.2 → 22.3.0-alpha.20
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/aggregateScreeningEventMaxVersion.ts +36 -0
- package/example/src/chevre/aggregation/createAggregateEventTasks.ts +1 -1
- package/example/src/chevre/importEventsFromCOA.ts +6 -3
- package/example/src/chevre/migrateAccountTitleAdditionalProperties.ts +126 -0
- package/example/src/chevre/migrateEventSeries2secondary.ts +70 -0
- package/example/src/chevre/projectFields.ts +5 -15
- package/example/src/chevre/syncEventSeries2secondary.ts +20 -0
- package/example/src/chevre/unsetUnnecessaryFields.ts +6 -6
- package/example/src/chevre/upsertScreeningEventSeriesByVersion.ts +2 -2
- package/lib/chevre/repo/account.d.ts +25 -1
- package/lib/chevre/repo/accountTitle.d.ts +4 -4
- package/lib/chevre/repo/accountingReport.d.ts +25 -1
- package/lib/chevre/repo/action.d.ts +11 -11
- package/lib/chevre/repo/action.js +4 -1
- package/lib/chevre/repo/additionalProperty.d.ts +28 -0
- package/lib/chevre/repo/additionalProperty.js +6 -0
- package/lib/chevre/repo/aggregateOffer.d.ts +26 -2
- package/lib/chevre/repo/aggregateReservation.d.ts +25 -1
- package/lib/chevre/repo/aggregation.d.ts +26 -2
- package/lib/chevre/repo/assetTransaction.d.ts +5 -5
- package/lib/chevre/repo/authorization.d.ts +25 -1
- package/lib/chevre/repo/categoryCode.d.ts +1 -1
- package/lib/chevre/repo/comment.d.ts +3 -3
- package/lib/chevre/repo/creativeWork.d.ts +5 -5
- package/lib/chevre/repo/creativeWork.js +1 -1
- package/lib/chevre/repo/customer.d.ts +16 -10
- package/lib/chevre/repo/customer.js +40 -13
- package/lib/chevre/repo/event.d.ts +37 -127
- package/lib/chevre/repo/event.js +206 -386
- package/lib/chevre/repo/eventSeries.d.ts +147 -0
- package/lib/chevre/repo/eventSeries.js +664 -0
- package/lib/chevre/repo/member.d.ts +4 -4
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +3 -3
- package/lib/chevre/repo/message.d.ts +25 -1
- package/lib/chevre/repo/mongoose/schemas/account.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/account.js +29 -13
- package/lib/chevre/repo/mongoose/schemas/accountTitle.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/accountingReport.js +17 -12
- package/lib/chevre/repo/mongoose/schemas/additionalProperty.js +10 -12
- package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/creativeWork.js +21 -23
- package/lib/chevre/repo/mongoose/schemas/event.js +5 -12
- package/lib/chevre/repo/mongoose/schemas/eventSeries.d.ts +13 -0
- package/lib/chevre/repo/mongoose/schemas/eventSeries.js +219 -0
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/merchantReturnPolicy.js +9 -15
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/offerItemCondition.js +21 -23
- package/lib/chevre/repo/mongoose/schemas/place.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/place.js +21 -23
- package/lib/chevre/repo/mongoose/schemas/productModel.js +6 -14
- package/lib/chevre/repo/mongoose/schemas/trip.js +10 -4
- package/lib/chevre/repo/note.d.ts +25 -1
- package/lib/chevre/repo/offer.d.ts +8 -8
- package/lib/chevre/repo/offerCatalog.d.ts +4 -4
- package/lib/chevre/repo/offerCatalogItem.d.ts +25 -1
- package/lib/chevre/repo/offerItemCondition.d.ts +28 -0
- package/lib/chevre/repo/offerItemCondition.js +8 -1
- package/lib/chevre/repo/order.d.ts +5 -5
- package/lib/chevre/repo/orderInTransaction.d.ts +27 -3
- package/lib/chevre/repo/ownershipInfo.d.ts +5 -5
- package/lib/chevre/repo/paymentService.d.ts +25 -1
- package/lib/chevre/repo/paymentServiceProvider.d.ts +26 -2
- package/lib/chevre/repo/place/movieTheater.d.ts +8 -4
- package/lib/chevre/repo/place/movieTheater.js +8 -1
- package/lib/chevre/repo/priceSpecification.d.ts +4 -4
- package/lib/chevre/repo/product.d.ts +4 -4
- package/lib/chevre/repo/productModel.d.ts +28 -0
- package/lib/chevre/repo/productModel.js +6 -0
- package/lib/chevre/repo/productOffer.d.ts +25 -1
- package/lib/chevre/repo/project.d.ts +5 -5
- package/lib/chevre/repo/reservation.d.ts +5 -5
- package/lib/chevre/repo/reservation.js +6 -28
- package/lib/chevre/repo/seller.d.ts +5 -5
- package/lib/chevre/repo/serviceOutput.d.ts +25 -1
- package/lib/chevre/repo/task.d.ts +8 -8
- package/lib/chevre/repo/transaction.d.ts +4 -4
- package/lib/chevre/repo/trip.d.ts +28 -0
- package/lib/chevre/repo/trip.js +6 -0
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +15 -2
- package/lib/chevre/service/aggregation/event/aggregateOffers.js +2 -2
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +3 -3
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserve/start.js +1 -1
- package/lib/chevre/service/event/createEvent.d.ts +2 -0
- package/lib/chevre/service/event/createEvent.js +1 -1
- package/lib/chevre/service/event.d.ts +6 -0
- package/lib/chevre/service/event.js +120 -43
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +2 -0
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -0
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +3 -0
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +6 -6
- package/lib/chevre/service/offer/eventServiceByCOA/acceptOffer.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/authorize.js +1 -1
- package/lib/chevre/service/offer/eventServiceByCOA/changeOffers.js +1 -1
- package/lib/chevre/service/offer/onEventChanged.d.ts +2 -0
- package/lib/chevre/service/offer/onEventChanged.js +31 -4
- package/lib/chevre/service/offer.js +1 -1
- package/lib/chevre/service/payment/movieTicket/checkMovieTicket.js +1 -1
- package/lib/chevre/service/payment/movieTicket/factory.js +0 -6
- package/lib/chevre/service/payment/movieTicket/payMovieTicket.js +1 -1
- package/lib/chevre/service/payment/movieTicket/processPurchaseNumberAuth.js +0 -6
- package/lib/chevre/service/payment/movieTicket/validation.js +1 -1
- package/lib/chevre/service/report/telemetry.js +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +1 -1
- package/lib/chevre/service/task/createEvent.js +2 -0
- package/lib/chevre/service/task/importEventsFromCOA.js +2 -0
- package/lib/chevre/service/task/onEventChanged.js +2 -0
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +2 -0
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +16 -7
- package/lib/chevre/service/task/onResourceUpdated.js +2 -0
- package/lib/chevre/service/transaction/returnOrder/preStart.js +1 -1
- package/lib/chevre/settings.d.ts +6 -0
- package/package.json +6 -6
- package/example/src/chevre/createManyEvents.ts +0 -75
- package/example/src/chevre/migrateMembers2.ts +0 -74
- package/example/src/chevre/projectEventFields.ts +0 -39
- package/example/src/chevre/searchAvaialbleAppliesToMovieTicketByOfferCatalogId.ts +0 -45
- package/example/src/chevre/searchEventIds.ts +0 -24
- package/example/src/chevre/searchScreeningEventSeries.ts +0 -34
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import type { AnyExpression, Connection, FilterQuery, PipelineStage } from 'mongoose';
|
|
2
26
|
import * as factory from '../factory';
|
|
3
27
|
type IMatchStage = PipelineStage.Match;
|
|
@@ -68,10 +92,10 @@ export declare class AggregateOfferRepo {
|
|
|
68
92
|
/**
|
|
69
93
|
* 単価オファー最適化作業における一時的な処理
|
|
70
94
|
*/
|
|
71
|
-
optimizeOffers(): Promise<import("
|
|
95
|
+
optimizeOffers(): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
72
96
|
unsetUnnecessaryFields(params: {
|
|
73
97
|
filter: FilterQuery<factory.aggregateOffer.IAggregateOffer>;
|
|
74
98
|
$unset: any;
|
|
75
|
-
}): Promise<import("
|
|
99
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
76
100
|
}
|
|
77
101
|
export {};
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import type { Connection, PipelineStage } from 'mongoose';
|
|
2
26
|
import * as factory from '../factory';
|
|
3
27
|
import { IAggregateReservation } from './mongoose/schemas/aggregateReservation';
|
|
@@ -54,6 +78,6 @@ export declare class AggregateReservationRepo {
|
|
|
54
78
|
unsetUnnecessaryFields(params: {
|
|
55
79
|
filter: any;
|
|
56
80
|
$unset: any;
|
|
57
|
-
}): Promise<import("
|
|
81
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
58
82
|
}
|
|
59
83
|
export {};
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import type { Connection } from 'mongoose';
|
|
2
26
|
import * as factory from '../factory';
|
|
3
27
|
export declare enum AggregationType {
|
|
@@ -38,7 +62,7 @@ export interface IAggregation {
|
|
|
38
62
|
export declare class AggregationRepo {
|
|
39
63
|
private readonly aggregationModel;
|
|
40
64
|
constructor(connection: Connection);
|
|
41
|
-
saveAggregation(params: IAggregation): Promise<import("
|
|
65
|
+
saveAggregation(params: IAggregation): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
42
66
|
search(params: {
|
|
43
67
|
limit: number;
|
|
44
68
|
page: number;
|
|
@@ -64,5 +88,5 @@ export declare class AggregationRepo {
|
|
|
64
88
|
unsetUnnecessaryFields(params: {
|
|
65
89
|
filter: any;
|
|
66
90
|
$unset: any;
|
|
67
|
-
}): Promise<import("
|
|
91
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
68
92
|
}
|
|
@@ -268,7 +268,7 @@ export declare class AssetTransactionRepo {
|
|
|
268
268
|
}): Promise<void>;
|
|
269
269
|
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, (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) & {
|
|
270
270
|
seller?: any;
|
|
271
|
-
}> &
|
|
271
|
+
}> & ((import("@chevre/factory/lib/assetTransaction/cancelReservation").IAttributes & {
|
|
272
272
|
id: string;
|
|
273
273
|
} & {
|
|
274
274
|
seller?: any;
|
|
@@ -304,9 +304,9 @@ export declare class AssetTransactionRepo {
|
|
|
304
304
|
seller?: any;
|
|
305
305
|
} & {
|
|
306
306
|
_id: import("mongoose").Types.ObjectId;
|
|
307
|
-
}),
|
|
307
|
+
})), import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, (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) & {
|
|
308
308
|
seller?: any;
|
|
309
|
-
}> &
|
|
309
|
+
}> & ((import("@chevre/factory/lib/assetTransaction/cancelReservation").IAttributes & {
|
|
310
310
|
id: string;
|
|
311
311
|
} & {
|
|
312
312
|
seller?: any;
|
|
@@ -342,11 +342,11 @@ export declare class AssetTransactionRepo {
|
|
|
342
342
|
seller?: any;
|
|
343
343
|
} & {
|
|
344
344
|
_id: import("mongoose").Types.ObjectId;
|
|
345
|
-
})
|
|
345
|
+
}))>>;
|
|
346
346
|
unsetUnnecessaryFields(params: {
|
|
347
347
|
filter: any;
|
|
348
348
|
$unset: any;
|
|
349
|
-
}): Promise<import("
|
|
349
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
350
350
|
aggregateAssetTransaction(params: {
|
|
351
351
|
project?: {
|
|
352
352
|
id?: {
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
1
25
|
import type { Connection, FilterQuery } from 'mongoose';
|
|
2
26
|
import * as factory from '../factory';
|
|
3
27
|
type IFindValidOneResult = Pick<factory.authorization.IAuthorization, 'object' | 'typeOf' | 'audience' | 'issuedBy'> & {
|
|
@@ -48,7 +72,7 @@ export declare class AuthorizationRepo {
|
|
|
48
72
|
unsetUnnecessaryFields(params: {
|
|
49
73
|
filter: FilterQuery<factory.authorization.IAuthorization>;
|
|
50
74
|
$unset: any;
|
|
51
|
-
}): Promise<import("
|
|
75
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
52
76
|
/**
|
|
53
77
|
* コードを保管する
|
|
54
78
|
*/
|
|
@@ -86,6 +86,6 @@ export declare class CategoryCodeRepo {
|
|
|
86
86
|
unsetUnnecessaryFields(params: {
|
|
87
87
|
filter: FilterQuery<factory.categoryCode.ICategoryCode>;
|
|
88
88
|
$unset: any;
|
|
89
|
-
}): Promise<import("
|
|
89
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
90
90
|
}
|
|
91
91
|
export {};
|
|
@@ -54,9 +54,9 @@ export declare class CommentRepo {
|
|
|
54
54
|
deleteById(params: {
|
|
55
55
|
id: string;
|
|
56
56
|
}): Promise<void>;
|
|
57
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/creativeWork/comment").IComment> &
|
|
57
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/creativeWork/comment").IComment> & import("@chevre/factory/lib/creativeWork/comment").IComment & {
|
|
58
58
|
_id: import("mongoose").Types.ObjectId;
|
|
59
|
-
},
|
|
59
|
+
}, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, import("@chevre/factory/lib/creativeWork/comment").IComment> & import("@chevre/factory/lib/creativeWork/comment").IComment & {
|
|
60
60
|
_id: import("mongoose").Types.ObjectId;
|
|
61
|
-
}
|
|
61
|
+
}>>;
|
|
62
62
|
}
|
|
@@ -74,20 +74,20 @@ export declare class CreativeWorkRepo {
|
|
|
74
74
|
}): Promise<void>;
|
|
75
75
|
getCursor(conditions: FilterQuery<factory.creativeWork.movie.ICreativeWork>, projection: any): import("mongoose").Cursor<Document<unknown, {}, import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
|
|
76
76
|
description?: string | undefined;
|
|
77
|
-
}> &
|
|
77
|
+
}> & import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
|
|
78
78
|
description?: string | undefined;
|
|
79
79
|
} & {
|
|
80
80
|
_id: Types.ObjectId;
|
|
81
|
-
},
|
|
81
|
+
}, import("mongoose").QueryOptions<Document<unknown, {}, import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
|
|
82
82
|
description?: string | undefined;
|
|
83
|
-
}> &
|
|
83
|
+
}> & import("@chevre/factory/lib/creativeWork/movie").ICreativeWork & {
|
|
84
84
|
description?: string | undefined;
|
|
85
85
|
} & {
|
|
86
86
|
_id: Types.ObjectId;
|
|
87
|
-
}
|
|
87
|
+
}>>;
|
|
88
88
|
unsetUnnecessaryFields(params: {
|
|
89
89
|
filter: FilterQuery<factory.creativeWork.movie.ICreativeWork>;
|
|
90
90
|
$unset: any;
|
|
91
|
-
}): Promise<import("
|
|
91
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
92
92
|
}
|
|
93
93
|
export {};
|
|
@@ -121,7 +121,7 @@ class CreativeWorkRepo {
|
|
|
121
121
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
122
|
let doc;
|
|
123
123
|
if (params.id === '') {
|
|
124
|
-
const { $unset } = params, createParams = __rest(params, ["$unset"]);
|
|
124
|
+
const { $unset, id } = params, createParams = __rest(params, ["$unset", "id"]); // omit id(2024-09-12~)
|
|
125
125
|
doc = yield this.creativeWorkModel.create(createParams);
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
@@ -24,7 +24,10 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import type { Connection, FilterQuery } from 'mongoose';
|
|
26
26
|
import * as factory from '../factory';
|
|
27
|
-
type
|
|
27
|
+
type IUnset = {
|
|
28
|
+
[key in keyof Pick<factory.customer.ICustomer, 'telephone' | 'url'>]?: 1;
|
|
29
|
+
};
|
|
30
|
+
type IKeyOfProjection = keyof factory.customer.ICustomer;
|
|
28
31
|
/**
|
|
29
32
|
* 顧客リポジトリ
|
|
30
33
|
*/
|
|
@@ -34,25 +37,28 @@ export declare class CustomerRepo {
|
|
|
34
37
|
static CREATE_MONGO_CONDITIONS(params: factory.customer.ISearchConditions): FilterQuery<factory.customer.ICustomer>[];
|
|
35
38
|
save(params: {
|
|
36
39
|
id?: string;
|
|
37
|
-
attributes: factory.customer.ICustomer
|
|
38
|
-
|
|
40
|
+
attributes: Omit<factory.customer.ICustomer, 'id'> & {
|
|
41
|
+
id?: never;
|
|
42
|
+
$unset?: IUnset;
|
|
43
|
+
};
|
|
44
|
+
}): Promise<{
|
|
45
|
+
id: string;
|
|
46
|
+
}>;
|
|
39
47
|
/**
|
|
40
48
|
* 顧客検索
|
|
41
49
|
*/
|
|
42
|
-
|
|
43
|
-
[key in IKeyOfProjection]?: 0;
|
|
44
|
-
}): Promise<factory.customer.ICustomer[]>;
|
|
50
|
+
projectFields(conditions: factory.customer.ISearchConditions, inclusion: IKeyOfProjection[], exclusion: IKeyOfProjection[]): Promise<factory.customer.ICustomer[]>;
|
|
45
51
|
deleteById(params: {
|
|
46
52
|
id: string;
|
|
47
53
|
}): Promise<void>;
|
|
48
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.customer.ICustomer> &
|
|
54
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, factory.customer.ICustomer> & factory.customer.ICustomer & {
|
|
49
55
|
_id: import("mongoose").Types.ObjectId;
|
|
50
|
-
},
|
|
56
|
+
}, import("mongoose").QueryOptions<import("mongoose").Document<unknown, {}, factory.customer.ICustomer> & factory.customer.ICustomer & {
|
|
51
57
|
_id: import("mongoose").Types.ObjectId;
|
|
52
|
-
}
|
|
58
|
+
}>>;
|
|
53
59
|
unsetUnnecessaryFields(params: {
|
|
54
60
|
filter: any;
|
|
55
61
|
$unset: any;
|
|
56
|
-
}): Promise<import("
|
|
62
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
57
63
|
}
|
|
58
64
|
export {};
|
|
@@ -24,6 +24,17 @@ exports.CustomerRepo = void 0;
|
|
|
24
24
|
const customer_1 = require("./mongoose/schemas/customer");
|
|
25
25
|
const factory = require("../factory");
|
|
26
26
|
const settings_1 = require("../settings");
|
|
27
|
+
const AVAILABLE_PROJECT_FIELDS = [
|
|
28
|
+
'additionalProperty',
|
|
29
|
+
'contactPoint',
|
|
30
|
+
// 'email',
|
|
31
|
+
'branchCode',
|
|
32
|
+
'name',
|
|
33
|
+
'project',
|
|
34
|
+
'typeOf',
|
|
35
|
+
'url'
|
|
36
|
+
// 'telephone'f
|
|
37
|
+
];
|
|
27
38
|
/**
|
|
28
39
|
* 顧客リポジトリ
|
|
29
40
|
*/
|
|
@@ -67,33 +78,49 @@ class CustomerRepo {
|
|
|
67
78
|
return andConditions;
|
|
68
79
|
}
|
|
69
80
|
save(params) {
|
|
81
|
+
var _a, _b;
|
|
70
82
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
let
|
|
83
|
+
let savedId;
|
|
72
84
|
if (params.id === undefined) {
|
|
73
|
-
const
|
|
74
|
-
|
|
85
|
+
const _c = params.attributes, { id, $unset } = _c, creatingDoc = __rest(_c, ["id", "$unset"]);
|
|
86
|
+
const result = yield this.customerModel.insertMany(creatingDoc, { rawResult: true });
|
|
87
|
+
const insertedId = (_b = (_a = result.insertedIds) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.toHexString();
|
|
88
|
+
if (typeof insertedId !== 'string') {
|
|
89
|
+
throw new factory.errors.Internal(`customer not saved unexpectedly. result:${JSON.stringify(result)}`);
|
|
90
|
+
}
|
|
91
|
+
savedId = insertedId;
|
|
75
92
|
}
|
|
76
93
|
else {
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
|
|
94
|
+
const _d = params.attributes, { id, branchCode, project, typeOf, $unset } = _d, updateFields = __rest(_d, ["id", "branchCode", "project", "typeOf", "$unset"]);
|
|
95
|
+
const doc = yield this.customerModel.findOneAndUpdate({ _id: { $eq: params.id } }, Object.assign({ $set: updateFields }, ($unset !== undefined) ? { $unset } : undefined), { upsert: false, new: true, projection: { _id: 1, id: { $toString: '$_id' } } })
|
|
96
|
+
.lean()
|
|
80
97
|
.exec();
|
|
81
98
|
if (doc === null) {
|
|
82
99
|
throw new factory.errors.NotFound(this.customerModel.modelName);
|
|
83
100
|
}
|
|
84
|
-
|
|
101
|
+
savedId = params.id;
|
|
85
102
|
}
|
|
86
|
-
return
|
|
103
|
+
return { id: savedId };
|
|
87
104
|
});
|
|
88
105
|
}
|
|
89
106
|
/**
|
|
90
107
|
* 顧客検索
|
|
91
108
|
*/
|
|
92
|
-
|
|
109
|
+
projectFields(conditions, inclusion, exclusion) {
|
|
93
110
|
var _a;
|
|
94
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
95
112
|
const andConditions = CustomerRepo.CREATE_MONGO_CONDITIONS(conditions);
|
|
96
|
-
|
|
113
|
+
let positiveProjectionFields = AVAILABLE_PROJECT_FIELDS;
|
|
114
|
+
if (Array.isArray(inclusion) && inclusion.length > 0) {
|
|
115
|
+
positiveProjectionFields = inclusion.filter((key) => AVAILABLE_PROJECT_FIELDS.includes(key));
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
if (Array.isArray(exclusion) && exclusion.length > 0) {
|
|
119
|
+
positiveProjectionFields = positiveProjectionFields.filter((key) => !exclusion.includes(key));
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1]))));
|
|
123
|
+
const query = this.customerModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, projection);
|
|
97
124
|
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
98
125
|
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
99
126
|
query.limit(conditions.limit)
|
|
@@ -105,13 +132,13 @@ class CustomerRepo {
|
|
|
105
132
|
query.sort({ branchCode: conditions.sort.branchCode });
|
|
106
133
|
}
|
|
107
134
|
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
108
|
-
.
|
|
109
|
-
.
|
|
135
|
+
.lean() // 2024-09-03~
|
|
136
|
+
.exec();
|
|
110
137
|
});
|
|
111
138
|
}
|
|
112
139
|
deleteById(params) {
|
|
113
140
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
-
yield this.customerModel.findOneAndRemove({ _id: params.id })
|
|
141
|
+
yield this.customerModel.findOneAndRemove({ _id: { $eq: params.id } }, { projection: { _id: 1 } })
|
|
115
142
|
.exec();
|
|
116
143
|
});
|
|
117
144
|
}
|