rez_core 5.0.208 → 5.0.209
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/dist/module/enterprise/repository/school.repository.js +8 -8
- package/dist/module/enterprise/repository/school.repository.js.map +1 -1
- package/dist/module/meta/service/resolver.service.js +1 -1
- package/dist/module/meta/service/resolver.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/enterprise/repository/school.repository.ts +33 -16
- package/src/module/meta/service/resolver.service.ts +3 -3
- package/.idea/250218_ether_core.iml +0 -12
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
package/package.json
CHANGED
|
@@ -4,8 +4,7 @@ import { ReflectionHelper } from '../../../utils/service/reflection-helper.servi
|
|
|
4
4
|
|
|
5
5
|
@Injectable()
|
|
6
6
|
export class SchoolRepository {
|
|
7
|
-
constructor(private readonly reflectionHelper: ReflectionHelper) {
|
|
8
|
-
}
|
|
7
|
+
constructor(private readonly reflectionHelper: ReflectionHelper) {}
|
|
9
8
|
|
|
10
9
|
async findAllByOrgId(orgId: number): Promise<any[]> {
|
|
11
10
|
const schoolRepo = this.reflectionHelper.getRepoService('SSOSchool');
|
|
@@ -26,11 +25,12 @@ export class SchoolRepository {
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
async getUserContextDropdown(userId: number, appCode: string, org_id) {
|
|
29
|
-
const userRoleRepo =
|
|
28
|
+
const userRoleRepo =
|
|
29
|
+
this.reflectionHelper.getRepoService('UserRoleMapping');
|
|
30
30
|
|
|
31
31
|
const hasOrgAccess = await userRoleRepo
|
|
32
32
|
.createQueryBuilder('urm')
|
|
33
|
-
.where('urm.user_id = :userId', { userId })
|
|
33
|
+
.where('urm.user_id::text = :userId', { userId: String(userId) })
|
|
34
34
|
.andWhere('urm.appcode = :appCode', { appCode })
|
|
35
35
|
.andWhere('urm.level_type = :levelType', { levelType: 'ORG' })
|
|
36
36
|
.getRawMany();
|
|
@@ -40,7 +40,8 @@ export class SchoolRepository {
|
|
|
40
40
|
currentORGLevel_id = org_id;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
const listMasterItemsRepo =
|
|
43
|
+
const listMasterItemsRepo =
|
|
44
|
+
this.reflectionHelper.getRepoService('ListMasterItems');
|
|
44
45
|
const resolvedInactiveStatus = await listMasterItemsRepo.findOne({
|
|
45
46
|
where: {
|
|
46
47
|
code: STATUS_INACTIVE,
|
|
@@ -49,7 +50,8 @@ export class SchoolRepository {
|
|
|
49
50
|
});
|
|
50
51
|
|
|
51
52
|
if (hasOrgAccess.length > 0) {
|
|
52
|
-
const organizationRepo =
|
|
53
|
+
const organizationRepo =
|
|
54
|
+
this.reflectionHelper.getRepoService('OrganizationData');
|
|
53
55
|
|
|
54
56
|
const schools = await organizationRepo
|
|
55
57
|
.createQueryBuilder('org')
|
|
@@ -72,7 +74,7 @@ export class SchoolRepository {
|
|
|
72
74
|
.innerJoin(
|
|
73
75
|
'sso_organization',
|
|
74
76
|
'brn',
|
|
75
|
-
|
|
77
|
+
"brn.type = 'BRN' AND brn.parent_id::varchar = org.id::varchar",
|
|
76
78
|
)
|
|
77
79
|
// JOIN school table
|
|
78
80
|
.innerJoin(
|
|
@@ -161,7 +163,6 @@ export class SchoolRepository {
|
|
|
161
163
|
brands: Object.values(org.brands),
|
|
162
164
|
}));
|
|
163
165
|
} else {
|
|
164
|
-
|
|
165
166
|
const orgResult = await organizationRepo.findOne({
|
|
166
167
|
where: {
|
|
167
168
|
id: currentORGLevel_id,
|
|
@@ -180,8 +181,8 @@ export class SchoolRepository {
|
|
|
180
181
|
];
|
|
181
182
|
}
|
|
182
183
|
} else {
|
|
183
|
-
|
|
184
|
-
|
|
184
|
+
const userRoleMappingRepo =
|
|
185
|
+
this.reflectionHelper.getRepoService('UserRoleMapping');
|
|
185
186
|
|
|
186
187
|
const brnMappings = await userRoleMappingRepo
|
|
187
188
|
.createQueryBuilder('urm')
|
|
@@ -195,9 +196,17 @@ export class SchoolRepository {
|
|
|
195
196
|
'school.location AS school_location',
|
|
196
197
|
'school.status AS school_status',
|
|
197
198
|
])
|
|
198
|
-
.innerJoin(
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
.innerJoin(
|
|
200
|
+
'sso_organization',
|
|
201
|
+
'brand',
|
|
202
|
+
'brand.id::text = urm.level_id::text',
|
|
203
|
+
)
|
|
204
|
+
.innerJoin(
|
|
205
|
+
'sso_school',
|
|
206
|
+
'school',
|
|
207
|
+
'school.brand_id::text = brand.id::text',
|
|
208
|
+
)
|
|
209
|
+
.where('urm.user_id::text = :userId', { userId: String(userId) })
|
|
201
210
|
.andWhere('urm.appcode = :appCode', { appCode })
|
|
202
211
|
.andWhere('urm.level_type = :levelType', { levelType: 'BRN' })
|
|
203
212
|
.distinct(true)
|
|
@@ -215,9 +224,17 @@ export class SchoolRepository {
|
|
|
215
224
|
'school.location AS school_location',
|
|
216
225
|
'school.status AS school_status',
|
|
217
226
|
])
|
|
218
|
-
.innerJoin(
|
|
219
|
-
|
|
220
|
-
|
|
227
|
+
.innerJoin(
|
|
228
|
+
'sso_school',
|
|
229
|
+
'school',
|
|
230
|
+
'school.id::text = urm.level_id::text',
|
|
231
|
+
)
|
|
232
|
+
.innerJoin(
|
|
233
|
+
'sso_organization',
|
|
234
|
+
'brand',
|
|
235
|
+
'brand.id::text = school.brand_id::text',
|
|
236
|
+
)
|
|
237
|
+
.where('urm.user_id::text = :userId', { userId: String(userId) })
|
|
221
238
|
.andWhere('urm.appcode = :appCode', { appCode })
|
|
222
239
|
.andWhere('urm.level_type = :levelType', { levelType: 'SCH' })
|
|
223
240
|
.distinct(true)
|
|
@@ -111,8 +111,9 @@ export class ResolverService {
|
|
|
111
111
|
attr.element_type === 'date' ||
|
|
112
112
|
attr.element_type === 'datetime'
|
|
113
113
|
) {
|
|
114
|
-
const dateFormat =
|
|
115
|
-
|
|
114
|
+
const dateFormat =
|
|
115
|
+
attr.element_type === 'date' ? 'DD-MM-YYYY' : 'DD-MM-YYYY HH:mm:ss';
|
|
116
|
+
const dateValue = moment(codeValue, dateFormat).utcOffset('+05:30'); // IST
|
|
116
117
|
if (dateValue.isValid()) {
|
|
117
118
|
resolvedEntityData[field] =
|
|
118
119
|
attr.element_type === 'date'
|
|
@@ -239,7 +240,6 @@ export class ResolverService {
|
|
|
239
240
|
return rawValue;
|
|
240
241
|
}
|
|
241
242
|
|
|
242
|
-
|
|
243
243
|
async getResolvedId(
|
|
244
244
|
loggedInUser: UserData,
|
|
245
245
|
attrKey: string,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$">
|
|
5
|
-
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
6
|
-
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
7
|
-
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
-
</content>
|
|
9
|
-
<orderEntry type="inheritedJdk" />
|
|
10
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
-
</component>
|
|
12
|
-
</module>
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
<component name="ProjectCodeStyleConfiguration">
|
|
2
|
-
<code_scheme name="Project" version="173">
|
|
3
|
-
<HTMLCodeStyleSettings>
|
|
4
|
-
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
|
|
5
|
-
</HTMLCodeStyleSettings>
|
|
6
|
-
<JSCodeStyleSettings version="0">
|
|
7
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
8
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
9
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
10
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
11
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
12
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
13
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
14
|
-
</JSCodeStyleSettings>
|
|
15
|
-
<TypeScriptCodeStyleSettings version="0">
|
|
16
|
-
<option name="FORCE_SEMICOLON_STYLE" value="true" />
|
|
17
|
-
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
|
|
18
|
-
<option name="USE_DOUBLE_QUOTES" value="false" />
|
|
19
|
-
<option name="FORCE_QUOTE_STYlE" value="true" />
|
|
20
|
-
<option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
|
|
21
|
-
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
|
|
22
|
-
<option name="SPACES_WITHIN_IMPORTS" value="true" />
|
|
23
|
-
</TypeScriptCodeStyleSettings>
|
|
24
|
-
<VueCodeStyleSettings>
|
|
25
|
-
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
|
|
26
|
-
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
|
|
27
|
-
</VueCodeStyleSettings>
|
|
28
|
-
<codeStyleSettings language="HTML">
|
|
29
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
30
|
-
<indentOptions>
|
|
31
|
-
<option name="INDENT_SIZE" value="2" />
|
|
32
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
33
|
-
<option name="TAB_SIZE" value="2" />
|
|
34
|
-
</indentOptions>
|
|
35
|
-
</codeStyleSettings>
|
|
36
|
-
<codeStyleSettings language="JavaScript">
|
|
37
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
38
|
-
<indentOptions>
|
|
39
|
-
<option name="INDENT_SIZE" value="2" />
|
|
40
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
41
|
-
<option name="TAB_SIZE" value="2" />
|
|
42
|
-
</indentOptions>
|
|
43
|
-
</codeStyleSettings>
|
|
44
|
-
<codeStyleSettings language="TypeScript">
|
|
45
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
46
|
-
<indentOptions>
|
|
47
|
-
<option name="INDENT_SIZE" value="2" />
|
|
48
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
49
|
-
<option name="TAB_SIZE" value="2" />
|
|
50
|
-
</indentOptions>
|
|
51
|
-
</codeStyleSettings>
|
|
52
|
-
<codeStyleSettings language="Vue">
|
|
53
|
-
<option name="SOFT_MARGINS" value="80" />
|
|
54
|
-
<indentOptions>
|
|
55
|
-
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
56
|
-
</indentOptions>
|
|
57
|
-
</codeStyleSettings>
|
|
58
|
-
</code_scheme>
|
|
59
|
-
</component>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/250218_ether_core.iml" filepath="$PROJECT_DIR$/.idea/250218_ether_core.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|