rez_core 2.0.73 → 2.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "2.0.73",
3
+ "version": "2.0.75",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -23,10 +23,10 @@ export class EnterpriseData {
23
23
  @Column({ name: 'modified_by', type: 'int', nullable: true })
24
24
  modified_by: number;
25
25
 
26
- @Column({ name: 'created_date', type: 'datetime', nullable: true })
26
+ @Column({ name: 'created_date', nullable: true })
27
27
  created_date: Date;
28
28
 
29
- @Column({ name: 'modified_date', type: 'datetime', nullable: true })
29
+ @Column({ name: 'modified_date', nullable: true })
30
30
  modified_date: Date;
31
31
 
32
32
  @Column({ name: 'appcode', type: 'varchar', nullable: true, length: 50 })
@@ -297,7 +297,7 @@ export class FilterService {
297
297
  case 'contains':
298
298
  return {
299
299
  query: `LOWER(e.${attr}) LIKE :${key}`,
300
- params: { [key]: `%${val.toLowerCase()}%` },
300
+ params: { [key]: `%${val?val.toLowerCase():""}%` },
301
301
  };
302
302
  case 'equal':
303
303
  return {
@@ -40,7 +40,6 @@ export class BaseEntity {
40
40
 
41
41
  @Column({
42
42
  name: 'created_date',
43
- type: 'datetime',
44
43
  nullable: true,
45
44
  })
46
45
  @Expose()
@@ -50,7 +49,7 @@ export class BaseEntity {
50
49
  @Expose()
51
50
  modified_by: number;
52
51
 
53
- @Column({ name: 'modified_date', type: 'datetime', nullable: true })
52
+ @Column({ name: 'modified_date', nullable: true })
54
53
  @Expose()
55
54
  modified_date: Date;
56
55
 
@@ -36,7 +36,6 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
36
36
  manager?: EntityManager | null,
37
37
  appcode?: string,
38
38
  ) {
39
-
40
39
  if (!entityData.entity_type) {
41
40
  throw new BadRequestException(`EntityType is missing`);
42
41
  }
@@ -85,6 +84,7 @@ export class EntityServiceImpl implements EntityService<BaseEntity> {
85
84
  entityData.enterprise_id = loggedInUser.enterprise_id;
86
85
  if (!entityData.level_type)
87
86
  entityData.level_type = loggedInUser.level_type;
87
+
88
88
  if (!entityData.level_id) entityData.level_id = loggedInUser.level_id;
89
89
  }
90
90
 
@@ -17,10 +17,10 @@ export class Otp {
17
17
  @Column({ name: 'identifier', type: 'varchar', nullable: true })
18
18
  identifier: string;
19
19
 
20
- @Column({ name: 'created_date', type: 'datetime', nullable: true })
20
+ @Column({ name: 'created_date', nullable: true })
21
21
  created_date: Date;
22
22
 
23
- @Column({name: 'expiration_date', type: 'datetime'})
23
+ @Column({name: 'expiration_date'})
24
24
  expiration_date: Date;
25
25
 
26
26
  @Column({name: 'verified', type: 'int', nullable: true})
@@ -38,10 +38,10 @@ export class ThirdPartyApiRegistry {
38
38
  @Column({ nullable: true })
39
39
  is_active: number;
40
40
 
41
- @Column({ nullable: true, type: 'datetime' })
41
+ @Column({ nullable: true })
42
42
  created_date: Date;
43
43
 
44
- @Column({ nullable: true, type: 'datetime' })
44
+ @Column({ nullable: true })
45
45
  modified_date: Date;
46
46
 
47
47
  @Column({ nullable: true})
@@ -36,8 +36,10 @@ export class RoleService extends EntityServiceImpl {
36
36
  if (
37
37
  await this.roleRepository.isRoleNameWithLevelExists(role.name, {
38
38
  organization_id: loggedInUser?.organization_id || undefined,
39
- level_type: loggedInUser?.level_type,
40
- level_id: parseInt(loggedInUser?.level_id || '', 10),
39
+ level_type: entityData.level_type || loggedInUser?.level_type,
40
+ level_id:
41
+ parseInt(entityData.level_id) ||
42
+ parseInt(loggedInUser?.level_id || '', 10),
41
43
  })
42
44
  ) {
43
45
  throw new BadRequestException('Role code already exists.');