rez_core 2.0.44 → 2.0.45

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.44",
3
+ "version": "2.0.45",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -8,4 +8,7 @@ export class SchoolData extends BaseEntity {
8
8
 
9
9
  @Column({ name: 'brand_code', nullable: true })
10
10
  brand_code: string;
11
+
12
+ @Column({ name: 'location', nullable: true })
13
+ location: string;
11
14
  }
@@ -43,10 +43,12 @@ export class SchoolRepository {
43
43
  .select([
44
44
  'org.id AS org_id',
45
45
  'org.name AS org_name',
46
+ 'org.address AS org_address',
46
47
  'br.id AS brand_id',
47
48
  'br.name AS brand_name',
48
49
  'sch.id AS school_id',
49
50
  'sch.name AS school_name',
51
+ 'sch.location AS school_location',
50
52
  ])
51
53
  .from('cr_school', 'sch')
52
54
  .innerJoin('cr_brand', 'br', 'sch.brand_id = br.id')
@@ -59,16 +61,19 @@ export class SchoolRepository {
59
61
  const {
60
62
  org_id,
61
63
  org_name,
64
+ org_address,
62
65
  brand_id,
63
66
  brand_name,
64
67
  school_id,
65
68
  school_name,
69
+ school_location,
66
70
  } = row;
67
71
 
68
72
  if (!result[org_id]) {
69
73
  result[org_id] = {
70
74
  org_id,
71
75
  org_name,
76
+ org_address,
72
77
  brands: {},
73
78
  };
74
79
  }
@@ -82,6 +87,7 @@ export class SchoolRepository {
82
87
  result[org_id].brands[brand_id].schools.push({
83
88
  school_id,
84
89
  school_name,
90
+ school_location,
85
91
  });
86
92
  }
87
93
 
@@ -98,6 +104,7 @@ export class SchoolRepository {
98
104
  'brand.name AS brand_name',
99
105
  'school.id AS school_id',
100
106
  'school.name AS school_name',
107
+ 'school.location AS school_location',
101
108
  ])
102
109
  .from('cr_user_role_mapping', 'urm')
103
110
  .innerJoin('cr_brand', 'brand', 'brand.id = urm.level_id')
@@ -130,7 +137,13 @@ export class SchoolRepository {
130
137
  // 4. Group by brand
131
138
  const result = {};
132
139
  for (const row of allMappings) {
133
- const { brand_id, brand_name, school_id, school_name } = row;
140
+ const {
141
+ brand_id,
142
+ brand_name,
143
+ school_id,
144
+ school_name,
145
+ school_location,
146
+ } = row;
134
147
 
135
148
  if (!result[brand_id]) {
136
149
  result[brand_id] = {
@@ -145,7 +158,11 @@ export class SchoolRepository {
145
158
  school_id &&
146
159
  !result[brand_id].schools.some((s) => s.school_id === school_id)
147
160
  ) {
148
- result[brand_id].schools.push({ school_id, school_name });
161
+ result[brand_id].schools.push({
162
+ school_id,
163
+ school_name,
164
+ school_location,
165
+ });
149
166
  }
150
167
  }
151
168
 
@@ -25,4 +25,7 @@ export class AppMaster extends BaseEntity {
25
25
 
26
26
  @Column({ name: 'backgroudColor', type: 'varchar', nullable: true })
27
27
  backgroudColor: string;
28
+
29
+ @Column({ name: 'iconName', type: 'varchar', nullable: true })
30
+ iconName: string;
28
31
  }
@@ -13,22 +13,25 @@ export class AppMasterService {
13
13
  const app_code =
14
14
  await this.userRoleMappingRepository.findDistinctAppcodeByUserId(userId);
15
15
 
16
- const result: Record<string, any> = {};
16
+ const finalResult: any[] = [];
17
17
 
18
18
  if (app_code.appcode.length > 0) {
19
19
  const resolvedData = await Promise.all(
20
20
  app_code.appcode.map(async (element) => {
21
21
  const data =
22
22
  await this.appMasterRepository.getAppMasterDataByAppCode(element);
23
- return { [element]: data };
23
+ return data || [];
24
24
  }),
25
25
  );
26
26
 
27
- resolvedData.forEach((entry) => {
28
- Object.assign(result, entry);
27
+ resolvedData.flat().forEach((item) => {
28
+ finalResult.push({
29
+ key: item.name,
30
+ details: item,
31
+ });
29
32
  });
30
33
  }
31
34
 
32
- return result;
35
+ return finalResult;
33
36
  }
34
37
  }