rez_core 0.0.7 → 1.0.2-o
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/.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/data/master.xlsx +0 -0
- package/dist/app.module.d.ts +0 -2
- package/dist/app.module.js +0 -31
- package/dist/app.module.js.map +1 -1
- package/dist/config/config.module.js +1 -1
- package/dist/config/config.module.js.map +1 -1
- package/dist/config/database.config.d.ts +3 -0
- package/dist/config/database.config.js +14 -6
- package/dist/config/database.config.js.map +1 -1
- package/dist/constant/global.constant.d.ts +6 -2
- package/dist/constant/global.constant.js +7 -3
- package/dist/constant/global.constant.js.map +1 -1
- package/dist/core.module.js +6 -0
- package/dist/core.module.js.map +1 -1
- package/dist/decorators/roles.decorator.js.map +1 -1
- package/dist/main.js +2 -1
- package/dist/main.js.map +1 -1
- package/dist/module/auth/auth.module.js +1 -1
- package/dist/module/auth/auth.module.js.map +1 -1
- package/dist/module/auth/guards/role.guard.js +3 -3
- package/dist/module/auth/strategies/google.strategy.d.ts +3 -1
- package/dist/module/auth/strategies/google.strategy.js +7 -5
- package/dist/module/auth/strategies/google.strategy.js.map +1 -1
- package/dist/module/auth/strategies/jwt.strategy.d.ts +4 -4
- package/dist/module/auth/strategies/jwt.strategy.js +8 -9
- package/dist/module/auth/strategies/jwt.strategy.js.map +1 -1
- package/dist/module/enterprise/enterprise.module.js +1 -1
- package/dist/module/enterprise/enterprise.module.js.map +1 -1
- package/dist/module/enterprise/service/organization.service.d.ts +9 -7
- package/dist/module/enterprise/service/organization.service.js +35 -14
- package/dist/module/enterprise/service/organization.service.js.map +1 -1
- package/dist/module/layout/controller/layout.controller.d.ts +11 -0
- package/dist/module/layout/controller/layout.controller.js +61 -0
- package/dist/module/layout/controller/layout.controller.js.map +1 -0
- package/dist/module/layout/dto/header.dto.d.ts +0 -0
- package/dist/module/layout/dto/header.dto.js +1 -0
- package/dist/module/layout/dto/header.dto.js.map +1 -0
- package/dist/module/layout/entity/header-items.entity.d.ts +10 -0
- package/dist/module/layout/entity/header-items.entity.js +52 -0
- package/dist/module/layout/entity/header-items.entity.js.map +1 -0
- package/dist/module/layout/entity/header-section.entity.d.ts +7 -0
- package/dist/module/layout/entity/header-section.entity.js +40 -0
- package/dist/module/layout/entity/header-section.entity.js.map +1 -0
- package/dist/module/layout/layout.module.d.ts +2 -0
- package/dist/module/layout/layout.module.js +30 -0
- package/dist/module/layout/layout.module.js.map +1 -0
- package/dist/module/layout/repository/header-items.repository.d.ts +7 -0
- package/dist/module/layout/repository/header-items.repository.js +36 -0
- package/dist/module/layout/repository/header-items.repository.js.map +1 -0
- package/dist/module/layout/repository/header-section.repository.d.ts +7 -0
- package/dist/module/layout/repository/header-section.repository.js +36 -0
- package/dist/module/layout/repository/header-section.repository.js.map +1 -0
- package/dist/module/layout/service/header-section.service.d.ts +8 -0
- package/dist/module/layout/service/header-section.service.js +37 -0
- package/dist/module/layout/service/header-section.service.js.map +1 -0
- package/dist/module/meta/controller/entity.controller.d.ts +1 -0
- package/dist/module/meta/controller/entity.controller.js +37 -1
- package/dist/module/meta/controller/entity.controller.js.map +1 -1
- package/dist/module/meta/entity/base-entity.entity.d.ts +1 -2
- package/dist/module/meta/entity/base-entity.entity.js +1 -2
- package/dist/module/meta/entity/base-entity.entity.js.map +1 -1
- package/dist/module/meta/entity/entity-master.entity.d.ts +1 -0
- package/dist/module/meta/entity/entity-master.entity.js +4 -0
- package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
- package/dist/module/meta/entity/entity-table-column.entity.js.map +1 -1
- package/dist/module/meta/entity/entity-table.entity.d.ts +1 -0
- package/dist/module/meta/entity/entity-table.entity.js +4 -0
- package/dist/module/meta/entity/entity-table.entity.js.map +1 -1
- package/dist/module/meta/entity/media-data.entity.d.ts +11 -0
- package/dist/module/meta/entity/media-data.entity.js +55 -0
- package/dist/module/meta/entity/media-data.entity.js.map +1 -0
- package/dist/module/meta/entity.module.js +15 -1
- package/dist/module/meta/entity.module.js.map +1 -1
- package/dist/module/meta/repository/entity-table-column.repository.js +2 -2
- package/dist/module/meta/repository/entity-table.repository.d.ts +1 -0
- package/dist/module/meta/repository/entity-table.repository.js +9 -0
- package/dist/module/meta/repository/entity-table.repository.js.map +1 -1
- package/dist/module/meta/repository/media-data.repository.d.ts +9 -0
- package/dist/module/meta/repository/media-data.repository.js +55 -0
- package/dist/module/meta/repository/media-data.repository.js.map +1 -0
- package/dist/module/meta/service/entity-list.service.d.ts +3 -1
- package/dist/module/meta/service/entity-list.service.js +26 -3
- package/dist/module/meta/service/entity-list.service.js.map +1 -1
- package/dist/module/meta/service/entity-service-impl.service.d.ts +13 -5
- package/dist/module/meta/service/entity-service-impl.service.js +92 -15
- package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
- package/dist/module/meta/service/entity-table-column.service.d.ts +1 -0
- package/dist/module/meta/service/entity-table-column.service.js +4 -0
- package/dist/module/meta/service/entity-table-column.service.js.map +1 -1
- package/dist/module/meta/service/entity-table.service.d.ts +1 -0
- package/dist/module/meta/service/entity-table.service.js +3 -0
- package/dist/module/meta/service/entity-table.service.js.map +1 -1
- package/dist/module/meta/service/entity.service.d.ts +3 -1
- package/dist/module/meta/service/media-data.service.d.ts +9 -0
- package/dist/module/meta/service/media-data.service.js +36 -0
- package/dist/module/meta/service/media-data.service.js.map +1 -0
- package/dist/module/meta/service/preference.service.d.ts +1 -5
- package/dist/module/meta/service/preference.service.js +3 -11
- package/dist/module/meta/service/preference.service.js.map +1 -1
- package/dist/module/module/entity/menu.entity.d.ts +1 -2
- package/dist/module/module/entity/menu.entity.js +1 -2
- package/dist/module/module/entity/menu.entity.js.map +1 -1
- package/dist/module/module/entity/module.entity.d.ts +1 -2
- package/dist/module/module/entity/module.entity.js +1 -2
- package/dist/module/module/entity/module.entity.js.map +1 -1
- package/dist/module/module/module.module.js +2 -2
- package/dist/module/module/module.module.js.map +1 -1
- package/dist/module/module/repository/menu.repository.js +3 -3
- package/dist/module/module/repository/menu.repository.js.map +1 -1
- package/dist/module/module/repository/module-access.repository.js +31 -20
- package/dist/module/module/repository/module-access.repository.js.map +1 -1
- package/dist/module/module/service/menu.service.js +2 -2
- package/dist/module/module/service/menu.service.js.map +1 -1
- package/dist/module/module/service/module-access.service.js.map +1 -1
- package/dist/module/notification/controller/otp.controller.d.ts +17 -0
- package/dist/module/notification/controller/otp.controller.js +67 -0
- package/dist/module/notification/controller/otp.controller.js.map +1 -0
- package/dist/module/notification/entity/otp.entity.d.ts +10 -0
- package/dist/module/notification/entity/otp.entity.js +52 -0
- package/dist/module/notification/entity/otp.entity.js.map +1 -0
- package/dist/module/notification/notification.module.d.ts +2 -0
- package/dist/module/notification/notification.module.js +27 -0
- package/dist/module/notification/notification.module.js.map +1 -0
- package/dist/module/notification/repository/otp.repository.d.ts +9 -0
- package/dist/module/notification/repository/otp.repository.js +44 -0
- package/dist/module/notification/repository/otp.repository.js.map +1 -0
- package/dist/module/notification/service/otp.service.d.ts +16 -0
- package/dist/module/notification/service/otp.service.js +66 -0
- package/dist/module/notification/service/otp.service.js.map +1 -0
- package/dist/module/user/controller/login.controller.d.ts +1 -3
- package/dist/module/user/controller/login.controller.js +0 -1
- package/dist/module/user/controller/login.controller.js.map +1 -1
- package/dist/module/user/dto/create-user.dto.js.map +1 -1
- package/dist/module/user/entity/role.entity.js.map +1 -1
- package/dist/module/user/repository/user-role-mapping.repository.js +4 -1
- package/dist/module/user/repository/user-role-mapping.repository.js.map +1 -1
- package/dist/module/user/repository/user.repository.js.map +1 -1
- package/dist/module/user/service/login.service.d.ts +12 -4
- package/dist/module/user/service/login.service.js +24 -9
- package/dist/module/user/service/login.service.js.map +1 -1
- package/dist/module/user/service/role.service.d.ts +1 -5
- package/dist/module/user/service/role.service.js +3 -10
- package/dist/module/user/service/role.service.js.map +1 -1
- package/dist/module/user/service/user-session.service.d.ts +1 -3
- package/dist/module/user/service/user-session.service.js +1 -1
- package/dist/module/user/service/user-session.service.js.map +1 -1
- package/dist/module/user/service/user.service.d.ts +7 -8
- package/dist/module/user/service/user.service.js +13 -17
- package/dist/module/user/service/user.service.js.map +1 -1
- package/dist/module/user/user.module.js +1 -0
- package/dist/module/user/user.module.js.map +1 -1
- package/dist/resources/dev.properties.yaml +15 -0
- package/dist/resources/properties.module.d.ts +2 -0
- package/dist/resources/properties.module.js +25 -0
- package/dist/resources/properties.module.js.map +1 -0
- package/dist/resources/properties.yaml.d.ts +2 -0
- package/dist/resources/properties.yaml.js +10 -0
- package/dist/resources/properties.yaml.js.map +1 -0
- package/dist/resources/uat.properties.yaml +15 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/dto/excel-data.dto.d.ts +7 -0
- package/dist/utils/dto/excel-data.dto.js +16 -0
- package/dist/utils/dto/excel-data.dto.js.map +1 -0
- package/dist/utils/dto/excelsheet-data.dto.d.ts +5 -0
- package/dist/utils/dto/excelsheet-data.dto.js +3 -0
- package/dist/utils/dto/excelsheet-data.dto.js.map +1 -0
- package/dist/utils/service/excel-helper.service.d.ts +3 -1
- package/dist/utils/service/excel-helper.service.js +12 -3
- package/dist/utils/service/excel-helper.service.js.map +1 -1
- package/dist/utils/service/loggingUtil.service.js +6 -6
- package/dist/utils/service/loggingUtil.service.js.map +1 -1
- package/dist/utils/utils.module.js.map +1 -1
- package/nest-cli.json +6 -0
- package/package.json +1 -1
- package/src/app.module.ts +0 -0
- package/src/config/config.module.ts +1 -1
- package/src/config/database.config.ts +10 -5
- package/src/constant/global.constant.ts +13 -4
- package/src/core.module.ts +6 -0
- package/src/decorators/roles.decorator.ts +5 -2
- package/src/module/auth/auth.module.ts +3 -2
- package/src/module/auth/guards/google-auth.guard.ts +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 +7 -4
- package/src/module/auth/strategies/jwt.strategy.ts +5 -6
- 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/enterprise.module.ts +2 -3
- package/src/module/enterprise/entity/enterprise.entity.ts +37 -37
- package/src/module/enterprise/entity/organization.entity.ts +80 -80
- package/src/module/enterprise/service/organization.service.ts +48 -13
- package/src/module/layout/controller/layout.controller.ts +32 -0
- package/src/module/layout/dto/header.dto.ts +0 -0
- package/src/module/layout/entity/header-items.entity.ts +28 -0
- package/src/module/layout/entity/header-section.entity.ts +19 -0
- package/src/module/layout/layout.module.ts +17 -0
- package/src/module/layout/repository/header-items.repository.ts +18 -0
- package/src/module/layout/repository/header-section.repository.ts +18 -0
- package/src/module/layout/service/header-section.service.ts +26 -0
- package/src/module/master/controller/master.controller.ts +22 -22
- package/src/module/meta/controller/entity.controller.ts +56 -3
- 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/base-entity.entity.ts +2 -3
- package/src/module/meta/entity/entity-master.entity.ts +3 -0
- package/src/module/meta/entity/entity-table-column.entity.ts +1 -1
- package/src/module/meta/entity/entity-table.entity.ts +4 -2
- package/src/module/meta/entity/media-data.entity.ts +32 -0
- package/src/module/meta/entity/preference.entity.ts +65 -65
- package/src/module/meta/entity.module.ts +15 -1
- package/src/module/meta/repository/attribute-master.repository.ts +28 -28
- package/src/module/meta/repository/entity-table-column.repository.ts +3 -3
- package/src/module/meta/repository/entity-table.repository.ts +14 -0
- package/src/module/meta/repository/media-data.repository.ts +50 -0
- package/src/module/meta/repository/preference.repository.ts +20 -20
- package/src/module/meta/service/entity-list.service.ts +36 -7
- package/src/module/meta/service/entity-service-impl.service.ts +138 -20
- package/src/module/meta/service/entity-table-column.service.ts +14 -1
- package/src/module/meta/service/entity-table.service.ts +8 -1
- package/src/module/meta/service/entity.service.ts +13 -1
- package/src/module/meta/service/media-data.service.ts +44 -0
- package/src/module/meta/service/preference.service.ts +2 -17
- 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/menu.entity.ts +10 -11
- 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/module/entity/module.entity.ts +9 -10
- package/src/module/module/module.module.ts +2 -4
- package/src/module/module/repository/menu.repository.ts +7 -10
- package/src/module/module/repository/module-access.repository.ts +57 -42
- package/src/module/module/service/menu.service.ts +9 -10
- package/src/module/module/service/module-access.service.ts +8 -3
- package/src/module/notification/controller/otp.controller.ts +41 -0
- package/src/module/notification/entity/otp.entity.ts +28 -0
- package/src/module/notification/notification.module.ts +14 -0
- package/src/module/notification/repository/otp.repository.ts +27 -0
- package/src/module/notification/service/otp.service.ts +56 -0
- package/src/module/user/controller/login.controller.ts +2 -1
- package/src/module/user/controller/user.controller.ts +28 -28
- package/src/module/user/dto/create-user.dto.ts +43 -43
- package/src/module/user/dto/update-user.dto.ts +4 -4
- package/src/module/user/entity/role.entity.ts +1 -1
- 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/user-role-mapping.repository.ts +9 -3
- package/src/module/user/repository/user.repository.ts +2 -2
- package/src/module/user/repository/userSession.repository.ts +33 -33
- package/src/module/user/service/login.service.ts +25 -8
- package/src/module/user/service/role.service.ts +2 -13
- package/src/module/user/service/user-role-mapping.service.ts +1 -1
- package/src/module/user/service/user-session.service.ts +2 -2
- package/src/module/user/service/user.service.ts +16 -27
- package/src/module/user/user.module.ts +1 -1
- package/src/resources/dev.properties.yaml +15 -0
- package/src/resources/properties.module.ts +12 -0
- package/src/resources/properties.yaml.ts +11 -0
- package/src/resources/uat.properties.yaml +15 -0
- package/src/utils/dto/excel-data.dto.ts +14 -0
- package/src/utils/dto/excelsheet-data.dto.ts +5 -0
- package/src/utils/service/clockIDGenUtil.service.ts +1 -1
- package/src/utils/service/dateUtil.service.ts +1 -1
- package/src/utils/service/encryptUtil.service.ts +97 -97
- package/src/utils/service/excel-helper.service.ts +14 -1
- package/src/utils/service/excelUtil.service.ts +15 -15
- package/src/utils/service/loggingUtil.service.ts +48 -48
- package/src/utils/service/reflection-helper.service.ts +53 -53
- package/src/utils/utils.module.ts +7 -7
- package/.env +0 -6
- package/dist/constant/status.constant.d.ts +0 -4
- package/dist/constant/status.constant.js +0 -9
- package/dist/constant/status.constant.js.map +0 -1
- package/src/constant/status.constant.ts +0 -3
|
@@ -22,7 +22,7 @@ export class MenuRepository extends Repository<MenuData> {
|
|
|
22
22
|
.where('userRoleMapping.user_id = :userId', { userId })
|
|
23
23
|
.getMany();
|
|
24
24
|
|
|
25
|
-
return roles.map(role => role.role_id);
|
|
25
|
+
return roles.map((role) => role.role_id);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -36,13 +36,13 @@ export class MenuRepository extends Repository<MenuData> {
|
|
|
36
36
|
.select('role.code')
|
|
37
37
|
.where('role.id IN (:...roleIds)', { roleIds })
|
|
38
38
|
.getMany();
|
|
39
|
-
|
|
40
|
-
const codes = roleCodes.map(role => role.code);
|
|
41
|
-
|
|
39
|
+
|
|
40
|
+
const codes = roleCodes.map((role) => role.code);
|
|
41
|
+
|
|
42
42
|
if (codes.length === 0) {
|
|
43
43
|
return [];
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
|
|
46
46
|
// Get accessible modules using role codes
|
|
47
47
|
const modules = await this.dataSource
|
|
48
48
|
.getRepository(ModuleAccess)
|
|
@@ -51,11 +51,9 @@ export class MenuRepository extends Repository<MenuData> {
|
|
|
51
51
|
.where('moduleAccess.role_code IN (:...codes)', { codes })
|
|
52
52
|
.andWhere('moduleAccess.access_flag > 0')
|
|
53
53
|
.getMany();
|
|
54
|
-
|
|
55
|
-
return modules.map(module => module.module_code);
|
|
54
|
+
|
|
55
|
+
return modules.map((module) => module.module_code);
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
57
|
|
|
60
58
|
/**
|
|
61
59
|
* Get menu items based on accessible modules.
|
|
@@ -65,5 +63,4 @@ export class MenuRepository extends Repository<MenuData> {
|
|
|
65
63
|
.where('menu.module_code IN (:...moduleCodes)', { moduleCodes })
|
|
66
64
|
.getMany();
|
|
67
65
|
}
|
|
68
|
-
|
|
69
66
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@nestjs/common';
|
|
2
2
|
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
-
import {
|
|
3
|
+
import { In, Repository } from 'typeorm';
|
|
4
4
|
import { Role } from 'src/module/user/entity/role.entity';
|
|
5
5
|
import { ModuleAccess } from '../entity/module-access.entity';
|
|
6
6
|
import { ModuleAction } from '../entity/module-action.entity';
|
|
@@ -16,7 +16,7 @@ export class ModuleAccessRepository {
|
|
|
16
16
|
@InjectRepository(ModuleAccess)
|
|
17
17
|
private readonly moduleAccessRepo: Repository<ModuleAccess>,
|
|
18
18
|
@InjectRepository(ModuleAction)
|
|
19
|
-
private readonly moduleActionRepo: Repository<ModuleAction
|
|
19
|
+
private readonly moduleActionRepo: Repository<ModuleAction>,
|
|
20
20
|
) {}
|
|
21
21
|
|
|
22
22
|
async getRoles() {
|
|
@@ -24,83 +24,98 @@ export class ModuleAccessRepository {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
async getModules() {
|
|
27
|
-
return this.moduleRepo.find({ where: { module_level: 'MAINMOD' }});
|
|
27
|
+
return this.moduleRepo.find({ where: { module_level: 'MAINMOD' } });
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
async getAccessListing(roleIds: number[]) {
|
|
31
31
|
// Fetch roles using role IDs
|
|
32
32
|
const roles = await this.roleRepo.find({ where: { id: In(roleIds) } });
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
// Extract role codes from roles
|
|
35
|
-
const roleCodes = roles.map(role => role.code);
|
|
36
|
-
|
|
35
|
+
const roleCodes = roles.map((role) => role.code);
|
|
36
|
+
|
|
37
37
|
// Fetch module access using role codes
|
|
38
|
-
const moduleAccesses = await this.moduleAccessRepo.find({
|
|
39
|
-
|
|
38
|
+
const moduleAccesses = await this.moduleAccessRepo.find({
|
|
39
|
+
where: { role_code: In(roleCodes) },
|
|
40
|
+
});
|
|
41
|
+
|
|
40
42
|
// Map role data to include access permissions
|
|
41
|
-
return roles.map(role => ({
|
|
43
|
+
return roles.map((role) => ({
|
|
42
44
|
role_code: role.code,
|
|
43
45
|
name: role.name,
|
|
44
46
|
permission: moduleAccesses
|
|
45
|
-
.filter(access => access.role_code === role.code)
|
|
46
|
-
.map(access => ({
|
|
47
|
+
.filter((access) => access.role_code === role.code)
|
|
48
|
+
.map((access) => ({
|
|
47
49
|
action: access.action_type,
|
|
48
50
|
access: access.access_flag,
|
|
49
|
-
code: access.module_code
|
|
50
|
-
}))
|
|
51
|
+
code: access.module_code,
|
|
52
|
+
})),
|
|
51
53
|
}));
|
|
52
54
|
}
|
|
53
|
-
|
|
55
|
+
|
|
54
56
|
async getMenuListing(mainModIds: string[]) {
|
|
55
57
|
// Get MAINMOD modules using their IDs
|
|
56
|
-
const mainModules = await this.moduleRepo.find({
|
|
57
|
-
|
|
58
|
+
const mainModules = await this.moduleRepo.find({
|
|
59
|
+
where: { id: In(mainModIds), module_level: 'MAINMOD' },
|
|
58
60
|
});
|
|
59
61
|
|
|
60
62
|
if (!mainModules.length) return [];
|
|
61
63
|
|
|
62
64
|
// Extract WBS codes of the MAINMOD modules
|
|
63
|
-
const wbsCodes = mainModules.map(mod => mod.wbs_code);
|
|
65
|
+
const wbsCodes = mainModules.map((mod) => mod.wbs_code);
|
|
64
66
|
|
|
65
67
|
// Fetch all related modules using `LIKE` for WBS structure
|
|
66
|
-
const modules = await this.moduleRepo
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
const modules = await this.moduleRepo
|
|
69
|
+
.createQueryBuilder('module')
|
|
70
|
+
.where(
|
|
71
|
+
wbsCodes
|
|
72
|
+
.map((code) => `module.wbs_code LIKE :code${code}`)
|
|
73
|
+
.join(' OR '),
|
|
74
|
+
Object.fromEntries(wbsCodes.map((code) => [`code${code}`, `${code}%`])),
|
|
75
|
+
)
|
|
76
|
+
.getMany();
|
|
72
77
|
|
|
73
78
|
// Fetch module actions
|
|
74
79
|
const moduleActions = await this.moduleActionRepo.find();
|
|
75
80
|
|
|
76
81
|
// Function to recursively build module hierarchy
|
|
77
82
|
const buildHierarchy = (parentWbs: string) => {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
83
|
+
return modules
|
|
84
|
+
.filter(
|
|
85
|
+
(mod) =>
|
|
86
|
+
mod.wbs_code.startsWith(parentWbs) && mod.wbs_code !== parentWbs,
|
|
87
|
+
)
|
|
88
|
+
.map((mod) => ({
|
|
89
|
+
name: mod.name,
|
|
90
|
+
code: mod.module_code,
|
|
91
|
+
permission: moduleActions
|
|
92
|
+
.filter((action) => action.module_code === mod.module_code)
|
|
93
|
+
.map((action) => ({
|
|
94
|
+
action: action.action_type,
|
|
95
|
+
name: action.action_type,
|
|
96
|
+
})),
|
|
97
|
+
submod: buildHierarchy(mod.wbs_code),
|
|
98
|
+
}));
|
|
88
99
|
};
|
|
89
100
|
|
|
90
101
|
// Construct the final hierarchical response
|
|
91
|
-
return mainModules.map(mod => ({
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
return mainModules.map((mod) => ({
|
|
103
|
+
name: mod.name,
|
|
104
|
+
code: mod.module_code,
|
|
105
|
+
permission: moduleActions
|
|
106
|
+
.filter((action) => action.module_code === mod.module_code)
|
|
107
|
+
.map((action) => ({
|
|
108
|
+
action: action.action_type,
|
|
109
|
+
name: action.action_type,
|
|
110
|
+
})),
|
|
111
|
+
submod: buildHierarchy(mod.wbs_code),
|
|
98
112
|
}));
|
|
99
|
-
}
|
|
113
|
+
}
|
|
100
114
|
async updateModuleAccess(moduleAccessData: any[]): Promise<boolean> {
|
|
101
115
|
try {
|
|
102
116
|
for (const access of moduleAccessData) {
|
|
103
|
-
const { role_code, module_code, action_type, access_flag, app_code } =
|
|
117
|
+
const { role_code, module_code, action_type, access_flag, app_code } =
|
|
118
|
+
access;
|
|
104
119
|
|
|
105
120
|
const existingEntry = await this.moduleAccessRepo.findOne({
|
|
106
121
|
where: { role_code, module_code, action_type, app_code },
|
|
@@ -17,14 +17,15 @@ export class MenuService {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// Step 2: Get the modules the user has access to
|
|
20
|
-
const moduleCodes =
|
|
20
|
+
const moduleCodes =
|
|
21
|
+
await this.menuRepository.getAccessibleModules(roleCodes);
|
|
21
22
|
if (!moduleCodes.length) {
|
|
22
23
|
return { menu: [] }; // Return empty menu if no accessible modules
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
// Step 3: Get the menu items based on accessible modules
|
|
26
27
|
const menuItems = await this.menuRepository.getMenuItems(moduleCodes);
|
|
27
|
-
|
|
28
|
+
|
|
28
29
|
// Step 4: Build hierarchical menu structure
|
|
29
30
|
const menuTree = this.buildMenuHierarchy(menuItems);
|
|
30
31
|
|
|
@@ -37,25 +38,23 @@ export class MenuService {
|
|
|
37
38
|
private buildMenuHierarchy(menuItems: MenuData[]): any[] {
|
|
38
39
|
const menuMap = new Map<string, any>(); // Use module_code as the key
|
|
39
40
|
const rootMenu: any[] = [];
|
|
40
|
-
|
|
41
|
+
|
|
41
42
|
// Initialize menu items in the map
|
|
42
|
-
menuItems.forEach(menu => {
|
|
43
|
+
menuItems.forEach((menu) => {
|
|
43
44
|
menuMap.set(menu.wbs_code, { ...menu, submenu: [] });
|
|
44
45
|
});
|
|
45
|
-
|
|
46
|
+
|
|
46
47
|
// Build the hierarchy based on WBS code
|
|
47
|
-
menuItems.forEach(menu => {
|
|
48
|
+
menuItems.forEach((menu) => {
|
|
48
49
|
const parentWbs = menu.wbs_code.split('.').slice(0, -1).join('.'); // Get parent WBS code
|
|
49
|
-
|
|
50
|
+
|
|
50
51
|
if (parentWbs && menuMap.has(parentWbs)) {
|
|
51
52
|
menuMap.get(parentWbs).submenu.push(menuMap.get(menu.wbs_code));
|
|
52
53
|
} else {
|
|
53
54
|
rootMenu.push(menuMap.get(menu.wbs_code));
|
|
54
55
|
}
|
|
55
56
|
});
|
|
56
|
-
|
|
57
|
+
|
|
57
58
|
return rootMenu;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
60
|
}
|
|
@@ -3,7 +3,9 @@ import { ModuleAccessRepository } from '../repository/module-access.repository';
|
|
|
3
3
|
|
|
4
4
|
@Injectable()
|
|
5
5
|
export class ModuleAccessService {
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(
|
|
7
|
+
private readonly moduleAccessRepository: ModuleAccessRepository,
|
|
8
|
+
) {}
|
|
7
9
|
|
|
8
10
|
async getRoles() {
|
|
9
11
|
return this.moduleAccessRepository.getRoles();
|
|
@@ -21,12 +23,15 @@ export class ModuleAccessService {
|
|
|
21
23
|
return this.moduleAccessRepository.getMenuListing(mainModIds);
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
async updateModuleAccess(
|
|
26
|
+
async updateModuleAccess(
|
|
27
|
+
moduleAccessData: any[],
|
|
28
|
+
): Promise<{ success: boolean; msg: string }> {
|
|
25
29
|
if (!moduleAccessData || moduleAccessData.length === 0) {
|
|
26
30
|
return { success: false, msg: 'No data provided' };
|
|
27
31
|
}
|
|
28
32
|
|
|
29
|
-
const result =
|
|
33
|
+
const result =
|
|
34
|
+
await this.moduleAccessRepository.updateModuleAccess(moduleAccessData);
|
|
30
35
|
|
|
31
36
|
if (result) {
|
|
32
37
|
return { success: true, msg: 'Module access updated successfully' };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BadRequestException, Body, Controller, HttpCode, HttpStatus, Post, Query } from '@nestjs/common';
|
|
2
|
+
import { OtpService } from '../service/otp.service';
|
|
3
|
+
import { ConfigService } from '@nestjs/config';
|
|
4
|
+
|
|
5
|
+
@Controller('otp')
|
|
6
|
+
export class OtpController{
|
|
7
|
+
|
|
8
|
+
constructor(private readonly otpService: OtpService,
|
|
9
|
+
private configService: ConfigService,
|
|
10
|
+
) {
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
otpExpiry = this.configService.get('OTP_EXPIRY')|| '2';
|
|
14
|
+
otpLength = this.configService.get('OTP_LENGTH')|| '6';
|
|
15
|
+
|
|
16
|
+
@Post('generate')
|
|
17
|
+
@HttpCode(HttpStatus.OK)
|
|
18
|
+
async generateOtp(@Body() request: any) {
|
|
19
|
+
let identifier = request.identifier;
|
|
20
|
+
let service = request.service;
|
|
21
|
+
|
|
22
|
+
if(!identifier || !service) {
|
|
23
|
+
throw new BadRequestException('Missing identifier or service!');
|
|
24
|
+
}
|
|
25
|
+
let otp = await this.otpService.generate(identifier, service, parseInt(this.otpExpiry), parseInt(this.otpLength));
|
|
26
|
+
return {'otp_id':otp.otp_id, 'success': true};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Post('verify')
|
|
30
|
+
@HttpCode(HttpStatus.OK)
|
|
31
|
+
async verifyOtp(@Body() request: any) {
|
|
32
|
+
let otp = request.otp;
|
|
33
|
+
let otpId = request.otp_id;
|
|
34
|
+
|
|
35
|
+
let verify = await this.otpService.verifyOtp(otp, otpId);
|
|
36
|
+
if (!verify) {
|
|
37
|
+
throw new BadRequestException('Invalid OTP!');
|
|
38
|
+
}
|
|
39
|
+
return {'message': 'OTP verified successfully!', 'success': true};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
@Entity({ name: 'cr_otp' })
|
|
4
|
+
export class Otp {
|
|
5
|
+
@PrimaryGeneratedColumn()
|
|
6
|
+
id: number;
|
|
7
|
+
|
|
8
|
+
@Column({ name: 'otp_id', type: 'varchar', length: 50, nullable: true })
|
|
9
|
+
otp_id: string;
|
|
10
|
+
|
|
11
|
+
@Column({ name: 'service', type: 'varchar', length: 50, nullable: true })
|
|
12
|
+
service: string;
|
|
13
|
+
|
|
14
|
+
@Column({ name: 'otp', type: 'varchar', length: 50, nullable: true })
|
|
15
|
+
otp: string;
|
|
16
|
+
|
|
17
|
+
@Column({ name: 'identifier', type: 'varchar', nullable: true })
|
|
18
|
+
identifier: string;
|
|
19
|
+
|
|
20
|
+
@Column({ name: 'created_date', type: 'datetime', nullable: true })
|
|
21
|
+
created_date: Date;
|
|
22
|
+
|
|
23
|
+
@Column({name: 'expiration_date', type: 'datetime'})
|
|
24
|
+
expiration_date: Date;
|
|
25
|
+
|
|
26
|
+
@Column({name: 'verified', type: 'int', nullable: true})
|
|
27
|
+
verified: number;
|
|
28
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Module } from '@nestjs/common';
|
|
2
|
+
import { OtpService } from './service/otp.service';
|
|
3
|
+
import { OtpRepository } from './repository/otp.repository';
|
|
4
|
+
import { TypeOrmModule } from '@nestjs/typeorm';
|
|
5
|
+
import { Otp } from './entity/otp.entity';
|
|
6
|
+
import { OtpController } from './controller/otp.controller';
|
|
7
|
+
|
|
8
|
+
@Module({
|
|
9
|
+
imports: [TypeOrmModule.forFeature([Otp])],
|
|
10
|
+
providers: [OtpService, OtpRepository],
|
|
11
|
+
exports: [OtpService],
|
|
12
|
+
controllers: [OtpController]
|
|
13
|
+
})
|
|
14
|
+
export class NotificationModule {}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectRepository } from '@nestjs/typeorm';
|
|
3
|
+
import { Otp } from '../entity/otp.entity';
|
|
4
|
+
import { Repository } from 'typeorm';
|
|
5
|
+
|
|
6
|
+
@Injectable()
|
|
7
|
+
export class OtpRepository {
|
|
8
|
+
constructor(
|
|
9
|
+
@InjectRepository(Otp) private readonly otpRepository: Repository<Otp>,
|
|
10
|
+
) {}
|
|
11
|
+
|
|
12
|
+
async save(otp: Otp) {
|
|
13
|
+
return await this.otpRepository.save(otp);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async findByOtpId(otpId: string) {
|
|
17
|
+
return await this.otpRepository.findOne({
|
|
18
|
+
where: {
|
|
19
|
+
otp_id: otpId,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async update(id: number, otp: Otp){
|
|
25
|
+
return await this.otpRepository.update(id, otp);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { OtpRepository } from '../repository/otp.repository';
|
|
3
|
+
import { Otp } from '../entity/otp.entity';
|
|
4
|
+
import { ClockIDGenService } from '../../../utils/service/clockIDGenUtil.service';
|
|
5
|
+
import { ConfigService } from '@nestjs/config';
|
|
6
|
+
|
|
7
|
+
@Injectable()
|
|
8
|
+
export class OtpService {
|
|
9
|
+
constructor(
|
|
10
|
+
private readonly otpRepository: OtpRepository,
|
|
11
|
+
private readonly idGen: ClockIDGenService,
|
|
12
|
+
private configService: ConfigService,
|
|
13
|
+
) {
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
VERIFY_OTP = this.configService.get('VERIFY_OTP') || 'true';
|
|
17
|
+
DEFAULT_OTP = this.configService.get('DEFAULT_OTP') || '123456';
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
async generate(identifier: string, service: string, expiresIn: number = 5, otpLength: number = 6) {
|
|
21
|
+
let otp = new Otp();
|
|
22
|
+
otp.created_date = new Date();
|
|
23
|
+
otp.otp_id = this.idGen.idGenerator();
|
|
24
|
+
otp.identifier = identifier;
|
|
25
|
+
otp.otp = 'true' === this.VERIFY_OTP ? this.generateOtp(otpLength) : this.DEFAULT_OTP;
|
|
26
|
+
otp.service = service;
|
|
27
|
+
otp.verified = 0;
|
|
28
|
+
otp.expiration_date = new Date(Date.now() + expiresIn * 60 * 1000);
|
|
29
|
+
|
|
30
|
+
return await this.otpRepository.save(otp);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async verifyOtp(otp: string, otpId: string) {
|
|
34
|
+
let otpEntity = await this.findByOtpId(otpId);
|
|
35
|
+
if (otpEntity) {
|
|
36
|
+
if (otpEntity.otp === otp && new Date(Date.now()) <= otpEntity.expiration_date && 0 === otpEntity.verified) {
|
|
37
|
+
otpEntity.verified = 1;
|
|
38
|
+
const updatedOtp = await this.otpRepository.update(otpEntity.id, otpEntity);
|
|
39
|
+
if (updatedOtp) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
async findByOtpId(otpId: string) {
|
|
48
|
+
return await this.otpRepository.findByOtpId(otpId);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
private generateOtp(length: number): string {
|
|
52
|
+
const min = 10 ** (length - 1);
|
|
53
|
+
const max = 10 ** length - 1;
|
|
54
|
+
return Math.floor(min + Math.random() * (max - min + 1)).toString();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -18,11 +18,12 @@ export class LoginController {
|
|
|
18
18
|
constructor(private loginService: LoginService) {}
|
|
19
19
|
|
|
20
20
|
@Post('login')
|
|
21
|
+
|
|
21
22
|
async login(@Body() body, @Res() res: Response) {
|
|
22
|
-
console.log("hey")
|
|
23
23
|
return res
|
|
24
24
|
.status(HttpStatus.OK)
|
|
25
25
|
.json(await this.loginService.login(body.email_id, body.password));
|
|
26
|
+
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
@UseGuards(JwtAuthGuard)
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Body,
|
|
3
|
-
Controller,
|
|
4
|
-
HttpStatus,
|
|
5
|
-
Inject,
|
|
6
|
-
Post,
|
|
7
|
-
Res,
|
|
8
|
-
ValidationPipe,
|
|
9
|
-
} from '@nestjs/common';
|
|
10
|
-
import { UserService } from '../service/user.service';
|
|
11
|
-
import { CreateUserDto } from '../dto/create-user.dto';
|
|
12
|
-
import { Response } from 'express';
|
|
13
|
-
|
|
14
|
-
@Controller('user')
|
|
15
|
-
export class UserController {
|
|
16
|
-
constructor(
|
|
17
|
-
@Inject('UserService') private readonly userService: UserService,
|
|
18
|
-
) {}
|
|
19
|
-
|
|
20
|
-
@Post('signup')
|
|
21
|
-
async signup(
|
|
22
|
-
@Body(new ValidationPipe()) createUserDto: CreateUserDto,
|
|
23
|
-
@Res() res: Response,
|
|
24
|
-
) {
|
|
25
|
-
const result = await this.userService.createEntity(createUserDto, null);
|
|
26
|
-
res.status(HttpStatus.OK).json(result);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Controller,
|
|
4
|
+
HttpStatus,
|
|
5
|
+
Inject,
|
|
6
|
+
Post,
|
|
7
|
+
Res,
|
|
8
|
+
ValidationPipe,
|
|
9
|
+
} from '@nestjs/common';
|
|
10
|
+
import { UserService } from '../service/user.service';
|
|
11
|
+
import { CreateUserDto } from '../dto/create-user.dto';
|
|
12
|
+
import { Response } from 'express';
|
|
13
|
+
|
|
14
|
+
@Controller('user')
|
|
15
|
+
export class UserController {
|
|
16
|
+
constructor(
|
|
17
|
+
@Inject('UserService') private readonly userService: UserService,
|
|
18
|
+
) {}
|
|
19
|
+
|
|
20
|
+
@Post('signup')
|
|
21
|
+
async signup(
|
|
22
|
+
@Body(new ValidationPipe()) createUserDto: CreateUserDto,
|
|
23
|
+
@Res() res: Response,
|
|
24
|
+
) {
|
|
25
|
+
const result = await this.userService.createEntity(createUserDto, null);
|
|
26
|
+
res.status(HttpStatus.OK).json(result);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import {IsNotEmpty, IsString, Matches} from 'class-validator';
|
|
2
|
-
import {BaseEntity} from '../../meta/entity/base-entity.entity';
|
|
3
|
-
import {ENTITYTYPE_USER} from '../../../constant/global.constant';
|
|
4
|
-
import {Expose} from
|
|
1
|
+
import { IsNotEmpty, IsString, Matches } from 'class-validator';
|
|
2
|
+
import { BaseEntity } from '../../meta/entity/base-entity.entity';
|
|
3
|
+
import { ENTITYTYPE_USER } from '../../../constant/global.constant';
|
|
4
|
+
import { Expose } from 'class-transformer';
|
|
5
5
|
|
|
6
6
|
export class CreateUserDto extends BaseEntity {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.entity_type = ENTITYTYPE_USER;
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
@IsString()
|
|
13
|
+
@IsNotEmpty()
|
|
14
|
+
@Matches(/^[A-Za-z][A-Za-z]*$/, { message: 'enter valid first name' })
|
|
15
|
+
@Expose()
|
|
16
|
+
first_name: string;
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
@IsString()
|
|
19
|
+
@IsNotEmpty()
|
|
20
|
+
@Matches(/^[A-Za-z][A-Za-z]*$/, { message: 'enter valid last name' })
|
|
21
|
+
@Expose()
|
|
22
|
+
last_name: string;
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
@IsString()
|
|
25
|
+
@IsNotEmpty()
|
|
26
|
+
@Matches(
|
|
27
|
+
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/,
|
|
28
|
+
{ message: 'enter valid email' },
|
|
29
|
+
)
|
|
30
|
+
email_id: string;
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
@IsString()
|
|
33
|
+
@IsNotEmpty()
|
|
34
|
+
@Matches(
|
|
35
|
+
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$/,
|
|
36
|
+
{
|
|
37
|
+
message:
|
|
38
|
+
'Password must be at least 8 characters long, contain at least one uppercase letter, one lowercase letter, one digit, and one special character',
|
|
39
|
+
},
|
|
40
|
+
)
|
|
41
|
+
@Expose()
|
|
42
|
+
password: string;
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
@IsString()
|
|
45
|
+
@IsNotEmpty()
|
|
46
|
+
@Matches(/^[0-9]{10}$/, { message: 'enter valid contact number' })
|
|
47
|
+
@Expose()
|
|
48
|
+
mobile: string;
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
@Expose()
|
|
51
|
+
roles: any[];
|
|
52
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PartialType } from '@nestjs/mapped-types';
|
|
2
|
-
import { CreateUserDto } from './create-user.dto';
|
|
3
|
-
|
|
4
|
-
export class UpdateUserDto extends PartialType(CreateUserDto) {}
|
|
1
|
+
import { PartialType } from '@nestjs/mapped-types';
|
|
2
|
+
import { CreateUserDto } from './create-user.dto';
|
|
3
|
+
|
|
4
|
+
export class UpdateUserDto extends PartialType(CreateUserDto) {}
|