@common-stack/store-mongo 7.0.4-alpha.6 → 7.1.1-alpha.4

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/dataloaders/bulk-dataloader.d.ts +4 -6
  2. package/lib/dataloaders/bulk-dataloader.js +7 -5
  3. package/lib/dataloaders/bulk-dataloader.js.map +1 -1
  4. package/lib/dataloaders/bulk-dataloader.test.d.ts +1 -0
  5. package/lib/graphql/schema/base-services.graphql +1 -0
  6. package/lib/index.js +1 -1
  7. package/lib/interfaces/base-repository.d.ts +25 -19
  8. package/lib/interfaces/base-service.d.ts +18 -19
  9. package/lib/interfaces/dataloader.d.ts +17 -0
  10. package/lib/interfaces/get-all-args.d.ts +20 -1
  11. package/lib/interfaces/{base-repository.js → get-all-args.js} +1 -1
  12. package/lib/interfaces/get-all-args.js.map +1 -0
  13. package/lib/interfaces/index.d.ts +1 -1
  14. package/lib/mixins/base-service-mixin.d.ts +1 -1
  15. package/lib/mixins/base-service-mixin.js +2 -2
  16. package/lib/mixins/base-service-mixin.js.map +1 -1
  17. package/lib/services/base-proxy-service.d.ts +20 -17
  18. package/lib/services/base-proxy-service.js +3 -0
  19. package/lib/services/base-proxy-service.js.map +1 -1
  20. package/lib/services/base-service.d.ts +19 -18
  21. package/lib/services/base-service.js +13 -11
  22. package/lib/services/base-service.js.map +1 -1
  23. package/lib/services/base-service.test.d.ts +1 -0
  24. package/lib/store/models/common-options.d.ts +3 -2
  25. package/lib/store/models/common-options.js +23 -3
  26. package/lib/store/models/common-options.js.map +1 -1
  27. package/lib/store/repositories/base-repository.d.ts +58 -22
  28. package/lib/store/repositories/base-repository.js +277 -135
  29. package/lib/store/repositories/base-repository.js.map +1 -1
  30. package/lib/store/repositories/base-repository.test.d.ts +1 -0
  31. package/lib/store/repositories/custom-id-repository.test.d.ts +1 -0
  32. package/package.json +4 -3
  33. package/lib/interfaces/base-repository.js.map +0 -1
  34. package/lib/interfaces/dataloaders.d.ts +0 -10
@@ -1,29 +1,65 @@
1
1
  import { CdmLogger } from '@cdm-logger/core';
2
- import { Connection, Document, FilterQuery, Model, PipelineStage, UpdateQuery } from 'mongoose';
3
- import { GetAllArgs, IBaseRepository, IMongoOptions } from '../../interfaces';
4
- export declare class BaseRepository<T, D = Document<T>> implements IBaseRepository<T, D> {
2
+ import { Connection, FilterQuery, Model, PipelineStage, UpdateQuery } from 'mongoose';
3
+ import { GetAllArgs, ISort, IBaseRepository, IMongoOptions, AsDomainType, CreateType, UpdateType } from '../../interfaces';
4
+ export declare class BaseRepository<SchemaType> implements IBaseRepository<SchemaType> {
5
5
  private modelFunc;
6
6
  private options;
7
7
  protected logger: CdmLogger.ILogger;
8
- model: Model<D>;
9
- constructor(modelFunc: (db: Connection) => Model<D>, db: Connection, logger: CdmLogger.ILogger, options?: IMongoOptions);
10
- private computeSort;
11
- preparePipeLine(options: GetAllArgs<D>): PipelineStage[];
12
- getAll(options: GetAllArgs<D>): Promise<T[]>;
13
- getAllWithCount(options: GetAllArgs<D>): Promise<{
14
- data: T[];
8
+ model: Model<SchemaType>;
9
+ constructor(modelFunc: (db: Connection) => Model<SchemaType>, db: Connection, logger: CdmLogger.ILogger, options?: IMongoOptions);
10
+ /**
11
+ * Transforms a document to the domain model format
12
+ */
13
+ protected transformDocument(doc: any): AsDomainType<SchemaType> | null;
14
+ /**
15
+ * Transforms an array of documents
16
+ */
17
+ protected transformDocuments(docs: SchemaType[]): AsDomainType<SchemaType>[];
18
+ /**
19
+ * Maps API criteria with 'id' to MongoDB criteria with '_id'
20
+ */
21
+ private mapConditions;
22
+ /**
23
+ * Computes sort object from GetAllArgs sort parameter
24
+ * Handles both string-based and object-based sort specifications
25
+ */
26
+ protected computeSort(sort: ISort | string | ISort[]): Record<string, 1 | -1>;
27
+ /**
28
+ * Prepares an aggregation pipeline with standard stages
29
+ * @param options Query options including filtering, sorting, pagination
30
+ * @param customPipeline Optional custom pipeline stages to include
31
+ * @returns Complete MongoDB aggregation pipeline
32
+ */
33
+ protected preparePipeline(options: GetAllArgs<SchemaType>, customPipeline?: PipelineStage[]): PipelineStage[];
34
+ /**
35
+ * Execute an aggregation pipeline and transform the results
36
+ */
37
+ protected aggregate(pipeline: PipelineStage[]): Promise<AsDomainType<SchemaType>[]>;
38
+ count(conditions?: FilterQuery<SchemaType>): Promise<number>;
39
+ get(conditions?: FilterQuery<SchemaType>, selectedFields?: string): Promise<AsDomainType<SchemaType> | null>;
40
+ find(conditions: Partial<FilterQuery<SchemaType>>, selectedFields?: string): Promise<AsDomainType<SchemaType> | null>;
41
+ getAll(options: GetAllArgs<SchemaType>): Promise<AsDomainType<SchemaType>[]>;
42
+ /**
43
+ * Get all documents using aggregation pipeline
44
+ */
45
+ getAllWithPipeline(options: GetAllArgs<SchemaType>, customPipeline?: PipelineStage[]): Promise<AsDomainType<SchemaType>[]>;
46
+ getAllWithCount(options: GetAllArgs<SchemaType>): Promise<{
47
+ data: AsDomainType<SchemaType>[];
15
48
  totalCount: number;
16
49
  }>;
17
- private mapConditions;
18
- count(conditions?: FilterQuery<D>): Promise<number>;
19
- get(conditions?: FilterQuery<D>, selectedFields?: string): Promise<T>;
20
- bulkGet(ids: string[]): Promise<T[]>;
21
- find(conditions: Partial<FilterQuery<D>>, selectedFields?: string): Promise<T>;
22
- create<I>(data: I): Promise<T>;
23
- bulkCreate<I>(data: I[]): Promise<T[]>;
24
- upsert<I>(conditions: FilterQuery<D>, update: I, options?: Record<string, unknown>): Promise<T>;
25
- bulkUpdate<I>(criteria: FilterQuery<D>, update: UpdateQuery<D>, options: Record<string, unknown>): Promise<T[]>;
26
- update<I>(criteria: FilterQuery<D>, update: UpdateQuery<D>, options: Record<string, unknown>): Promise<T>;
27
- delete(criteria: FilterQuery<D>): Promise<boolean>;
28
- bulkDelete(criteria: FilterQuery<D>): Promise<number>;
50
+ /**
51
+ * Get all documents with count using aggregation pipeline
52
+ */
53
+ getAllWithCountAndPipeline(options: GetAllArgs<SchemaType>, customPipeline?: PipelineStage[]): Promise<{
54
+ data: AsDomainType<SchemaType>[];
55
+ totalCount: number;
56
+ }>;
57
+ create<T = CreateType<SchemaType>>(data: T): Promise<AsDomainType<SchemaType>>;
58
+ bulkCreate<T = CreateType<SchemaType>>(data: T[]): Promise<AsDomainType<SchemaType>[]>;
59
+ upsert<T = UpdateType<SchemaType>>(conditions: FilterQuery<SchemaType>, update: T, options?: Record<string, unknown>): Promise<AsDomainType<SchemaType>>;
60
+ update<T = UpdateType<SchemaType>>(criteria: FilterQuery<SchemaType>, update: T | UpdateQuery<SchemaType>, options?: Record<string, unknown>): Promise<AsDomainType<SchemaType>>;
61
+ bulkUpdate<T = UpdateType<SchemaType>>(criteria: FilterQuery<SchemaType>, update: T | UpdateQuery<SchemaType>, options?: Record<string, unknown>): Promise<AsDomainType<SchemaType>[]>;
62
+ delete(criteria: FilterQuery<SchemaType>): Promise<boolean>;
63
+ bulkDelete(criteria: FilterQuery<SchemaType>): Promise<number>;
64
+ bulkGet(ids: string[], selectedFields?: string): Promise<AsDomainType<SchemaType>[]>;
29
65
  }
@@ -1,4 +1,4 @@
1
- import {__decorate,__param,__metadata}from'tslib';import {isObject}from'lodash-es';import'@cdm-logger/core';import {Connection,Types}from'mongoose';import {injectable,unmanaged}from'inversify';import {PAGINATION_OPTIONS}from'../../interfaces/base-repository.js';var BaseRepository_1;
1
+ import {__decorate,__param,__metadata}from'tslib';import {isObject}from'lodash-es';import'@cdm-logger/core';import {Connection,Types}from'mongoose';import {injectable,unmanaged}from'inversify';import {PAGINATION_OPTIONS}from'../../interfaces/get-all-args.js';var BaseRepository_1;
2
2
  let BaseRepository = BaseRepository_1 = class BaseRepository {
3
3
  modelFunc;
4
4
  options;
@@ -10,143 +10,249 @@ let BaseRepository = BaseRepository_1 = class BaseRepository {
10
10
  this.options = options;
11
11
  this.logger = logger.child({ className: BaseRepository_1.name });
12
12
  }
13
- computeSort(sort) {
14
- if (isObject(sort)) {
15
- return { [sort?.key]: sort.value.toLowerCase() === 'asc' ? 1 : -1 };
16
- }
17
- return null;
18
- }
19
- preparePipeLine(options) {
20
- const { criteria, selectedFields, sort, limit, skip } = options;
21
- // map id to mongoose _id
22
- const mappedCriteria = Object.entries(criteria || {}).reduce((acc, [key, value]) => ({
23
- ...acc,
24
- [key]: Types.ObjectId.isValid(value) ? new Types.ObjectId(value) : value,
25
- }), { id: undefined });
26
- const { id, ...rest } = mappedCriteria;
27
- const projectedFields = selectedFields?.split(' ').reduce((acc, key) => ({
28
- ...acc,
29
- [key]: 1,
30
- }), {});
31
- return [
32
- { $match: Object.assign({}, rest, id ? { _id: id } : {}) },
33
- ...(sort ? [{ $sort: this.computeSort(sort) }] : []),
34
- ...(selectedFields?.length
35
- ? [
36
- {
37
- $project: projectedFields,
38
- },
39
- ]
40
- : []),
41
- { $skip: skip || PAGINATION_OPTIONS.skip },
42
- { $limit: limit || PAGINATION_OPTIONS.limit },
43
- { $addFields: { id: '$_id' } },
44
- { $project: { _id: 0 } },
45
- ];
46
- }
47
- // public async getAll(options: GetAllArgs<D>): Promise<T[]> {
48
- // try {
49
- // return this.model.aggregate(this.preparePipeLine(options));
50
- // } catch (e) {
51
- // this.logger.error(e, 'Unable to retrieve Model with options ${JSON.stringify(options)}`);
52
- // throw e;
53
- // }
54
- // }
55
- async getAll(options) {
56
- try {
57
- const { criteria, selectedFields, sort, limit, skip } = options;
58
- // map id to mongoose _id
59
- const { id, ...rest } = criteria || { id: undefined };
60
- const sortBy = isObject(sort) ? { [sort?.key]: sort.value } : { createdAt: 1 };
61
- const response = await this.model
62
- .find({ ...rest, ...(id ? { _id: id } : {}) }, selectedFields)
63
- .sort(sortBy)
64
- .limit(limit || PAGINATION_OPTIONS.limit)
65
- .skip(skip || PAGINATION_OPTIONS.skip)
66
- .exec();
67
- return response.map((i) => i?.toObject());
68
- }
69
- catch (e) {
70
- this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', options);
71
- throw e;
13
+ /**
14
+ * Transforms a document to the domain model format
15
+ */
16
+ transformDocument(doc) {
17
+ if (!doc)
18
+ return null;
19
+ // If it's already a plain object (not a Mongoose document)
20
+ if (!doc.toObject) {
21
+ // Ensure id exists if _id is present
22
+ if (doc._id && !doc.id) {
23
+ doc.id = typeof doc._id === 'object' && doc._id.toString ? doc._id.toString() : doc._id;
24
+ }
25
+ return doc;
72
26
  }
27
+ // For Mongoose documents, use the built-in toObject transformation
28
+ return doc.toObject();
73
29
  }
74
- async getAllWithCount(options) {
75
- const data = await this.getAll(options);
76
- const totalCount = await this.count(options.criteria);
77
- return { totalCount, data };
30
+ /**
31
+ * Transforms an array of documents
32
+ */
33
+ transformDocuments(docs) {
34
+ if (!docs || !Array.isArray(docs))
35
+ return [];
36
+ return docs.map((doc) => this.transformDocument(doc)).filter(Boolean);
78
37
  }
79
- // public async getAllWithCount(options: GetAllArgs<D>): Promise<{ data: T[], totalCount: number }> {
80
- // try {
81
- // const pipeline: PipelineStage[] = this.preparePipeLine(options);
82
- // pipeline.push({
83
- // $facet: {
84
- // data: [{
85
- // $group: {
86
- // _id: null,
87
- // items: { $push: '$$ROOT' }
88
- // }
89
- // }],
90
- // count: [{ $count: 'count' }],
91
- // },
92
- // })
93
- // const result = await this.model.aggregate(pipeline);
94
- // const data = result[0]?.data[0]?.items || [];
95
- // const totalCount = result[0]?.count[0]?.count || 0;
96
- // return { data, totalCount };
97
- // } catch (e) {
98
- // this.logger.error(e, 'Unable to retrieve Model with options ${JSON.stringify(options)}`);
99
- // throw e;
100
- // }
101
- // }
102
- // eslint-disable-next-line class-methods-use-this
38
+ /**
39
+ * Maps API criteria with 'id' to MongoDB criteria with '_id'
40
+ */
103
41
  mapConditions(conditions) {
104
- const { id: _id, ...remaining } = conditions;
42
+ if (!conditions)
43
+ return {};
44
+ const { id, ...remaining } = conditions;
45
+ if (!id)
46
+ return remaining;
47
+ // Handle custom _id that might not be an ObjectId
48
+ let _id;
49
+ if (Types.ObjectId.isValid(id)) {
50
+ _id = new Types.ObjectId(id);
51
+ }
52
+ else {
53
+ _id = id; // Use the id as-is if it's not a valid ObjectId
54
+ }
105
55
  return {
106
- ...(_id ? { _id } : {}),
56
+ _id,
107
57
  ...remaining,
108
58
  };
109
59
  }
60
+ /**
61
+ * Computes sort object from GetAllArgs sort parameter
62
+ * Handles both string-based and object-based sort specifications
63
+ */
64
+ computeSort(sort) {
65
+ // Default sort by createdAt descending if available, otherwise empty sort
66
+ if (!sort) {
67
+ return { createdAt: -1 };
68
+ }
69
+ // Handle object-based sort { key: 'fieldName', value: 'asc'|'desc' }
70
+ if (isObject(sort) && 'key' in sort) {
71
+ return {
72
+ [sort.key]: sort.value?.toLowerCase() === 'asc' ? 1 : -1,
73
+ };
74
+ }
75
+ // Handle string-based sort 'fieldName:asc' or 'fieldName:desc'
76
+ if (typeof sort === 'string') {
77
+ const [field, direction] = sort.split(':');
78
+ if (field) {
79
+ return {
80
+ [field]: direction?.toLowerCase() === 'asc' ? 1 : -1,
81
+ };
82
+ }
83
+ }
84
+ // Handle array of sort specifications
85
+ if (Array.isArray(sort)) {
86
+ return sort.reduce((acc, sortItem) => {
87
+ if (isObject(sortItem) && sortItem.key) {
88
+ acc[sortItem.key] = sortItem.value?.toLowerCase() === 'asc' ? 1 : -1;
89
+ }
90
+ return acc;
91
+ }, {});
92
+ }
93
+ // Fallback to default sort
94
+ return { createdAt: -1 };
95
+ }
96
+ /**
97
+ * Prepares an aggregation pipeline with standard stages
98
+ * @param options Query options including filtering, sorting, pagination
99
+ * @param customPipeline Optional custom pipeline stages to include
100
+ * @returns Complete MongoDB aggregation pipeline
101
+ */
102
+ preparePipeline(options, customPipeline = []) {
103
+ const { criteria, sort, limit, skip } = options;
104
+ const pipeline = [];
105
+ // Match stage (filtering)
106
+ if (criteria) {
107
+ pipeline.push({
108
+ $match: this.mapConditions(criteria),
109
+ });
110
+ }
111
+ // Add custom pipeline stages
112
+ if (customPipeline.length > 0) {
113
+ pipeline.push(...customPipeline);
114
+ }
115
+ // Sort stage
116
+ const sortBy = this.computeSort(sort);
117
+ if (Object.keys(sortBy).length > 0) {
118
+ pipeline.push({ $sort: sortBy });
119
+ }
120
+ // Pagination stages
121
+ if (skip !== undefined) {
122
+ pipeline.push({ $skip: skip || PAGINATION_OPTIONS.skip });
123
+ }
124
+ if (limit !== undefined) {
125
+ pipeline.push({ $limit: limit || PAGINATION_OPTIONS.limit });
126
+ }
127
+ return pipeline;
128
+ }
129
+ /**
130
+ * Execute an aggregation pipeline and transform the results
131
+ */
132
+ async aggregate(pipeline) {
133
+ try {
134
+ const results = await this.model.aggregate(pipeline).exec();
135
+ return this.transformDocuments(results);
136
+ }
137
+ catch (e) {
138
+ this.logger.error(e, 'Error executing aggregation pipeline: %j', pipeline);
139
+ throw e;
140
+ }
141
+ }
110
142
  async count(conditions) {
111
- return this.model.count(conditions).exec();
143
+ return this.model.count(this.mapConditions(conditions)).exec();
112
144
  }
113
145
  async get(conditions, selectedFields) {
114
146
  try {
115
- const response = await this.model.findOne(this.mapConditions(conditions), selectedFields).exec();
116
- return response?.toObject();
147
+ const response = await this.model.findOne(this.mapConditions(conditions), selectedFields).lean().exec();
148
+ if (!response)
149
+ return null;
150
+ // Ensure id exists
151
+ if (response && response._id && !response.id) {
152
+ response.id = response._id.toString();
153
+ }
154
+ return response;
117
155
  }
118
156
  catch (e) {
119
157
  this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', conditions);
120
158
  throw e;
121
159
  }
122
160
  }
123
- async bulkGet(ids) {
161
+ async find(conditions, selectedFields) {
124
162
  try {
125
- const results = await this.model.find().setOptions({ batchSize: 100 }).where('_id').in(ids).exec();
126
- return results.map((i) => i.toObject());
163
+ const response = await this.model.findOne(conditions, selectedFields).lean().exec();
164
+ if (!response)
165
+ return null;
166
+ // Ensure id exists
167
+ if (response && response._id && !response.id) {
168
+ response.id = response._id.toString();
169
+ }
170
+ return response;
127
171
  }
128
172
  catch (e) {
129
- this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', ids);
173
+ this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', conditions);
130
174
  throw e;
131
175
  }
132
176
  }
133
- async find(conditions, selectedFields) {
177
+ async getAll(options) {
178
+ try {
179
+ const { criteria, selectedFields, sort, limit, skip } = options;
180
+ const mappedCriteria = this.mapConditions(criteria);
181
+ const sortBy = this.computeSort(sort);
182
+ const response = await this.model
183
+ .find(mappedCriteria, selectedFields)
184
+ .sort(sortBy)
185
+ .limit(limit || PAGINATION_OPTIONS.limit)
186
+ .skip(skip || PAGINATION_OPTIONS.skip)
187
+ .lean()
188
+ .exec();
189
+ // Ensure id exists for each document
190
+ return response.map((doc) => {
191
+ if (doc._id && !doc.id) {
192
+ doc.id = doc._id.toString();
193
+ }
194
+ return doc;
195
+ });
196
+ }
197
+ catch (e) {
198
+ this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', options);
199
+ throw e;
200
+ }
201
+ }
202
+ /**
203
+ * Get all documents using aggregation pipeline
204
+ */
205
+ async getAllWithPipeline(options, customPipeline = []) {
134
206
  try {
135
- const response = await this.model.findOne(conditions, selectedFields).exec();
136
- return response?.toObject();
207
+ const pipeline = this.preparePipeline(options, customPipeline);
208
+ return this.aggregate(pipeline);
137
209
  }
138
210
  catch (e) {
139
- this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', conditions);
211
+ this.logger.error(e, 'Unable to retrieve Model with pipeline [%j]', customPipeline);
140
212
  throw e;
141
213
  }
142
214
  }
215
+ async getAllWithCount(options) {
216
+ const data = await this.getAll(options);
217
+ const totalCount = await this.count(options.criteria);
218
+ return { totalCount, data };
219
+ }
220
+ /**
221
+ * Get all documents with count using aggregation pipeline
222
+ */
223
+ async getAllWithCountAndPipeline(options, customPipeline = []) {
224
+ // Clone options to avoid modifying the original
225
+ const countOptions = { ...options };
226
+ // Remove pagination for count
227
+ delete countOptions.limit;
228
+ delete countOptions.skip;
229
+ // Prepare count pipeline (without pagination)
230
+ const countPipeline = this.preparePipeline(countOptions, customPipeline);
231
+ countPipeline.push({ $count: 'total' });
232
+ // Execute both queries in parallel
233
+ const [data, countResult] = await Promise.all([
234
+ this.getAllWithPipeline(options, customPipeline),
235
+ this.model.aggregate(countPipeline).exec(),
236
+ ]);
237
+ const totalCount = countResult?.[0]?.total || 0;
238
+ return { data, totalCount };
239
+ }
143
240
  async create(data) {
144
241
  try {
145
- const response = await this.model.create(data);
146
- return response.toObject();
242
+ // Handle custom _id if provided in the data
243
+ const createData = { ...data };
244
+ // If id is provided but _id is not, map id to _id
245
+ if (createData.id && !createData._id) {
246
+ createData._id = Types.ObjectId.isValid(createData.id)
247
+ ? new Types.ObjectId(createData.id)
248
+ : createData.id;
249
+ delete createData.id; // Remove id to avoid conflicts
250
+ }
251
+ const response = await this.model.create(createData);
252
+ return this.transformDocument(response);
147
253
  }
148
254
  catch (e) {
149
- this.logger.error(e, 'Unable to create Model with data ${JSON.stringify(data)} due to error [%s]', e.message);
255
+ this.logger.error(e, 'Unable to create Model with data [%j]', data);
150
256
  throw e;
151
257
  }
152
258
  }
@@ -156,68 +262,76 @@ let BaseRepository = BaseRepository_1 = class BaseRepository {
156
262
  lean: true,
157
263
  ordered: true,
158
264
  });
159
- return response;
265
+ // Ensure id exists for each document
266
+ return response.map((doc) => {
267
+ if (doc._id && !doc.id) {
268
+ doc.id = doc._id.toString();
269
+ }
270
+ return doc;
271
+ });
160
272
  }
161
273
  catch (e) {
162
274
  this.logger.error(e, 'Unable to bulk create due to error [%s]', e.message);
275
+ throw e;
163
276
  }
164
277
  }
165
- async upsert(conditions, update, options) {
278
+ async upsert(conditions, update, options = {}) {
166
279
  return this.update(conditions, update, {
167
280
  upsert: true,
168
281
  ...options,
169
282
  });
170
283
  }
171
- async bulkUpdate(criteria, update, options) {
284
+ async update(criteria, update, options = {}) {
172
285
  try {
173
- const { id, ...rest } = criteria;
174
- const processedCriteria = id ? { _id: id, ...rest } : criteria;
175
- const res = await this.model.updateMany(processedCriteria, update);
176
- if (res) {
177
- const response = await this.model.find(processedCriteria).exec();
178
- return response.map((i) => i?.toObject());
286
+ const mappedCriteria = this.mapConditions(criteria);
287
+ const mergedOptions = {
288
+ new: true,
289
+ useFindAndModify: false,
290
+ ...options,
291
+ };
292
+ const { id } = criteria;
293
+ let response;
294
+ if (id) {
295
+ response = await this.model.findByIdAndUpdate(id, update, mergedOptions).exec();
179
296
  }
180
297
  else {
181
- this.logger.error('Unable to Bulk Update with criteria [%j] and data [%j]', criteria, update);
182
- throw new Error('Unable to do bulk update');
298
+ response = await this.model.findOneAndUpdate(mappedCriteria, update, mergedOptions).exec();
183
299
  }
300
+ return this.transformDocument(response);
184
301
  }
185
302
  catch (e) {
186
- this.logger.error(e, 'Unable to Bulk Update with criteria [%j] and data [%j]', criteria, update);
303
+ this.logger.error(e, 'Unable to Update with criteria [%j] and data [%j]', criteria, update);
187
304
  throw e;
188
305
  }
189
306
  }
190
- async update(criteria, update, options) {
307
+ async bulkUpdate(criteria, update, options = {}) {
191
308
  try {
192
- const { id, ...rest } = criteria;
193
- const processedCriteria = id ? { _id: id, ...rest } : criteria;
194
- const mergedOptions = {
195
- new: true,
196
- useFindAndModify: false,
197
- ...options,
198
- };
199
- if (id) {
200
- return (await this.model
201
- .findByIdAndUpdate(id, update, mergedOptions)
202
- .exec());
203
- }
204
- return (await this.model
205
- .findOneAndUpdate(processedCriteria, update, mergedOptions)
206
- .exec());
309
+ const mappedCriteria = this.mapConditions(criteria);
310
+ await this.model.updateMany(mappedCriteria, update, options);
311
+ // Fetch the updated documents
312
+ const response = await this.model.find(mappedCriteria).lean().exec();
313
+ // Ensure id exists for each document
314
+ return response.map((doc) => {
315
+ if (doc._id && !doc.id) {
316
+ doc.id = doc._id.toString();
317
+ }
318
+ return doc;
319
+ });
207
320
  }
208
321
  catch (e) {
209
- this.logger.error(e, 'Unable to Update with criteria [%j] and data [%j]', criteria, update);
322
+ this.logger.error(e, 'Unable to Bulk Update with criteria [%j] and data [%j]', criteria, update);
210
323
  throw e;
211
324
  }
212
325
  }
213
326
  async delete(criteria) {
214
327
  try {
328
+ const mappedCriteria = this.mapConditions(criteria);
215
329
  let deleted;
216
330
  if (criteria?.id) {
217
331
  deleted = await this.model.findByIdAndDelete(criteria.id);
218
332
  }
219
333
  else {
220
- deleted = await this.model.findOneAndDelete(this.mapConditions(criteria));
334
+ deleted = await this.model.findOneAndDelete(mappedCriteria);
221
335
  }
222
336
  return !!deleted;
223
337
  }
@@ -228,7 +342,8 @@ let BaseRepository = BaseRepository_1 = class BaseRepository {
228
342
  }
229
343
  async bulkDelete(criteria) {
230
344
  try {
231
- const deleted = await this.model.deleteMany(this.mapConditions(criteria));
345
+ const mappedCriteria = this.mapConditions(criteria);
346
+ const deleted = await this.model.deleteMany(mappedCriteria);
232
347
  return deleted?.deletedCount || 0;
233
348
  }
234
349
  catch (e) {
@@ -236,6 +351,33 @@ let BaseRepository = BaseRepository_1 = class BaseRepository {
236
351
  throw e;
237
352
  }
238
353
  }
354
+ async bulkGet(ids, selectedFields) {
355
+ try {
356
+ // Create a query that handles both ObjectId and string IDs
357
+ const query = { _id: { $in: [] } };
358
+ // Process each ID
359
+ ids.forEach((id) => {
360
+ if (Types.ObjectId.isValid(id)) {
361
+ query._id.$in.push(new Types.ObjectId(id));
362
+ }
363
+ else {
364
+ query._id.$in.push(id); // Add as string
365
+ }
366
+ });
367
+ const results = await this.model.find(query).select(selectedFields).lean().exec();
368
+ // Ensure id exists for each document
369
+ return results.map((doc) => {
370
+ if (doc._id && !doc.id) {
371
+ doc.id = doc._id.toString();
372
+ }
373
+ return doc;
374
+ });
375
+ }
376
+ catch (e) {
377
+ this.logger.error(e, 'Unable to retrieve Model with criteria [%j]', ids);
378
+ throw e;
379
+ }
380
+ }
239
381
  };
240
382
  BaseRepository = BaseRepository_1 = __decorate([
241
383
  injectable(),
@@ -1 +1 @@
1
- {"version":3,"file":"base-repository.js","sources":["../../../src/store/repositories/base-repository.ts"],"sourcesContent":[null],"names":[],"mappings":";AAOa,IAAA,cAAc,GAApB,gBAAA,GAAA,MAAM,cAAc,CAA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