rez_core 1.0.16 → 1.0.18
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/.env +3 -1
- package/.idea/250218_nodejs_core.iml +12 -0
- package/.idea/codeStyles/Project.xml +59 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/dataSources.xml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/vcs.xml +6 -0
- package/dist/module/auth/guards/role.guard.js +3 -3
- package/dist/module/master/controller/master.controller.js +1 -1
- package/dist/module/master/controller/master.controller.js.map +1 -1
- package/dist/module/meta/controller/entity.controller.js +1 -1
- package/dist/module/meta/controller/entity.controller.js.map +1 -1
- package/dist/module/module/controller/menu.controller.js +1 -1
- package/dist/module/module/controller/menu.controller.js.map +1 -1
- package/dist/module/module/controller/module-access.controller.js +1 -1
- package/dist/module/module/controller/module-access.controller.js.map +1 -1
- package/dist/module/notification/controller/otp.controller.js +1 -1
- package/dist/module/notification/controller/otp.controller.js.map +1 -1
- package/dist/module/notification/service/otp.service.d.ts +2 -0
- package/dist/module/notification/service/otp.service.js +3 -1
- package/dist/module/notification/service/otp.service.js.map +1 -1
- package/dist/module/user/controller/login.controller.js +1 -1
- package/dist/module/user/controller/login.controller.js.map +1 -1
- package/dist/module/user/controller/user.controller.js +1 -1
- package/dist/module/user/controller/user.controller.js.map +1 -1
- package/dist/module/user/service/user.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/auth/guards/jwt.guard.ts +22 -22
- package/src/module/auth/guards/role.guard.ts +68 -68
- package/src/module/auth/services/auth.service.ts +29 -29
- package/src/module/auth/services/jwt.service.ts +11 -11
- package/src/module/auth/strategies/google.strategy.ts +29 -29
- package/src/module/auth/strategies/local.strategy.ts +13 -13
- package/src/module/dev/dev.module.ts +12 -12
- package/src/module/dev/service/dev.service.ts +7 -7
- package/src/module/enterprise/entity/enterprise.entity.ts +37 -37
- package/src/module/enterprise/entity/organization.entity.ts +80 -80
- package/src/module/master/controller/master.controller.ts +22 -22
- package/src/module/meta/controller/entity.controller.ts +1 -1
- package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
- package/src/module/meta/entity/attribute-master.entity.ts +67 -67
- package/src/module/meta/entity/entity-master.entity.ts +61 -61
- package/src/module/meta/entity/preference.entity.ts +65 -65
- package/src/module/meta/repository/attribute-master.repository.ts +28 -28
- package/src/module/meta/repository/preference.repository.ts +20 -20
- package/src/module/meta/service/entity-master.service.ts +26 -26
- package/src/module/module/controller/menu.controller.ts +15 -15
- package/src/module/module/controller/module-access.controller.ts +1 -1
- package/src/module/module/entity/module-access.entity.ts +22 -22
- package/src/module/module/entity/module-action.entity.ts +19 -19
- package/src/module/notification/controller/otp.controller.ts +1 -1
- package/src/module/notification/service/otp.service.ts +4 -1
- package/src/module/user/controller/login.controller.ts +1 -1
- package/src/module/user/controller/user.controller.ts +28 -28
- package/src/module/user/dto/update-user.dto.ts +4 -4
- package/src/module/user/entity/user-role-mapping.entity.ts +21 -21
- package/src/module/user/entity/user-session.entity.ts +61 -61
- package/src/module/user/entity/user.entity.ts +35 -35
- package/src/module/user/repository/role.repository.ts +16 -16
- package/src/module/user/repository/userSession.repository.ts +33 -33
- package/src/module/user/service/user.service.ts +1 -4
- package/src/utils/service/encryptUtil.service.ts +97 -97
- package/src/utils/service/excelUtil.service.ts +15 -15
- package/src/utils/service/reflection-helper.service.ts +53 -53
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Controller,
|
|
3
|
-
Post,
|
|
4
|
-
UploadedFile,
|
|
5
|
-
UseInterceptors,
|
|
6
|
-
} from '@nestjs/common';
|
|
7
|
-
import { FileInterceptor } from '@nestjs/platform-express';
|
|
8
|
-
import { MasterService } from '../service/master.service';
|
|
9
|
-
|
|
10
|
-
@Controller('
|
|
11
|
-
export class MasterController {
|
|
12
|
-
constructor(private readonly masterService: MasterService) {}
|
|
13
|
-
|
|
14
|
-
@Post('upload')
|
|
15
|
-
@UseInterceptors(FileInterceptor('file'))
|
|
16
|
-
async uploadFile(@UploadedFile() file) {
|
|
17
|
-
if (!file) {
|
|
18
|
-
throw new Error('File is required');
|
|
19
|
-
}
|
|
20
|
-
return this.masterService.processExcel(file);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Controller,
|
|
3
|
+
Post,
|
|
4
|
+
UploadedFile,
|
|
5
|
+
UseInterceptors,
|
|
6
|
+
} from '@nestjs/common';
|
|
7
|
+
import { FileInterceptor } from '@nestjs/platform-express';
|
|
8
|
+
import { MasterService } from '../service/master.service';
|
|
9
|
+
|
|
10
|
+
@Controller('master')
|
|
11
|
+
export class MasterController {
|
|
12
|
+
constructor(private readonly masterService: MasterService) {}
|
|
13
|
+
|
|
14
|
+
@Post('upload')
|
|
15
|
+
@UseInterceptors(FileInterceptor('file'))
|
|
16
|
+
async uploadFile(@UploadedFile() file) {
|
|
17
|
+
if (!file) {
|
|
18
|
+
throw new Error('File is required');
|
|
19
|
+
}
|
|
20
|
+
return this.masterService.processExcel(file);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { EntityTab } from './entity-tab.dto';
|
|
2
|
-
|
|
3
|
-
export class EntityListData {
|
|
4
|
-
entity_list: any;
|
|
5
|
-
entity_tabs: EntityTab[];
|
|
6
|
-
}
|
|
1
|
+
import { EntityTab } from './entity-tab.dto';
|
|
2
|
+
|
|
3
|
+
export class EntityListData {
|
|
4
|
+
entity_list: any;
|
|
5
|
+
entity_tabs: EntityTab[];
|
|
6
|
+
}
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { BaseEntity } from './base-entity.entity';
|
|
2
|
-
import { Column, Entity } from 'typeorm';
|
|
3
|
-
|
|
4
|
-
@Entity({ name: 'cr_attribute_master' })
|
|
5
|
-
export class AttributeMaster extends BaseEntity {
|
|
6
|
-
@Column({ name: 'mapped_entity_type', type: 'varchar', nullable: true })
|
|
7
|
-
mapped_entity_type: string;
|
|
8
|
-
|
|
9
|
-
@Column({ name: 'mapped_entity_id' })
|
|
10
|
-
mapped_entity_id: number;
|
|
11
|
-
|
|
12
|
-
@Column({ name: 'element_type', type: 'varchar', nullable: true, length: 50 })
|
|
13
|
-
element_type: string;
|
|
14
|
-
|
|
15
|
-
@Column({
|
|
16
|
-
name: 'data_source_type',
|
|
17
|
-
type: 'varchar',
|
|
18
|
-
nullable: true,
|
|
19
|
-
length: 50,
|
|
20
|
-
})
|
|
21
|
-
data_source_type: string;
|
|
22
|
-
|
|
23
|
-
@Column({ name: 'datasource_list', type: 'varchar', nullable: true })
|
|
24
|
-
datasource_list: string;
|
|
25
|
-
|
|
26
|
-
@Column({
|
|
27
|
-
name: 'custom_values',
|
|
28
|
-
type: 'varchar',
|
|
29
|
-
length: 2000,
|
|
30
|
-
nullable: true,
|
|
31
|
-
})
|
|
32
|
-
custom_values: string;
|
|
33
|
-
|
|
34
|
-
@Column({ name: 'max_length', nullable: true })
|
|
35
|
-
max_length: number;
|
|
36
|
-
|
|
37
|
-
@Column({ name: 'required', nullable: true })
|
|
38
|
-
required: number;
|
|
39
|
-
|
|
40
|
-
@Column({
|
|
41
|
-
name: 'description',
|
|
42
|
-
type: 'varchar',
|
|
43
|
-
length: 2000,
|
|
44
|
-
nullable: true,
|
|
45
|
-
})
|
|
46
|
-
description: string;
|
|
47
|
-
|
|
48
|
-
@Column({
|
|
49
|
-
name: 'attribute_key',
|
|
50
|
-
type: 'varchar',
|
|
51
|
-
nullable: true,
|
|
52
|
-
length: 50,
|
|
53
|
-
})
|
|
54
|
-
attribute_key: string;
|
|
55
|
-
|
|
56
|
-
@Column({ name: 'db_datatype', type: 'varchar', nullable: true, length: 50 })
|
|
57
|
-
db_datatype: string;
|
|
58
|
-
|
|
59
|
-
@Column({ name: 'category', type: 'varchar', nullable: true, length: 50 })
|
|
60
|
-
category: string;
|
|
61
|
-
|
|
62
|
-
@Column({ name: 'is_unique', nullable: true })
|
|
63
|
-
is_unique: number;
|
|
64
|
-
|
|
65
|
-
@Column({ name: 'can_export', nullable: true })
|
|
66
|
-
can_export: number;
|
|
67
|
-
}
|
|
1
|
+
import { BaseEntity } from './base-entity.entity';
|
|
2
|
+
import { Column, Entity } from 'typeorm';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'cr_attribute_master' })
|
|
5
|
+
export class AttributeMaster extends BaseEntity {
|
|
6
|
+
@Column({ name: 'mapped_entity_type', type: 'varchar', nullable: true })
|
|
7
|
+
mapped_entity_type: string;
|
|
8
|
+
|
|
9
|
+
@Column({ name: 'mapped_entity_id' })
|
|
10
|
+
mapped_entity_id: number;
|
|
11
|
+
|
|
12
|
+
@Column({ name: 'element_type', type: 'varchar', nullable: true, length: 50 })
|
|
13
|
+
element_type: string;
|
|
14
|
+
|
|
15
|
+
@Column({
|
|
16
|
+
name: 'data_source_type',
|
|
17
|
+
type: 'varchar',
|
|
18
|
+
nullable: true,
|
|
19
|
+
length: 50,
|
|
20
|
+
})
|
|
21
|
+
data_source_type: string;
|
|
22
|
+
|
|
23
|
+
@Column({ name: 'datasource_list', type: 'varchar', nullable: true })
|
|
24
|
+
datasource_list: string;
|
|
25
|
+
|
|
26
|
+
@Column({
|
|
27
|
+
name: 'custom_values',
|
|
28
|
+
type: 'varchar',
|
|
29
|
+
length: 2000,
|
|
30
|
+
nullable: true,
|
|
31
|
+
})
|
|
32
|
+
custom_values: string;
|
|
33
|
+
|
|
34
|
+
@Column({ name: 'max_length', nullable: true })
|
|
35
|
+
max_length: number;
|
|
36
|
+
|
|
37
|
+
@Column({ name: 'required', nullable: true })
|
|
38
|
+
required: number;
|
|
39
|
+
|
|
40
|
+
@Column({
|
|
41
|
+
name: 'description',
|
|
42
|
+
type: 'varchar',
|
|
43
|
+
length: 2000,
|
|
44
|
+
nullable: true,
|
|
45
|
+
})
|
|
46
|
+
description: string;
|
|
47
|
+
|
|
48
|
+
@Column({
|
|
49
|
+
name: 'attribute_key',
|
|
50
|
+
type: 'varchar',
|
|
51
|
+
nullable: true,
|
|
52
|
+
length: 50,
|
|
53
|
+
})
|
|
54
|
+
attribute_key: string;
|
|
55
|
+
|
|
56
|
+
@Column({ name: 'db_datatype', type: 'varchar', nullable: true, length: 50 })
|
|
57
|
+
db_datatype: string;
|
|
58
|
+
|
|
59
|
+
@Column({ name: 'category', type: 'varchar', nullable: true, length: 50 })
|
|
60
|
+
category: string;
|
|
61
|
+
|
|
62
|
+
@Column({ name: 'is_unique', nullable: true })
|
|
63
|
+
is_unique: number;
|
|
64
|
+
|
|
65
|
+
@Column({ name: 'can_export', nullable: true })
|
|
66
|
+
can_export: number;
|
|
67
|
+
}
|
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
import { BaseEntity } from './base-entity.entity';
|
|
2
|
-
import { ENTITYTYPE_ENTITYMASTER } from '../../../constant/global.constant';
|
|
3
|
-
import { Column, Entity } from 'typeorm';
|
|
4
|
-
|
|
5
|
-
@Entity({ name: 'cr_entity_master' })
|
|
6
|
-
export class EntityMaster extends BaseEntity {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.entity_type = ENTITYTYPE_ENTITYMASTER;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@Column({
|
|
13
|
-
name: 'mapped_entity_type',
|
|
14
|
-
type: 'varchar',
|
|
15
|
-
length: 50,
|
|
16
|
-
nullable: false,
|
|
17
|
-
})
|
|
18
|
-
@Column({ name: 'mapped_entity_type', nullable: true })
|
|
19
|
-
mappedEntityType: string;
|
|
20
|
-
|
|
21
|
-
@Column({ name: 'appcode', type: 'varchar', length: 50, nullable: true })
|
|
22
|
-
appCode: string;
|
|
23
|
-
|
|
24
|
-
@Column({ name: 'category', type: 'varchar', length: 50, nullable: true })
|
|
25
|
-
category: string;
|
|
26
|
-
|
|
27
|
-
@Column({ name: 'module', type: 'varchar', length: 200, nullable: true })
|
|
28
|
-
module: string;
|
|
29
|
-
|
|
30
|
-
@Column({
|
|
31
|
-
name: 'entity_data_class',
|
|
32
|
-
type: 'varchar',
|
|
33
|
-
length: 200,
|
|
34
|
-
nullable: true,
|
|
35
|
-
})
|
|
36
|
-
entityDataClass: string;
|
|
37
|
-
|
|
38
|
-
@Column({
|
|
39
|
-
name: 'entity_service',
|
|
40
|
-
type: 'varchar',
|
|
41
|
-
length: 200,
|
|
42
|
-
nullable: true,
|
|
43
|
-
})
|
|
44
|
-
entityService: string;
|
|
45
|
-
|
|
46
|
-
@Column({
|
|
47
|
-
name: 'db_table_name',
|
|
48
|
-
type: 'varchar',
|
|
49
|
-
length: 200,
|
|
50
|
-
nullable: true,
|
|
51
|
-
})
|
|
52
|
-
dbTableName: string;
|
|
53
|
-
|
|
54
|
-
@Column({
|
|
55
|
-
name: 'description',
|
|
56
|
-
type: 'varchar',
|
|
57
|
-
length: 200,
|
|
58
|
-
nullable: true,
|
|
59
|
-
})
|
|
60
|
-
description: string;
|
|
61
|
-
}
|
|
1
|
+
import { BaseEntity } from './base-entity.entity';
|
|
2
|
+
import { ENTITYTYPE_ENTITYMASTER } from '../../../constant/global.constant';
|
|
3
|
+
import { Column, Entity } from 'typeorm';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'cr_entity_master' })
|
|
6
|
+
export class EntityMaster extends BaseEntity {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.entity_type = ENTITYTYPE_ENTITYMASTER;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Column({
|
|
13
|
+
name: 'mapped_entity_type',
|
|
14
|
+
type: 'varchar',
|
|
15
|
+
length: 50,
|
|
16
|
+
nullable: false,
|
|
17
|
+
})
|
|
18
|
+
@Column({ name: 'mapped_entity_type', nullable: true })
|
|
19
|
+
mappedEntityType: string;
|
|
20
|
+
|
|
21
|
+
@Column({ name: 'appcode', type: 'varchar', length: 50, nullable: true })
|
|
22
|
+
appCode: string;
|
|
23
|
+
|
|
24
|
+
@Column({ name: 'category', type: 'varchar', length: 50, nullable: true })
|
|
25
|
+
category: string;
|
|
26
|
+
|
|
27
|
+
@Column({ name: 'module', type: 'varchar', length: 200, nullable: true })
|
|
28
|
+
module: string;
|
|
29
|
+
|
|
30
|
+
@Column({
|
|
31
|
+
name: 'entity_data_class',
|
|
32
|
+
type: 'varchar',
|
|
33
|
+
length: 200,
|
|
34
|
+
nullable: true,
|
|
35
|
+
})
|
|
36
|
+
entityDataClass: string;
|
|
37
|
+
|
|
38
|
+
@Column({
|
|
39
|
+
name: 'entity_service',
|
|
40
|
+
type: 'varchar',
|
|
41
|
+
length: 200,
|
|
42
|
+
nullable: true,
|
|
43
|
+
})
|
|
44
|
+
entityService: string;
|
|
45
|
+
|
|
46
|
+
@Column({
|
|
47
|
+
name: 'db_table_name',
|
|
48
|
+
type: 'varchar',
|
|
49
|
+
length: 200,
|
|
50
|
+
nullable: true,
|
|
51
|
+
})
|
|
52
|
+
dbTableName: string;
|
|
53
|
+
|
|
54
|
+
@Column({
|
|
55
|
+
name: 'description',
|
|
56
|
+
type: 'varchar',
|
|
57
|
+
length: 200,
|
|
58
|
+
nullable: true,
|
|
59
|
+
})
|
|
60
|
+
description: string;
|
|
61
|
+
}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { BaseEntity } from './base-entity.entity';
|
|
2
|
-
import { Column, Entity } from 'typeorm';
|
|
3
|
-
import { ENTITYTYPE_PREFERENCEMASTER } from '../../../constant/global.constant';
|
|
4
|
-
|
|
5
|
-
@Entity({ name: 'cr_preference_master' })
|
|
6
|
-
export class PreferenceMaster extends BaseEntity {
|
|
7
|
-
constructor() {
|
|
8
|
-
super();
|
|
9
|
-
this.entity_type = ENTITYTYPE_PREFERENCEMASTER;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@Column({ name: 'appcode', type: 'varchar', length: 200, nullable: true })
|
|
13
|
-
appCode: string;
|
|
14
|
-
|
|
15
|
-
@Column({
|
|
16
|
-
name: 'display_name',
|
|
17
|
-
type: 'varchar',
|
|
18
|
-
length: 200,
|
|
19
|
-
nullable: true,
|
|
20
|
-
})
|
|
21
|
-
display_name: string;
|
|
22
|
-
|
|
23
|
-
@Column({
|
|
24
|
-
name: 'preference_key',
|
|
25
|
-
type: 'varchar',
|
|
26
|
-
length: 200,
|
|
27
|
-
nullable: true,
|
|
28
|
-
})
|
|
29
|
-
preference_key: string;
|
|
30
|
-
|
|
31
|
-
@Column({
|
|
32
|
-
name: 'preference_value',
|
|
33
|
-
type: 'varchar',
|
|
34
|
-
length: 200,
|
|
35
|
-
nullable: true,
|
|
36
|
-
})
|
|
37
|
-
preference_value: string;
|
|
38
|
-
|
|
39
|
-
@Column({
|
|
40
|
-
name: 'description',
|
|
41
|
-
type: 'varchar',
|
|
42
|
-
length: 2000,
|
|
43
|
-
nullable: true,
|
|
44
|
-
})
|
|
45
|
-
description: string;
|
|
46
|
-
|
|
47
|
-
@Column({ name: 'reflect_on', type: 'varchar', length: 200, nullable: true })
|
|
48
|
-
reflect_on: string;
|
|
49
|
-
|
|
50
|
-
@Column({
|
|
51
|
-
name: 'default_value',
|
|
52
|
-
type: 'varchar',
|
|
53
|
-
length: 200,
|
|
54
|
-
nullable: true,
|
|
55
|
-
})
|
|
56
|
-
default_value: string;
|
|
57
|
-
|
|
58
|
-
@Column({
|
|
59
|
-
name: 'possible_values',
|
|
60
|
-
type: 'varchar',
|
|
61
|
-
length: 200,
|
|
62
|
-
nullable: true,
|
|
63
|
-
})
|
|
64
|
-
possible_values: string;
|
|
65
|
-
}
|
|
1
|
+
import { BaseEntity } from './base-entity.entity';
|
|
2
|
+
import { Column, Entity } from 'typeorm';
|
|
3
|
+
import { ENTITYTYPE_PREFERENCEMASTER } from '../../../constant/global.constant';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'cr_preference_master' })
|
|
6
|
+
export class PreferenceMaster extends BaseEntity {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.entity_type = ENTITYTYPE_PREFERENCEMASTER;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Column({ name: 'appcode', type: 'varchar', length: 200, nullable: true })
|
|
13
|
+
appCode: string;
|
|
14
|
+
|
|
15
|
+
@Column({
|
|
16
|
+
name: 'display_name',
|
|
17
|
+
type: 'varchar',
|
|
18
|
+
length: 200,
|
|
19
|
+
nullable: true,
|
|
20
|
+
})
|
|
21
|
+
display_name: string;
|
|
22
|
+
|
|
23
|
+
@Column({
|
|
24
|
+
name: 'preference_key',
|
|
25
|
+
type: 'varchar',
|
|
26
|
+
length: 200,
|
|
27
|
+
nullable: true,
|
|
28
|
+
})
|
|
29
|
+
preference_key: string;
|
|
30
|
+
|
|
31
|
+
@Column({
|
|
32
|
+
name: 'preference_value',
|
|
33
|
+
type: 'varchar',
|
|
34
|
+
length: 200,
|
|
35
|
+
nullable: true,
|
|
36
|
+
})
|
|
37
|
+
preference_value: string;
|
|
38
|
+
|
|
39
|
+
@Column({
|
|
40
|
+
name: 'description',
|
|
41
|
+
type: 'varchar',
|
|
42
|
+
length: 2000,
|
|
43
|
+
nullable: true,
|
|
44
|
+
})
|
|
45
|
+
description: string;
|
|
46
|
+
|
|
47
|
+
@Column({ name: 'reflect_on', type: 'varchar', length: 200, nullable: true })
|
|
48
|
+
reflect_on: string;
|
|
49
|
+
|
|
50
|
+
@Column({
|
|
51
|
+
name: 'default_value',
|
|
52
|
+
type: 'varchar',
|
|
53
|
+
length: 200,
|
|
54
|
+
nullable: true,
|
|
55
|
+
})
|
|
56
|
+
default_value: string;
|
|
57
|
+
|
|
58
|
+
@Column({
|
|
59
|
+
name: 'possible_values',
|
|
60
|
+
type: 'varchar',
|
|
61
|
+
length: 200,
|
|
62
|
+
nullable: true,
|
|
63
|
+
})
|
|
64
|
+
possible_values: string;
|
|
65
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
-
import { AttributeMaster } from '../entity/attribute-master.entity';
|
|
4
|
-
import { Repository } from 'typeorm';
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class AttributeMasterRepository {
|
|
8
|
-
constructor(
|
|
9
|
-
@InjectRepository(AttributeMaster)
|
|
10
|
-
private readonly attributeMasterRepository: Repository<AttributeMaster>,
|
|
11
|
-
) {}
|
|
12
|
-
|
|
13
|
-
async findByMappedEntityIdAndMappedEntityTypeAndAttributeKeyAndOrganizationId(
|
|
14
|
-
mappedEntityId: number,
|
|
15
|
-
mappedEntityType: string,
|
|
16
|
-
attributeKey: string,
|
|
17
|
-
organizationId: number,
|
|
18
|
-
): Promise<AttributeMaster | null> {
|
|
19
|
-
return await this.attributeMasterRepository.findOne({
|
|
20
|
-
where: {
|
|
21
|
-
mapped_entity_id: mappedEntityId,
|
|
22
|
-
mapped_entity_type: mappedEntityType,
|
|
23
|
-
attribute_key: attributeKey,
|
|
24
|
-
organization_id: organizationId,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
+
import { AttributeMaster } from '../entity/attribute-master.entity';
|
|
4
|
+
import { Repository } from 'typeorm';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class AttributeMasterRepository {
|
|
8
|
+
constructor(
|
|
9
|
+
@InjectRepository(AttributeMaster)
|
|
10
|
+
private readonly attributeMasterRepository: Repository<AttributeMaster>,
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
async findByMappedEntityIdAndMappedEntityTypeAndAttributeKeyAndOrganizationId(
|
|
14
|
+
mappedEntityId: number,
|
|
15
|
+
mappedEntityType: string,
|
|
16
|
+
attributeKey: string,
|
|
17
|
+
organizationId: number,
|
|
18
|
+
): Promise<AttributeMaster | null> {
|
|
19
|
+
return await this.attributeMasterRepository.findOne({
|
|
20
|
+
where: {
|
|
21
|
+
mapped_entity_id: mappedEntityId,
|
|
22
|
+
mapped_entity_type: mappedEntityType,
|
|
23
|
+
attribute_key: attributeKey,
|
|
24
|
+
organization_id: organizationId,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
-
import { PreferenceMaster } from '../entity/preference.entity';
|
|
4
|
-
import { Repository } from 'typeorm';
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class PreferenceRepository {
|
|
8
|
-
constructor(
|
|
9
|
-
@InjectRepository(PreferenceMaster)
|
|
10
|
-
private readonly preferenceRepository: Repository<PreferenceMaster>,
|
|
11
|
-
) {}
|
|
12
|
-
|
|
13
|
-
async findByPreferenceKey(
|
|
14
|
-
preferenceKey: string,
|
|
15
|
-
): Promise<PreferenceMaster | null> {
|
|
16
|
-
return await this.preferenceRepository.findOne({
|
|
17
|
-
where: { preference_key: preferenceKey },
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
+
import { PreferenceMaster } from '../entity/preference.entity';
|
|
4
|
+
import { Repository } from 'typeorm';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class PreferenceRepository {
|
|
8
|
+
constructor(
|
|
9
|
+
@InjectRepository(PreferenceMaster)
|
|
10
|
+
private readonly preferenceRepository: Repository<PreferenceMaster>,
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
async findByPreferenceKey(
|
|
14
|
+
preferenceKey: string,
|
|
15
|
+
): Promise<PreferenceMaster | null> {
|
|
16
|
+
return await this.preferenceRepository.findOne({
|
|
17
|
+
where: { preference_key: preferenceKey },
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { Repository } from 'typeorm';
|
|
3
|
-
import { InjectRepository } from '@nestjs/typeorm';
|
|
4
|
-
import { EntityMaster } from '../entity/entity-master.entity';
|
|
5
|
-
|
|
6
|
-
@Injectable()
|
|
7
|
-
export class EntityMasterService {
|
|
8
|
-
constructor(
|
|
9
|
-
@InjectRepository(EntityMaster)
|
|
10
|
-
private entityMasterRepository: Repository<EntityMaster>,
|
|
11
|
-
) {}
|
|
12
|
-
|
|
13
|
-
async getEntityData(mappedEntityType: string): Promise<EntityMaster> {
|
|
14
|
-
const entityMaster = await this.entityMasterRepository.findOne({
|
|
15
|
-
where: { mappedEntityType },
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
if (!entityMaster) {
|
|
19
|
-
throw new Error(
|
|
20
|
-
`Entity with mappedEntityType "${mappedEntityType}" not found.`,
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return entityMaster;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { Repository } from 'typeorm';
|
|
3
|
+
import { InjectRepository } from '@nestjs/typeorm';
|
|
4
|
+
import { EntityMaster } from '../entity/entity-master.entity';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class EntityMasterService {
|
|
8
|
+
constructor(
|
|
9
|
+
@InjectRepository(EntityMaster)
|
|
10
|
+
private entityMasterRepository: Repository<EntityMaster>,
|
|
11
|
+
) {}
|
|
12
|
+
|
|
13
|
+
async getEntityData(mappedEntityType: string): Promise<EntityMaster> {
|
|
14
|
+
const entityMaster = await this.entityMasterRepository.findOne({
|
|
15
|
+
where: { mappedEntityType },
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
if (!entityMaster) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
`Entity with mappedEntityType "${mappedEntityType}" not found.`,
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return entityMaster;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Controller, Get, Request, UseGuards } from '@nestjs/common';
|
|
2
|
-
import { MenuService } from '../service/menu.service';
|
|
3
|
-
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
4
|
-
|
|
5
|
-
@Controller('
|
|
6
|
-
export class MenuController {
|
|
7
|
-
constructor(private readonly menuService: MenuService) {}
|
|
8
|
-
|
|
9
|
-
@UseGuards(JwtAuthGuard)
|
|
10
|
-
@Get()
|
|
11
|
-
async getMenu(@Request() req) {
|
|
12
|
-
const userId = req.user.userId;
|
|
13
|
-
return this.menuService.getUserMenu(userId);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
1
|
+
import { Controller, Get, Request, UseGuards } from '@nestjs/common';
|
|
2
|
+
import { MenuService } from '../service/menu.service';
|
|
3
|
+
import { JwtAuthGuard } from 'src/module/auth/guards/jwt.guard';
|
|
4
|
+
|
|
5
|
+
@Controller('menu')
|
|
6
|
+
export class MenuController {
|
|
7
|
+
constructor(private readonly menuService: MenuService) {}
|
|
8
|
+
|
|
9
|
+
@UseGuards(JwtAuthGuard)
|
|
10
|
+
@Get()
|
|
11
|
+
async getMenu(@Request() req) {
|
|
12
|
+
const userId = req.user.userId;
|
|
13
|
+
return this.menuService.getUserMenu(userId);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Body, Controller, Get, Post, Query } from '@nestjs/common';
|
|
2
2
|
import { ModuleAccessService } from '../service/module-access.service';
|
|
3
3
|
|
|
4
|
-
@Controller('
|
|
4
|
+
@Controller('module-access')
|
|
5
5
|
export class ModuleAccessController {
|
|
6
6
|
constructor(private readonly moduleAccessService: ModuleAccessService) {}
|
|
7
7
|
|