rez_core 1.0.26 → 1.0.28

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.
Files changed (171) hide show
  1. package/.idea/250218_nodejs_core.iml +12 -0
  2. package/.idea/codeStyles/Project.xml +59 -0
  3. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  4. package/.idea/dataSources.xml +12 -0
  5. package/.idea/modules.xml +8 -0
  6. package/.idea/prettier.xml +6 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/dist/app.module.d.ts +0 -0
  9. package/dist/app.module.js +1 -0
  10. package/dist/app.module.js.map +1 -0
  11. package/dist/config/database.config.d.ts +3 -0
  12. package/dist/config/database.config.js +14 -6
  13. package/dist/config/database.config.js.map +1 -1
  14. package/dist/constant/global.constant.d.ts +6 -2
  15. package/dist/constant/global.constant.js +7 -3
  16. package/dist/constant/global.constant.js.map +1 -1
  17. package/dist/core.module.js +5 -2
  18. package/dist/core.module.js.map +1 -1
  19. package/dist/main.js +2 -1
  20. package/dist/main.js.map +1 -1
  21. package/dist/module/auth/auth.module.js +1 -1
  22. package/dist/module/auth/auth.module.js.map +1 -1
  23. package/dist/module/auth/guards/role.guard.js +3 -3
  24. package/dist/module/auth/strategies/google.strategy.d.ts +3 -1
  25. package/dist/module/auth/strategies/google.strategy.js +7 -5
  26. package/dist/module/auth/strategies/google.strategy.js.map +1 -1
  27. package/dist/module/auth/strategies/jwt.strategy.d.ts +4 -4
  28. package/dist/module/auth/strategies/jwt.strategy.js +8 -9
  29. package/dist/module/auth/strategies/jwt.strategy.js.map +1 -1
  30. package/dist/module/layout/controller/layout.controller.d.ts +11 -0
  31. package/dist/module/layout/controller/layout.controller.js +61 -0
  32. package/dist/module/layout/controller/layout.controller.js.map +1 -0
  33. package/dist/module/layout/dto/header.dto.d.ts +0 -0
  34. package/dist/module/layout/dto/header.dto.js +1 -0
  35. package/dist/module/layout/dto/header.dto.js.map +1 -0
  36. package/dist/module/layout/entity/header-items.entity.d.ts +10 -0
  37. package/dist/module/layout/entity/header-items.entity.js +52 -0
  38. package/dist/module/layout/entity/header-items.entity.js.map +1 -0
  39. package/dist/module/layout/entity/header-section.entity.d.ts +7 -0
  40. package/dist/module/layout/entity/header-section.entity.js +40 -0
  41. package/dist/module/layout/entity/header-section.entity.js.map +1 -0
  42. package/dist/module/layout/layout.module.d.ts +2 -0
  43. package/dist/module/layout/layout.module.js +30 -0
  44. package/dist/module/layout/layout.module.js.map +1 -0
  45. package/dist/module/layout/repository/header-items.repository.d.ts +7 -0
  46. package/dist/module/layout/repository/header-items.repository.js +36 -0
  47. package/dist/module/layout/repository/header-items.repository.js.map +1 -0
  48. package/dist/module/layout/repository/header-section.repository.d.ts +7 -0
  49. package/dist/module/layout/repository/header-section.repository.js +36 -0
  50. package/dist/module/layout/repository/header-section.repository.js.map +1 -0
  51. package/dist/module/layout/service/header-section.service.d.ts +8 -0
  52. package/dist/module/layout/service/header-section.service.js +37 -0
  53. package/dist/module/layout/service/header-section.service.js.map +1 -0
  54. package/dist/module/meta/entity/base-entity.entity.d.ts +1 -2
  55. package/dist/module/meta/entity/base-entity.entity.js +1 -2
  56. package/dist/module/meta/entity/base-entity.entity.js.map +1 -1
  57. package/dist/module/meta/entity/entity-master.entity.d.ts +1 -0
  58. package/dist/module/meta/entity/entity-master.entity.js +4 -0
  59. package/dist/module/meta/entity/entity-master.entity.js.map +1 -1
  60. package/dist/module/meta/entity/media-data.entity.d.ts +11 -0
  61. package/dist/module/meta/entity/media-data.entity.js +55 -0
  62. package/dist/module/meta/entity/media-data.entity.js.map +1 -0
  63. package/dist/module/meta/entity.module.js +8 -1
  64. package/dist/module/meta/entity.module.js.map +1 -1
  65. package/dist/module/meta/repository/media-data.repository.d.ts +9 -0
  66. package/dist/module/meta/repository/media-data.repository.js +55 -0
  67. package/dist/module/meta/repository/media-data.repository.js.map +1 -0
  68. package/dist/module/meta/service/entity-list.service.d.ts +1 -0
  69. package/dist/module/meta/service/entity-list.service.js +14 -2
  70. package/dist/module/meta/service/entity-list.service.js.map +1 -1
  71. package/dist/module/meta/service/entity-service-impl.service.d.ts +1 -1
  72. package/dist/module/meta/service/entity-service-impl.service.js +21 -4
  73. package/dist/module/meta/service/entity-service-impl.service.js.map +1 -1
  74. package/dist/module/meta/service/media-data.service.d.ts +9 -0
  75. package/dist/module/meta/service/media-data.service.js +36 -0
  76. package/dist/module/meta/service/media-data.service.js.map +1 -0
  77. package/dist/module/module/entity/menu.entity.d.ts +1 -2
  78. package/dist/module/module/entity/menu.entity.js +1 -2
  79. package/dist/module/module/entity/menu.entity.js.map +1 -1
  80. package/dist/module/module/entity/module.entity.d.ts +1 -2
  81. package/dist/module/module/entity/module.entity.js +1 -2
  82. package/dist/module/module/entity/module.entity.js.map +1 -1
  83. package/dist/module/notification/controller/otp.controller.d.ts +5 -3
  84. package/dist/module/notification/controller/otp.controller.js +7 -4
  85. package/dist/module/notification/controller/otp.controller.js.map +1 -1
  86. package/dist/module/notification/service/otp.service.d.ts +5 -3
  87. package/dist/module/notification/service/otp.service.js +7 -4
  88. package/dist/module/notification/service/otp.service.js.map +1 -1
  89. package/dist/module/user/service/login.service.d.ts +3 -1
  90. package/dist/module/user/service/login.service.js +7 -5
  91. package/dist/module/user/service/login.service.js.map +1 -1
  92. package/dist/module/user/service/user.service.d.ts +5 -3
  93. package/dist/module/user/service/user.service.js +10 -6
  94. package/dist/module/user/service/user.service.js.map +1 -1
  95. package/dist/resources/dev.properties.yaml +15 -0
  96. package/dist/resources/properties.module.d.ts +2 -0
  97. package/dist/resources/properties.module.js +25 -0
  98. package/dist/resources/properties.module.js.map +1 -0
  99. package/dist/resources/properties.yaml.d.ts +2 -0
  100. package/dist/resources/properties.yaml.js +10 -0
  101. package/dist/resources/properties.yaml.js.map +1 -0
  102. package/dist/resources/uat.properties.yaml +15 -0
  103. package/dist/tsconfig.build.tsbuildinfo +1 -1
  104. package/nest-cli.json +6 -0
  105. package/package.json +1 -1
  106. package/src/app.module.ts +0 -0
  107. package/src/config/database.config.ts +10 -5
  108. package/src/constant/global.constant.ts +13 -4
  109. package/src/core.module.ts +5 -2
  110. package/src/module/auth/auth.module.ts +3 -2
  111. package/src/module/auth/guards/jwt.guard.ts +22 -22
  112. package/src/module/auth/guards/role.guard.ts +68 -68
  113. package/src/module/auth/services/auth.service.ts +29 -29
  114. package/src/module/auth/services/jwt.service.ts +11 -11
  115. package/src/module/auth/strategies/google.strategy.ts +7 -4
  116. package/src/module/auth/strategies/jwt.strategy.ts +5 -6
  117. package/src/module/auth/strategies/local.strategy.ts +13 -13
  118. package/src/module/dev/dev.module.ts +12 -12
  119. package/src/module/dev/service/dev.service.ts +7 -7
  120. package/src/module/enterprise/entity/enterprise.entity.ts +37 -37
  121. package/src/module/enterprise/entity/organization.entity.ts +80 -80
  122. package/src/module/layout/controller/layout.controller.ts +32 -0
  123. package/src/module/layout/dto/header.dto.ts +0 -0
  124. package/src/module/layout/entity/header-items.entity.ts +28 -0
  125. package/src/module/layout/entity/header-section.entity.ts +19 -0
  126. package/src/module/layout/layout.module.ts +17 -0
  127. package/src/module/layout/repository/header-items.repository.ts +18 -0
  128. package/src/module/layout/repository/header-section.repository.ts +18 -0
  129. package/src/module/layout/service/header-section.service.ts +26 -0
  130. package/src/module/master/controller/master.controller.ts +22 -22
  131. package/src/module/meta/dto/entity-list-data.dto.ts +6 -6
  132. package/src/module/meta/entity/attribute-master.entity.ts +67 -67
  133. package/src/module/meta/entity/base-entity.entity.ts +1 -2
  134. package/src/module/meta/entity/entity-master.entity.ts +3 -0
  135. package/src/module/meta/entity/media-data.entity.ts +32 -0
  136. package/src/module/meta/entity/preference.entity.ts +65 -65
  137. package/src/module/meta/entity.module.ts +8 -1
  138. package/src/module/meta/repository/attribute-master.repository.ts +28 -28
  139. package/src/module/meta/repository/media-data.repository.ts +50 -0
  140. package/src/module/meta/repository/preference.repository.ts +20 -20
  141. package/src/module/meta/service/entity-list.service.ts +21 -2
  142. package/src/module/meta/service/entity-service-impl.service.ts +36 -11
  143. package/src/module/meta/service/media-data.service.ts +44 -0
  144. package/src/module/module/controller/menu.controller.ts +15 -15
  145. package/src/module/module/entity/menu.entity.ts +1 -2
  146. package/src/module/module/entity/module-access.entity.ts +22 -22
  147. package/src/module/module/entity/module-action.entity.ts +19 -19
  148. package/src/module/module/entity/module.entity.ts +1 -2
  149. package/src/module/notification/controller/otp.controller.ts +8 -3
  150. package/src/module/notification/service/otp.service.ts +6 -3
  151. package/src/module/user/controller/user.controller.ts +28 -28
  152. package/src/module/user/dto/update-user.dto.ts +4 -4
  153. package/src/module/user/entity/user-role-mapping.entity.ts +21 -21
  154. package/src/module/user/entity/user-session.entity.ts +61 -61
  155. package/src/module/user/entity/user.entity.ts +35 -35
  156. package/src/module/user/repository/role.repository.ts +16 -16
  157. package/src/module/user/repository/userSession.repository.ts +33 -33
  158. package/src/module/user/service/login.service.ts +7 -5
  159. package/src/module/user/service/user.service.ts +10 -7
  160. package/src/resources/dev.properties.yaml +15 -0
  161. package/src/resources/properties.module.ts +12 -0
  162. package/src/resources/properties.yaml.ts +11 -0
  163. package/src/resources/uat.properties.yaml +15 -0
  164. package/src/utils/service/encryptUtil.service.ts +97 -97
  165. package/src/utils/service/excelUtil.service.ts +15 -15
  166. package/src/utils/service/reflection-helper.service.ts +53 -53
  167. package/.env +0 -10
  168. package/dist/constant/status.constant.d.ts +0 -4
  169. package/dist/constant/status.constant.js +0 -9
  170. package/dist/constant/status.constant.js.map +0 -1
  171. package/src/constant/status.constant.ts +0 -3
@@ -1,80 +1,80 @@
1
- import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
2
-
3
- @Entity({ name: 'cr_organization' })
4
- export class OrganizationData {
5
- @PrimaryGeneratedColumn({ name: 'id', type: 'int' })
6
- id: number;
7
-
8
- @Column({ name: 'enterprise_id', type: 'int' })
9
- enterprise_id: number;
10
-
11
- @Column({ name: 'code', nullable: true })
12
- code: string;
13
-
14
- @Column({ name: 'app_code', nullable: true })
15
- appCode: string;
16
-
17
- @Column({ name: 'name', nullable: true })
18
- name: string;
19
-
20
- @Column({ name: 'status', type: 'varchar', nullable: true })
21
- status: string;
22
-
23
- @Column({ name: 'seq_no', nullable: true })
24
- seq_no: number;
25
-
26
- @Column({ name: 'created_by', nullable: true })
27
- created_by: number;
28
-
29
- @Column({ name: 'modified_by', nullable: true })
30
- modified_by: number;
31
-
32
- @Column({ name: 'created_date', nullable: true })
33
- created_date: Date;
34
-
35
- @Column({ name: 'parent_id', nullable: true })
36
- parent_id: number;
37
-
38
- @Column({ name: 'modified_date', nullable: true })
39
- modified_date: Date;
40
-
41
- @Column({ name: 'contact_number', nullable: true })
42
- contact_number: string;
43
-
44
- @Column({ name: 'email', nullable: true })
45
- emailId: string;
46
-
47
- @Column({ name: 'entity_type', nullable: true })
48
- entity_type: string;
49
-
50
- @Column({ name: 'primary_contact_name', nullable: true })
51
- primary_contact_name: string;
52
-
53
- @Column({ name: 'address', nullable: true })
54
- address: string;
55
-
56
- @Column({ name: 'gstin', nullable: true })
57
- gstin: string;
58
-
59
- @Column({ name: 'company_pan_number', nullable: true })
60
- company_pan_number: string;
61
-
62
- @Column({ name: 'bankacc_benef_name', nullable: true })
63
- bankacc_benef_name: string;
64
-
65
- @Column({ name: 'bankacc_bank_name', nullable: true })
66
- bankacc_bank_name: string;
67
-
68
- @Column({ name: 'bankacc_account_number', nullable: true })
69
- bankaccAccountNumber: string;
70
-
71
- @Column({ name: 'bankacc_branch_IFSC', nullable: true })
72
- bankacc_account_number: string;
73
-
74
- @Column({
75
- name: 'organization_type',
76
- type: 'varchar',
77
- nullable: true,
78
- })
79
- organization_type: string;
80
- }
1
+ import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
2
+
3
+ @Entity({ name: 'cr_organization' })
4
+ export class OrganizationData {
5
+ @PrimaryGeneratedColumn({ name: 'id', type: 'int' })
6
+ id: number;
7
+
8
+ @Column({ name: 'enterprise_id', type: 'int' })
9
+ enterprise_id: number;
10
+
11
+ @Column({ name: 'code', nullable: true })
12
+ code: string;
13
+
14
+ @Column({ name: 'app_code', nullable: true })
15
+ appCode: string;
16
+
17
+ @Column({ name: 'name', nullable: true })
18
+ name: string;
19
+
20
+ @Column({ name: 'status', type: 'varchar', nullable: true })
21
+ status: string;
22
+
23
+ @Column({ name: 'seq_no', nullable: true })
24
+ seq_no: number;
25
+
26
+ @Column({ name: 'created_by', nullable: true })
27
+ created_by: number;
28
+
29
+ @Column({ name: 'modified_by', nullable: true })
30
+ modified_by: number;
31
+
32
+ @Column({ name: 'created_date', nullable: true })
33
+ created_date: Date;
34
+
35
+ @Column({ name: 'parent_id', nullable: true })
36
+ parent_id: number;
37
+
38
+ @Column({ name: 'modified_date', nullable: true })
39
+ modified_date: Date;
40
+
41
+ @Column({ name: 'contact_number', nullable: true })
42
+ contact_number: string;
43
+
44
+ @Column({ name: 'email', nullable: true })
45
+ emailId: string;
46
+
47
+ @Column({ name: 'entity_type', nullable: true })
48
+ entity_type: string;
49
+
50
+ @Column({ name: 'primary_contact_name', nullable: true })
51
+ primary_contact_name: string;
52
+
53
+ @Column({ name: 'address', nullable: true })
54
+ address: string;
55
+
56
+ @Column({ name: 'gstin', nullable: true })
57
+ gstin: string;
58
+
59
+ @Column({ name: 'company_pan_number', nullable: true })
60
+ company_pan_number: string;
61
+
62
+ @Column({ name: 'bankacc_benef_name', nullable: true })
63
+ bankacc_benef_name: string;
64
+
65
+ @Column({ name: 'bankacc_bank_name', nullable: true })
66
+ bankacc_bank_name: string;
67
+
68
+ @Column({ name: 'bankacc_account_number', nullable: true })
69
+ bankaccAccountNumber: string;
70
+
71
+ @Column({ name: 'bankacc_branch_IFSC', nullable: true })
72
+ bankacc_account_number: string;
73
+
74
+ @Column({
75
+ name: 'organization_type',
76
+ type: 'varchar',
77
+ nullable: true,
78
+ })
79
+ organization_type: string;
80
+ }
@@ -0,0 +1,32 @@
1
+ import { Controller, Get, HttpStatus, Inject, Req, Res, UseGuards } from '@nestjs/common';
2
+ import { JwtAuthGuard } from '../../auth/guards/jwt.guard';
3
+ import { HeaderSectionService } from '../service/header-section.service';
4
+ import { Request, Response } from 'express';
5
+ import { UserService } from '../../user/service/user.service';
6
+ import { ENTITYTYPE_USER } from '../../../constant/global.constant';
7
+
8
+ @Controller('layout')
9
+ @UseGuards(JwtAuthGuard)
10
+ export class LayoutController {
11
+ constructor(private readonly headerSectionService: HeaderSectionService,
12
+ @Inject('UserService') private readonly userService: UserService) {}
13
+
14
+ @Get('header')
15
+ async getHeader(@Req() req: Request & { user: any }, @Res() res: Response) {
16
+ const userId = req.user.userId;
17
+ const userData = await this.userService.getEntityData(ENTITYTYPE_USER, userId);
18
+ if (userData) {
19
+ let response = await this.headerSectionService.findByOrganizationId(userData.organization_id);
20
+ return res.json({
21
+ success: true,
22
+ data: response,
23
+ message: 'Header fetched successfully'
24
+ });
25
+ } else {
26
+ return res.status(HttpStatus.BAD_REQUEST).json({
27
+ success: false,
28
+ message: 'User data not found'
29
+ })
30
+ }
31
+ }
32
+ }
File without changes
@@ -0,0 +1,28 @@
1
+ import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
2
+
3
+ @Entity({ name: 'cr_header_items' })
4
+ export class HeaderItems {
5
+ @PrimaryGeneratedColumn()
6
+ id: number;
7
+
8
+ @Column({ nullable: true })
9
+ section_id: number;
10
+
11
+ @Column({length: 50, nullable: true, type: 'varchar'})
12
+ key: string;
13
+
14
+ @Column({length: 50, nullable: true, type: 'varchar'})
15
+ type: string;
16
+
17
+ @Column({length: 50, nullable: true, type: 'varchar'})
18
+ icon: string;
19
+
20
+ @Column({length: 50, nullable: true, type: 'varchar'})
21
+ border: string;
22
+
23
+ @Column({length: 50, nullable: true, type: 'varchar'})
24
+ avatar: string;
25
+
26
+ @Column({length: 500, nullable: true, type: 'varchar'})
27
+ options: string;
28
+ }
@@ -0,0 +1,19 @@
1
+ import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
2
+
3
+ @Entity({ name: 'cr_header_sections' })
4
+ export class HeaderSection {
5
+ @PrimaryGeneratedColumn()
6
+ id: number;
7
+
8
+ @Column({ name: 'enterprise_id', type: 'int', nullable: true })
9
+ enterprise_id: number;
10
+
11
+ @Column({ nullable: true, type: 'int' })
12
+ organization_id: number;
13
+
14
+ @Column({ length: 50, type: 'varchar', nullable: true })
15
+ section_name: string;
16
+
17
+ @Column({ length: 50, type: 'varchar', nullable: true })
18
+ position: string;
19
+ }
@@ -0,0 +1,17 @@
1
+ import { Module } from '@nestjs/common';
2
+ import { TypeOrmModule } from '@nestjs/typeorm';
3
+ import { HeaderSection } from './entity/header-section.entity';
4
+ import { HeaderItems } from './entity/header-items.entity';
5
+ import { HeaderItemsRepository } from './repository/header-items.repository';
6
+ import { HeaderSectionRepository } from './repository/header-section.repository';
7
+ import { LayoutController } from './controller/layout.controller';
8
+ import { UserModule } from '../user/user.module';
9
+ import { HeaderSectionService } from './service/header-section.service';
10
+
11
+ @Module({
12
+ imports: [TypeOrmModule.forFeature([HeaderSection, HeaderItems]), UserModule],
13
+ controllers: [LayoutController],
14
+ providers: [HeaderItemsRepository, HeaderSectionRepository, HeaderSectionService],
15
+ exports: [],
16
+ })
17
+ export class LayoutModule {}
@@ -0,0 +1,18 @@
1
+ import { Injectable } from '@nestjs/common';
2
+ import { InjectRepository } from '@nestjs/typeorm';
3
+ import { HeaderItems } from '../entity/header-items.entity';
4
+ import { Repository } from 'typeorm';
5
+
6
+ @Injectable()
7
+ export class HeaderItemsRepository {
8
+ constructor(
9
+ @InjectRepository(HeaderItems)
10
+ private readonly headerItemsRepository: Repository<HeaderItems>,
11
+ ) {}
12
+
13
+ async findBySectionId(sectionId: number) {
14
+ return await this.headerItemsRepository.find({
15
+ where: { section_id: sectionId },
16
+ });
17
+ }
18
+ }
@@ -0,0 +1,18 @@
1
+ import { Injectable } from '@nestjs/common';
2
+ import { InjectRepository } from '@nestjs/typeorm';
3
+ import { Repository } from 'typeorm';
4
+ import { HeaderSection } from '../entity/header-section.entity';
5
+
6
+ @Injectable()
7
+ export class HeaderSectionRepository {
8
+ constructor(
9
+ @InjectRepository(HeaderSection)
10
+ private readonly headerSectionRepository: Repository<HeaderSection>,
11
+ ) {}
12
+
13
+ async findByOrganizationId(organizationId: number) {
14
+ return await this.headerSectionRepository.find({
15
+ where: { organization_id: organizationId },
16
+ });
17
+ }
18
+ }
@@ -0,0 +1,26 @@
1
+ import { Injectable } from '@nestjs/common';
2
+ import { HeaderSectionRepository } from '../repository/header-section.repository';
3
+ import { HeaderItemsRepository } from '../repository/header-items.repository';
4
+
5
+ @Injectable()
6
+ export class HeaderSectionService {
7
+ constructor(
8
+ private readonly headerSectionRepository: HeaderSectionRepository,
9
+ private readonly headerItemsRepository: HeaderItemsRepository,
10
+ ) {}
11
+
12
+ async findByOrganizationId(organizationId: number) {
13
+ let headerSections =
14
+ await this.headerSectionRepository.findByOrganizationId(organizationId);
15
+ let response = {};
16
+
17
+ await Promise.all(
18
+ headerSections.map(async (headerSection) => {
19
+ response[headerSection.section_name] =
20
+ await this.headerItemsRepository.findBySectionId(headerSection.id);
21
+ }),
22
+ );
23
+
24
+ return response;
25
+ }
26
+ }
@@ -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('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
+ 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,5 +1,4 @@
1
1
  import { Column, PrimaryGeneratedColumn } from 'typeorm';
2
- import { StatusType } from '../../../constant/status.constant';
3
2
  import { Expose } from 'class-transformer';
4
3
 
5
4
  export class BaseEntity {
@@ -18,7 +17,7 @@ export class BaseEntity {
18
17
  name: string;
19
18
  @Column({ name: 'status', type: 'varchar', nullable: true, length: 100 })
20
19
  @Expose()
21
- status: StatusType;
20
+ status: string;
22
21
  @Column({ name: 'parent_type', type: 'varchar', length: 100, nullable: true })
23
22
  @Expose()
24
23
  parent_type: string;
@@ -58,4 +58,7 @@ export class EntityMaster extends BaseEntity {
58
58
  nullable: true,
59
59
  })
60
60
  description: string;
61
+
62
+ @Column({ name: 'storage_type', nullable: true, length: 20 })
63
+ storage_type: string;
61
64
  }
@@ -0,0 +1,32 @@
1
+ import { Column, Entity } from 'typeorm';
2
+ import { BaseEntity } from './base-entity.entity';
3
+ import { ENTITYTYPE_MEDIA } from '../../../constant/global.constant';
4
+
5
+ @Entity({ name: 'cr_media_data' })
6
+ export class MediaData extends BaseEntity {
7
+ constructor() {
8
+ super();
9
+ this.entity_type = ENTITYTYPE_MEDIA;
10
+ }
11
+
12
+ @Column({ type: 'varchar', length: 100, nullable: true })
13
+ file_name: string;
14
+
15
+ @Column({ type: 'varchar', length: 100, nullable: true })
16
+ mapped_attribute_key: string;
17
+
18
+ @Column({ type: 'varchar', length: 50, nullable: true })
19
+ mapped_entity_type: string;
20
+
21
+ @Column({ type: 'bigint', nullable: true })
22
+ mapped_entity_id: number;
23
+
24
+ @Column({ type: 'varchar', length: 200, nullable: true })
25
+ media_url: string;
26
+
27
+ @Column({ type: 'varchar', length: 30, nullable: true })
28
+ extension: string;
29
+
30
+ @Column({ type: 'varchar', length: 50, nullable: true })
31
+ content_type: string;
32
+ }