rez_core 2.0.71 → 2.0.73

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.0.71",
3
+ "version": "2.0.73",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -352,11 +352,26 @@ export class FilterService {
352
352
  return { query: `e.${attr} < :${key}`, params: { [key]: val } };
353
353
  case 'after':
354
354
  return { query: `e.${attr} > :${key}`, params: { [key]: val } };
355
+ case 'between': {
356
+ if (typeof val === 'string') {
357
+ val = val.split(',').map((v) => v.trim());
358
+ }
359
+ if (!Array.isArray(val) || val.length !== 2) {
360
+ throw new BadRequestException(`Invalid value for in_between: ${val}`);
361
+ }
362
+ return {
363
+ query: `e.${attr} BETWEEN :${key}_start AND :${key}_end`,
364
+ params: {
365
+ [`${key}_start`]: val[0],
366
+ [`${key}_end`]: val[1],
367
+ },
368
+ };
369
+ }
355
370
  default:
356
371
  throw new BadRequestException(`Unsupported operator for date: ${op}`);
357
372
  }
358
373
  }
359
-
374
+
360
375
  private buildSelectCondition(
361
376
  attr: string,
362
377
  op: string,
@@ -14,7 +14,7 @@ export class SavedFilterService extends EntityServiceImpl {
14
14
  }
15
15
 
16
16
  async createEntity(
17
- entityData: BaseEntity,
17
+ entityData: any,
18
18
  loggedInUser: UserData | null,
19
19
  ): Promise<BaseEntity> {
20
20
  const master = entityData as SavedFilterMaster;
@@ -29,6 +29,7 @@ export class SavedFilterService extends EntityServiceImpl {
29
29
  throw new BadRequestException('Saved filter name already exists.');
30
30
  }
31
31
 
32
+ entityData.user_id = loggedInUser?.id ?? null;
32
33
  // Save the master record without code
33
34
  const savedMaster = await super.createEntity(master, loggedInUser);
34
35
 
@@ -36,6 +36,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
36
36
  manager?: EntityManager | null,
37
37
  appcode?: string,
38
38
  ) {
39
+
39
40
  if (!entityData.entity_type) {
40
41
  throw new BadRequestException(`EntityType is missing`);
41
42
  }