@chevre/domain 26.0.0-alpha.26 → 26.0.0-alpha.28

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.
Files changed (34) hide show
  1. package/lib/chevre/repo/action.d.ts +1 -1
  2. package/lib/chevre/repo/action.js +0 -260
  3. package/lib/chevre/repo/adminTransaction.d.ts +131 -0
  4. package/lib/chevre/repo/adminTransaction.js +237 -0
  5. package/lib/chevre/repo/aggregateTransaction.d.ts +39 -0
  6. package/lib/chevre/repo/aggregateTransaction.js +166 -0
  7. package/lib/chevre/repo/mongoose/schemas/aggregateReservation.js +8 -9
  8. package/lib/chevre/repo/mongoose/schemas/assetTransaction.js +85 -76
  9. package/lib/chevre/repo/mongoose/schemas/event.js +7 -0
  10. package/lib/chevre/repo/mongoose/schemas/eventOffer.js +7 -0
  11. package/lib/chevre/repo/mongoose/schemas/pendingReservation.js +11 -4
  12. package/lib/chevre/repo/mongoose/schemas/{ownershipInfo.d.ts → updateAction.d.ts} +5 -3
  13. package/lib/chevre/repo/mongoose/schemas/updateAction.js +65 -0
  14. package/lib/chevre/repo/transaction.d.ts +1 -187
  15. package/lib/chevre/repo/transaction.js +2 -383
  16. package/lib/chevre/repo/updateAction.d.ts +52 -0
  17. package/lib/chevre/repo/updateAction.js +429 -0
  18. package/lib/chevre/repository.d.ts +15 -5
  19. package/lib/chevre/repository.js +35 -13
  20. package/lib/chevre/service/aggregation/system.d.ts +2 -2
  21. package/lib/chevre/service/aggregation/system.js +2 -2
  22. package/lib/chevre/service/event/processUpdateMovieTheater.d.ts +2 -2
  23. package/lib/chevre/service/event/processUpdateMovieTheater.js +3 -3
  24. package/lib/chevre/service/event.d.ts +2 -2
  25. package/lib/chevre/service/event.js +3 -3
  26. package/lib/chevre/service/task/deleteTransaction.js +2 -4
  27. package/lib/chevre/service/task/importEventsFromCOA.js +2 -2
  28. package/lib/chevre/service/task/syncResourcesFromCOA.js +11 -11
  29. package/lib/chevre/service/transaction/deleteTransaction.d.ts +2 -2
  30. package/lib/chevre/service/transaction/deleteTransaction.js +2 -2
  31. package/package.json +2 -2
  32. package/lib/chevre/repo/mongoose/schemas/ownershipInfo.js +0 -82
  33. package/lib/chevre/repo/ownershipInfo.d.ts +0 -20
  34. package/lib/chevre/repo/ownershipInfo.js +0 -130
@@ -2,7 +2,7 @@
2
2
  * マスターデータ同期サービス
3
3
  */
4
4
  import type { COA } from '@motionpicture/coa-service';
5
- import type { ActionRepo } from '../repo/action';
5
+ import type { UpdateActionRepo } from '../repo/updateAction';
6
6
  import type { CategoryCodeRepo } from '../repo/categoryCode';
7
7
  import type { CreativeWorkRepo } from '../repo/creativeWork';
8
8
  import type { EventRepo } from '../repo/event';
@@ -17,7 +17,7 @@ import { saveScreeningEventSeries } from './event/saveScreeningEventSeries';
17
17
  * イベントをインポートする
18
18
  */
19
19
  declare function importFromCOA(params: IImportFromCOAParams): (repos: {
20
- action: ActionRepo;
20
+ updateAction: UpdateActionRepo;
21
21
  categoryCode: CategoryCodeRepo;
22
22
  creativeWork: CreativeWorkRepo;
23
23
  event: EventRepo;
@@ -70,7 +70,7 @@ function importFromCOA(params) {
70
70
  instrument,
71
71
  targetCollection: { typeOf: factory_1.factory.eventType.ScreeningEvent }
72
72
  };
73
- const action = await repos.action.start(actionAttributes);
73
+ const action = await repos.updateAction.startUpdateAction(actionAttributes);
74
74
  let savedScreeningEventsCount = 0;
75
75
  let savedScreeningEventSeriesCount = 0;
76
76
  let cancelledIds = [];
@@ -131,7 +131,7 @@ function importFromCOA(params) {
131
131
  }
132
132
  catch (error) {
133
133
  try {
134
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
134
+ await repos.updateAction.giveUpUpdateAction({ typeOf: action.typeOf, id: action.id, error });
135
135
  }
136
136
  catch (__) {
137
137
  // 失敗したら仕方ない
@@ -144,7 +144,7 @@ function importFromCOA(params) {
144
144
  savedScreeningEventSeriesCount,
145
145
  ...(processTime !== undefined) ? { processTime } : undefined
146
146
  };
147
- await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: actionResult });
147
+ await repos.updateAction.completeUpdateAction({ typeOf: action.typeOf, id: action.id, result: actionResult });
148
148
  };
149
149
  }
150
150
  function cancelDeletedEvents(params) {
@@ -37,12 +37,11 @@ exports.call = call;
37
37
  const acceptedOffer_1 = require("../../repo/acceptedOffer");
38
38
  const accountingReport_1 = require("../../repo/accountingReport");
39
39
  const action_1 = require("../../repo/action");
40
+ const adminTransaction_1 = require("../../repo/adminTransaction");
40
41
  const assetTransaction_1 = require("../../repo/assetTransaction");
41
- // import { MessageRepo } from '../../repo/message';
42
42
  const note_1 = require("../../repo/note");
43
43
  const order_1 = require("../../repo/order");
44
44
  const reservation_1 = require("../../repo/reservation");
45
- const transaction_1 = require("../../repo/transaction");
46
45
  const placeOrder_1 = require("../../repo/transaction/placeOrder");
47
46
  const returnOrder_1 = require("../../repo/transaction/returnOrder");
48
47
  const TransactionService = __importStar(require("../transaction"));
@@ -56,12 +55,11 @@ function call(params) {
56
55
  acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
57
56
  accountingReport: new accountingReport_1.AccountingReportRepo(connection),
58
57
  action: new action_1.ActionRepo(connection),
58
+ adminTransaction: new adminTransaction_1.AdminTransactionRepo(connection),
59
59
  assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
60
- // message: new MessageRepo(connection),
61
60
  note: new note_1.NoteRepo(connection),
62
61
  order: new order_1.OrderRepo(connection),
63
62
  reservation: new reservation_1.ReservationRepo(connection),
64
- transaction: new transaction_1.TransactionRepo(connection),
65
63
  placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
66
64
  returnOrder: new returnOrder_1.ReturnOrderRepo(connection),
67
65
  });
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.call = call;
37
37
  const coa_service_1 = require("@motionpicture/coa-service");
38
- const action_1 = require("../../repo/action");
38
+ const updateAction_1 = require("../../repo/updateAction");
39
39
  const categoryCode_1 = require("../../repo/categoryCode");
40
40
  const creativeWork_1 = require("../../repo/creativeWork");
41
41
  const event_1 = require("../../repo/event");
@@ -71,7 +71,7 @@ function call(params) {
71
71
  ...params.data,
72
72
  project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project }
73
73
  })({
74
- action: new action_1.ActionRepo(connection),
74
+ updateAction: new updateAction_1.UpdateActionRepo(connection),
75
75
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
76
76
  creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
77
77
  event: new event_1.EventRepo(connection),
@@ -7,7 +7,7 @@ exports.call = call;
7
7
  const coa_service_1 = require("@motionpicture/coa-service");
8
8
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
9
9
  const factory_1 = require("../../factory");
10
- const action_1 = require("../../repo/action");
10
+ const updateAction_1 = require("../../repo/updateAction");
11
11
  const categoryCode_1 = require("../../repo/categoryCode");
12
12
  const creativeWork_1 = require("../../repo/creativeWork");
13
13
  const credentials_1 = require("../../repo/credentials");
@@ -53,7 +53,7 @@ function call(params) {
53
53
  ...(credentialsRepo !== undefined) ? { credentialsRepo } : undefined
54
54
  });
55
55
  }
56
- const actionRepo = new action_1.ActionRepo(connection);
56
+ const updateActionRepo = new updateAction_1.UpdateActionRepo(connection);
57
57
  try {
58
58
  const masterService = new coa_service_1.COA.service.Master({
59
59
  endpoint: coaAuthClient.options.endpoint, // same as authClient(2024-07-17~)
@@ -67,7 +67,7 @@ function call(params) {
67
67
  object,
68
68
  sameAs: { id: params.id }
69
69
  })({
70
- action: actionRepo,
70
+ updateAction: updateActionRepo,
71
71
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
72
72
  creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
73
73
  eventSeries: new eventSeries_1.EventSeriesRepo(connection),
@@ -82,7 +82,7 @@ function call(params) {
82
82
  object,
83
83
  sameAs: { id: params.id }
84
84
  })({
85
- action: actionRepo,
85
+ updateAction: updateActionRepo,
86
86
  categoryCode: new categoryCode_1.CategoryCodeRepo(connection),
87
87
  creativeWork: new creativeWork_1.CreativeWorkRepo(connection),
88
88
  event: new event_1.EventRepo(connection),
@@ -96,7 +96,7 @@ function call(params) {
96
96
  catch (error) {
97
97
  let throwsError = true;
98
98
  // アクションが存在すればタスクを実行済扱いにする
99
- const action = (await actionRepo.searchBySameAs({
99
+ const action = (await updateActionRepo.searchBySameAs({
100
100
  sameAs: { id: { $eq: params.id } },
101
101
  typeOf: { $eq: factory_1.factory.actionType.ReplaceAction }
102
102
  })).shift();
@@ -129,7 +129,7 @@ function syncEventSeries(params) {
129
129
  targetCollection: { typeOf: factory_1.factory.eventType.ScreeningEventSeries },
130
130
  sameAs: { id: params.sameAs.id, typeOf: 'Task' }
131
131
  };
132
- const action = await repos.action.start(actionAttributes);
132
+ const action = await repos.updateAction.startUpdateAction(actionAttributes);
133
133
  let saveResult;
134
134
  try {
135
135
  const movieTheater = (await repos.movieTheater.projectFields({
@@ -165,7 +165,7 @@ function syncEventSeries(params) {
165
165
  }
166
166
  catch (error) {
167
167
  try {
168
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
168
+ await repos.updateAction.giveUpUpdateAction({ typeOf: action.typeOf, id: action.id, error });
169
169
  }
170
170
  catch (__) {
171
171
  // no op
@@ -178,7 +178,7 @@ function syncEventSeries(params) {
178
178
  typeOf: eventSeries.typeOf
179
179
  };
180
180
  });
181
- await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result });
181
+ await repos.updateAction.completeUpdateAction({ typeOf: action.typeOf, id: action.id, result });
182
182
  };
183
183
  }
184
184
  function syncEvents(params) {
@@ -198,7 +198,7 @@ function syncEvents(params) {
198
198
  targetCollection: { typeOf: factory_1.factory.eventType.ScreeningEvent },
199
199
  sameAs: { id: params.sameAs.id, typeOf: 'Task' }
200
200
  };
201
- const action = await repos.action.start(actionAttributes);
201
+ const action = await repos.updateAction.startUpdateAction(actionAttributes);
202
202
  let saveResult;
203
203
  try {
204
204
  const movieTheater = (await repos.movieTheater.projectFields({
@@ -280,7 +280,7 @@ function syncEvents(params) {
280
280
  }
281
281
  catch (error) {
282
282
  try {
283
- await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
283
+ await repos.updateAction.giveUpUpdateAction({ typeOf: action.typeOf, id: action.id, error });
284
284
  }
285
285
  catch (__) {
286
286
  // no op
@@ -293,6 +293,6 @@ function syncEvents(params) {
293
293
  typeOf: event.typeOf
294
294
  };
295
295
  });
296
- await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result });
296
+ await repos.updateAction.completeUpdateAction({ typeOf: action.typeOf, id: action.id, result });
297
297
  };
298
298
  }
@@ -2,22 +2,22 @@ import { factory } from '../../factory';
2
2
  import type { AcceptedOfferRepo } from '../../repo/acceptedOffer';
3
3
  import type { AccountingReportRepo } from '../../repo/accountingReport';
4
4
  import type { ActionRepo } from '../../repo/action';
5
+ import type { AdminTransactionRepo } from '../../repo/adminTransaction';
5
6
  import type { AssetTransactionRepo } from '../../repo/assetTransaction';
6
7
  import type { NoteRepo } from '../../repo/note';
7
8
  import type { OrderRepo } from '../../repo/order';
8
9
  import type { ReservationRepo } from '../../repo/reservation';
9
- import type { TransactionRepo } from '../../repo/transaction';
10
10
  import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
11
11
  import type { ReturnOrderRepo } from '../../repo/transaction/returnOrder';
12
12
  interface IDeleteTransactionRepos {
13
13
  acceptedOffer: AcceptedOfferRepo;
14
14
  accountingReport: AccountingReportRepo;
15
15
  action: ActionRepo;
16
+ adminTransaction: AdminTransactionRepo;
16
17
  assetTransaction: AssetTransactionRepo;
17
18
  note: NoteRepo;
18
19
  order: OrderRepo;
19
20
  reservation: ReservationRepo;
20
- transaction: TransactionRepo;
21
21
  placeOrder: PlaceOrderRepo;
22
22
  returnOrder: ReturnOrderRepo;
23
23
  }
@@ -132,13 +132,13 @@ function deleteTransactionById(params) {
132
132
  // })(repos);
133
133
  // deleteMessagessResult = deleteMessagesByPlaceOrderResult.deleteResult;
134
134
  // 取引削除
135
- await repos.transaction.findByIdAndDelete({ id: transaction.id });
135
+ await repos.adminTransaction.findByIdAndDelete({ id: transaction.id });
136
136
  break;
137
137
  }
138
138
  // implemented(2022-06-09~)
139
139
  case factory_1.factory.transactionType.ReturnOrder:
140
140
  // 取引削除
141
- await repos.transaction.findByIdAndDelete({ id: transaction.id });
141
+ await repos.adminTransaction.findByIdAndDelete({ id: transaction.id });
142
142
  break;
143
143
  default:
144
144
  throw new factory_1.factory.errors.NotImplemented(`${transactionTypeOf} not implemented`);
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@aws-sdk/client-cognito-identity-provider": "3.1090.0",
13
13
  "@aws-sdk/credential-providers": "3.1090.0",
14
- "@chevre/factory": "10.3.0-alpha.3",
14
+ "@chevre/factory": "10.3.0-alpha.4",
15
15
  "@motionpicture/coa-service": "10.0.0",
16
16
  "@motionpicture/gmo-service": "6.1.0-alpha.0",
17
17
  "@sendgrid/client": "8.1.4",
@@ -88,5 +88,5 @@
88
88
  "postversion": "git push origin --tags",
89
89
  "prepublishOnly": "npm run clean && npm run build"
90
90
  },
91
- "version": "26.0.0-alpha.26"
91
+ "version": "26.0.0-alpha.28"
92
92
  }
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.modelName = exports.indexes = void 0;
4
- exports.createSchema = createSchema;
5
- const mongoose_1 = require("mongoose");
6
- const writeConcern_1 = require("../writeConcern");
7
- const settings_1 = require("../../../settings");
8
- const modelName = 'OwnershipInfo';
9
- exports.modelName = modelName;
10
- const schemaDefinition = {
11
- project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
12
- _id: String,
13
- typeOf: { type: String, required: true },
14
- identifier: { type: String, required: true },
15
- ownedBy: mongoose_1.SchemaTypes.Mixed,
16
- acquiredFrom: mongoose_1.SchemaTypes.Mixed,
17
- ownedFrom: { type: Date, required: true },
18
- ownedThrough: { type: Date, required: true },
19
- typeOfGood: mongoose_1.SchemaTypes.Mixed
20
- };
21
- const schemaOptions = {
22
- autoIndex: settings_1.MONGO_AUTO_INDEX,
23
- autoCreate: false,
24
- collection: 'ownershipInfos',
25
- id: true,
26
- read: 'primary',
27
- writeConcern: writeConcern_1.writeConcern,
28
- strict: true,
29
- strictQuery: false,
30
- timestamps: false,
31
- versionKey: false,
32
- toJSON: {
33
- getters: false,
34
- virtuals: false,
35
- minimize: false,
36
- versionKey: false
37
- },
38
- toObject: {
39
- getters: false,
40
- virtuals: true,
41
- minimize: false,
42
- versionKey: false
43
- }
44
- };
45
- const indexes = [
46
- [
47
- // 識別子はユニークな前提
48
- { identifier: 1 },
49
- {
50
- unique: true,
51
- name: 'uniqueIdentifier'
52
- }
53
- ],
54
- [
55
- { ownedFrom: -1 },
56
- { name: 'searchByOwnedFrom-v3' }
57
- ],
58
- [
59
- { 'project.id': 1, ownedFrom: -1 },
60
- { name: 'searchByProjectId-v20220721' }
61
- ],
62
- [
63
- { ownedThrough: 1, ownedFrom: -1 },
64
- { name: 'ownedThrough' }
65
- ]
66
- ];
67
- exports.indexes = indexes;
68
- /**
69
- * 所有権スキーマ
70
- */
71
- let schema;
72
- function createSchema() {
73
- if (schema === undefined) {
74
- schema = new mongoose_1.Schema(schemaDefinition, schemaOptions);
75
- if (settings_1.MONGO_AUTO_INDEX) {
76
- indexes.forEach((indexParams) => {
77
- schema?.index(...indexParams);
78
- });
79
- }
80
- }
81
- return schema;
82
- }
@@ -1,20 +0,0 @@
1
- import type { Connection, FilterQuery } from 'mongoose';
2
- import { IDocType } from './mongoose/schemas/ownershipInfo';
3
- import { factory } from '../factory';
4
- type IOwnershipInfoWithId = factory.ownershipInfo.IOwnershipInfo<factory.ownershipInfo.IGood> & {
5
- id: string;
6
- };
7
- type IFindParams = factory.ownershipInfo.ISearchConditions;
8
- /**
9
- * 所有権リポジトリ
10
- */
11
- export declare class OwnershipInfoRepo {
12
- private readonly ownershipInfoModel;
13
- constructor(connection: Connection);
14
- static CREATE_MONGO_CONDITIONS(params: Pick<IFindParams, 'ownedFromGte' | 'ownedFromLte' | 'project'>): FilterQuery<IDocType>[];
15
- /**
16
- * 所有権を検索する
17
- */
18
- findOwnershipInfos(params: IFindParams, inclusion?: (keyof IOwnershipInfoWithId)[]): Promise<IOwnershipInfoWithId[]>;
19
- }
20
- export {};
@@ -1,130 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OwnershipInfoRepo = void 0;
4
- // import { v4 } from 'uuid';
5
- const ownershipInfo_1 = require("./mongoose/schemas/ownershipInfo");
6
- const settings_1 = require("../settings");
7
- /**
8
- * 所有権リポジトリ
9
- */
10
- class OwnershipInfoRepo {
11
- ownershipInfoModel;
12
- constructor(connection) {
13
- this.ownershipInfoModel = connection.model(ownershipInfo_1.modelName, (0, ownershipInfo_1.createSchema)());
14
- }
15
- static CREATE_MONGO_CONDITIONS(params) {
16
- const andConditions = [];
17
- const projectIdEq = params.project?.id?.$eq;
18
- if (typeof projectIdEq === 'string') {
19
- andConditions.push({ 'project.id': { $eq: projectIdEq } });
20
- }
21
- const ownedFromGte = params.ownedFromGte;
22
- if (ownedFromGte instanceof Date) {
23
- andConditions.push({
24
- ownedFrom: { $gte: ownedFromGte }
25
- });
26
- }
27
- const ownedFromLte = params.ownedFromLte;
28
- if (ownedFromLte instanceof Date) {
29
- andConditions.push({
30
- ownedFrom: { $lte: ownedFromLte }
31
- });
32
- }
33
- return andConditions;
34
- }
35
- // /**
36
- // * なければ作成する
37
- // */
38
- // public async createIfNotExistByIdentifier(ownershipInfo: Omit<IOwnershipInfoWithId, 'id'>): Promise<{ id: string }> {
39
- // let doc: { id: string } | undefined | null;
40
- // let duplicate = false;
41
- // try {
42
- // doc = await this.ownershipInfoModel.findOneAndUpdate(
43
- // { identifier: { $eq: ownershipInfo.identifier } },
44
- // {
45
- // // insert時以外は何もしなくてもよい
46
- // $setOnInsert: {
47
- // ...ownershipInfo,
48
- // _id: v4() // 新規作成時は所有権ID発行
49
- // }
50
- // },
51
- // {
52
- // new: true,
53
- // upsert: true,
54
- // projection: {
55
- // _id: 0,
56
- // id: { $toString: '$_id' }
57
- // }
58
- // }
59
- // )
60
- // .lean<{ id: string }>()
61
- // .exec();
62
- // } catch (error) {
63
- // if (await isMongoDuplicateError(error)) {
64
- // // すでに所有権が存在する場合ok
65
- // duplicate = true;
66
- // }
67
- // if (!duplicate) {
68
- // throw error;
69
- // }
70
- // }
71
- // if (duplicate) {
72
- // // 重複の場合、再度取得
73
- // doc = await this.ownershipInfoModel.findOne(
74
- // { identifier: { $eq: ownershipInfo.identifier } },
75
- // {
76
- // _id: 0,
77
- // id: { $toString: '$_id' }
78
- // }
79
- // )
80
- // .lean<{ id: string }>()
81
- // .exec();
82
- // }
83
- // if (doc === undefined || doc === null) {
84
- // throw new factory.errors.NotFound(this.ownershipInfoModel.modelName);
85
- // }
86
- // return { id: doc.id };
87
- // }
88
- /**
89
- * 所有権を検索する
90
- */
91
- async findOwnershipInfos(params, inclusion) {
92
- const conditions = OwnershipInfoRepo.CREATE_MONGO_CONDITIONS(params);
93
- let projection = {
94
- _id: 0,
95
- id: { $toString: '$_id' },
96
- project: 1,
97
- typeOf: 1,
98
- identifier: 1,
99
- ownedBy: 1,
100
- acquiredFrom: 1,
101
- ownedFrom: 1,
102
- ownedThrough: 1,
103
- typeOfGood: 1
104
- };
105
- const positiveProjectionFields = (Array.isArray(inclusion))
106
- ? inclusion.filter((key) => key !== 'id' && String(key) !== '_id')
107
- : undefined;
108
- if (Array.isArray(positiveProjectionFields)) {
109
- projection = {
110
- _id: 0,
111
- id: { $toString: '$_id' },
112
- ...Object.fromEntries(positiveProjectionFields.map((key) => ([key, 1])))
113
- };
114
- }
115
- const query = this.ownershipInfoModel.find((conditions.length > 0) ? { $and: conditions } : {}, projection);
116
- if (typeof params.limit === 'number' && params.limit > 0) {
117
- const page = (typeof params.page === 'number' && params.page > 0) ? params.page : 1;
118
- query.limit(params.limit)
119
- .skip(params.limit * (page - 1));
120
- }
121
- /* istanbul ignore else */
122
- if (params.sort?.ownedFrom !== undefined) {
123
- query.sort({ ownedFrom: params.sort.ownedFrom });
124
- }
125
- return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
126
- .lean() // lean(2024-08-19~)
127
- .exec();
128
- }
129
- }
130
- exports.OwnershipInfoRepo = OwnershipInfoRepo;