rez_core 2.1.57 → 2.1.59

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.1.57",
3
+ "version": "2.1.59",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -49,10 +49,7 @@ export class FilterController {
49
49
  sortby,
50
50
  page,
51
51
  size,
52
- user_id: userData.id,
53
- level_type: userData.level_type,
54
- level_id: userData.level_id,
55
- appcode: userData.appcode,
52
+ loggedInUser: userData,
56
53
  });
57
54
  }
58
55
 
@@ -23,8 +23,11 @@ export interface FilterRequestDto {
23
23
  tabs?: TabsConfig;
24
24
  page?: number;
25
25
  size?: number;
26
- user_id?: string | null;
27
- level_type?: string | null;
28
- level_id?: string | null;
29
- appcode?: string | null;
26
+ loggedInUser?: {
27
+ id: string;
28
+ level_type: string;
29
+ level_id: string;
30
+ appcode: string;
31
+ organization_id?: number; // Optional, if applicable
32
+ };
30
33
  }
@@ -20,7 +20,8 @@ export class FilterService {
20
20
  @Inject('SavedFilterService')
21
21
  private readonly savedFilterService: SavedFilterService,
22
22
  ) {}
23
- private readonly skipLevelFilterEntities = ['ROL'];
23
+ private readonly skipAppCodeFilterEntities = ['ORGP'];
24
+ private readonly skipOrgFilterEntities = ['ORGP'];
24
25
 
25
26
  private async gettab_value_counts(
26
27
  tableName: string,
@@ -78,11 +79,16 @@ export class FilterService {
78
79
  attributeFilter,
79
80
  tabs,
80
81
  sortby,
81
- user_id,
82
+ loggedInUser,
83
+ } = dto;
84
+
85
+ const {
82
86
  level_type,
83
87
  level_id,
88
+ id: user_id,
84
89
  appcode,
85
- } = dto;
90
+ organization_id,
91
+ } = loggedInUser || {};
86
92
 
87
93
  // Fetch meta
88
94
  const entityMeta = await this.entityTableService.getEntityData(entity_type);
@@ -133,23 +139,28 @@ export class FilterService {
133
139
  const baseWhere = this.buildWhereClauses(baseFilters, attributeMetaMap);
134
140
 
135
141
  // check level_id and level_type
136
- if (level_type && level_id) {
142
+ if (entity_type != 'ORGP' && level_type && level_id && organization_id) {
137
143
  baseWhere.push({
138
- query: 'e.level_type = :level_type AND e.level_id = :level_id',
144
+ query:
145
+ 'e.organization_id = :organization_id AND e.level_type = :level_type AND e.level_id = :level_id',
139
146
  params: {
147
+ organization_id,
140
148
  level_type,
141
149
  level_id,
142
150
  },
143
151
  });
144
152
  }
145
153
 
146
- if (this.skipLevelFilterEntities.includes(entity_type)) {
147
- baseWhere.push({
148
- query: 'e.appcode = :appcode',
149
- params: { appcode },
150
- });
154
+ if (user_id === '1') {
151
155
  }
152
156
 
157
+ // if (!this.skipAppCodeFilterEntities.includes(entity_type)) {
158
+ // baseWhere.push({
159
+ // query: 'e.appcode = :appcode',
160
+ // params: { appcode },
161
+ // });
162
+ // }
163
+
153
164
  // layout preference query
154
165
  const layoutPreference = await this.dataSource.query(
155
166
  `SELECT layout_json
@@ -25,7 +25,7 @@ export class ListMasterItemsRepository {
25
25
  where: { listtype: type, status: 'active' },
26
26
  order: { sortindex: 'ASC' },
27
27
  });
28
- return items.map((i) => ({ label: i.name, value: i.value }));
28
+ return items.map((i) => ({ label: i.name, value: i.id }));
29
29
  }
30
30
 
31
31
  async findAllItemsByListType(