@things-factory/organization 7.0.1-alpha.73 → 7.0.1-alpha.78

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": "@things-factory/organization",
3
- "version": "7.0.1-alpha.73",
3
+ "version": "7.0.1-alpha.78",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -32,9 +32,9 @@
32
32
  "@operato/data-tree": "^2.0.0-alpha.0",
33
33
  "@operato/graphql": "^2.0.0-alpha.0",
34
34
  "@operato/shell": "^2.0.0-alpha.0",
35
- "@things-factory/auth-base": "^7.0.1-alpha.73",
36
- "@things-factory/contact": "^7.0.1-alpha.73",
35
+ "@things-factory/auth-base": "^7.0.1-alpha.78",
36
+ "@things-factory/contact": "^7.0.1-alpha.78",
37
37
  "@things-factory/shell": "^7.0.1-alpha.71"
38
38
  },
39
- "gitHead": "e642f88c83cc1b004c31786eb1c9e3a4e8d0eb59"
39
+ "gitHead": "6423c664e70e7877c362b4aebb7f169e4a2ad22d"
40
40
  }
@@ -1,4 +1,15 @@
1
- import { CreateDateColumn, UpdateDateColumn, DeleteDateColumn, Entity, Index, Column, RelationId, ManyToOne, PrimaryGeneratedColumn, VersionColumn } from 'typeorm'
1
+ import {
2
+ CreateDateColumn,
3
+ UpdateDateColumn,
4
+ DeleteDateColumn,
5
+ Entity,
6
+ Index,
7
+ Column,
8
+ RelationId,
9
+ ManyToOne,
10
+ PrimaryGeneratedColumn,
11
+ VersionColumn
12
+ } from 'typeorm'
2
13
  import { InputType, ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
3
14
 
4
15
  import { Domain, ObjectRef } from '@things-factory/shell'
@@ -36,9 +47,18 @@ export class ApprovalLineOwner {
36
47
  }
37
48
 
38
49
  @Entity()
39
- @Index('ix_approval_line_0', (approvalLine: ApprovalLine) => [approvalLine.domain, approvalLine.ownerType, approvalLine.ownerValue, approvalLine.name], {
40
- unique: true
41
- })
50
+ @Index(
51
+ 'ix_approval_line_0',
52
+ (approvalLine: ApprovalLine) => [
53
+ approvalLine.domain,
54
+ approvalLine.ownerType,
55
+ approvalLine.ownerValue,
56
+ approvalLine.name
57
+ ],
58
+ {
59
+ unique: true
60
+ }
61
+ )
42
62
  @ObjectType({ description: 'Entity for ApprovalLine' })
43
63
  export class ApprovalLine {
44
64
  @PrimaryGeneratedColumn('uuid')
@@ -46,7 +66,7 @@ export class ApprovalLine {
46
66
  readonly id: string
47
67
 
48
68
  @ManyToOne(type => Domain)
49
- @Field({ nullable: true })
69
+ @Field(type => Domain)
50
70
  domain?: Domain
51
71
 
52
72
  @RelationId((approvalLine: ApprovalLine) => approvalLine.domain)
@@ -1,7 +1,12 @@
1
1
  import { Field, ID, ObjectType } from 'type-graphql'
2
2
  import { Column, Entity, Index, ManyToOne, OneToMany, PrimaryGeneratedColumn, RelationId } from 'typeorm'
3
3
 
4
- import { HistoryActionColumn, HistoryActionType, HistoryEntityInterface, HistoryOriginalIdColumn } from '@operato/typeorm-history'
4
+ import {
5
+ HistoryActionColumn,
6
+ HistoryActionType,
7
+ HistoryEntityInterface,
8
+ HistoryOriginalIdColumn
9
+ } from '@operato/typeorm-history'
5
10
  import { Role, User } from '@things-factory/auth-base'
6
11
  import { config } from '@things-factory/env'
7
12
  import { Domain } from '@things-factory/shell'
@@ -13,10 +18,22 @@ const ORMCONFIG = config.get('ormconfig', {})
13
18
  const DATABASE_TYPE = ORMCONFIG.type
14
19
 
15
20
  @Entity()
16
- @Index('ix_department_history_0', (departmentHistory: DepartmentHistory) => [departmentHistory.originalId, departmentHistory.version], { unique: true })
17
- @Index('ix_department_history_1', (departmentHistory: DepartmentHistory) => [departmentHistory.domain, departmentHistory.originalId, departmentHistory.version], {
18
- unique: true
19
- })
21
+ @Index(
22
+ 'ix_department_history_0',
23
+ (departmentHistory: DepartmentHistory) => [departmentHistory.originalId, departmentHistory.version],
24
+ { unique: true }
25
+ )
26
+ @Index(
27
+ 'ix_department_history_1',
28
+ (departmentHistory: DepartmentHistory) => [
29
+ departmentHistory.domain,
30
+ departmentHistory.originalId,
31
+ departmentHistory.version
32
+ ],
33
+ {
34
+ unique: true
35
+ }
36
+ )
20
37
  @ObjectType({ description: 'History Entity of Department' })
21
38
  export class DepartmentHistory implements HistoryEntityInterface<Department> {
22
39
  @PrimaryGeneratedColumn('uuid')
@@ -28,7 +45,7 @@ export class DepartmentHistory implements HistoryEntityInterface<Department> {
28
45
  version?: number = 1
29
46
 
30
47
  @ManyToOne(type => Domain)
31
- @Field({ nullable: true })
48
+ @Field(type => Domain)
32
49
  domain?: Domain
33
50
 
34
51
  @RelationId((department: Department) => department.domain)
@@ -106,7 +123,12 @@ export class DepartmentHistory implements HistoryEntityInterface<Department> {
106
123
 
107
124
  @HistoryActionColumn({
108
125
  nullable: false,
109
- type: DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb' ? 'enum' : DATABASE_TYPE == 'oracle' ? 'varchar2' : 'smallint',
126
+ type:
127
+ DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
128
+ ? 'enum'
129
+ : DATABASE_TYPE == 'oracle'
130
+ ? 'varchar2'
131
+ : 'smallint',
110
132
  enum: HistoryActionType
111
133
  })
112
134
  public action!: HistoryActionType
@@ -37,7 +37,7 @@ export class Department {
37
37
  version?: number = 1
38
38
 
39
39
  @ManyToOne(type => Domain)
40
- @Field({ nullable: true })
40
+ @Field(type => Domain)
41
41
  domain?: Domain
42
42
 
43
43
  @RelationId((department: Department) => department.domain)
@@ -42,7 +42,7 @@ export class EmployeeHistory implements HistoryEntityInterface<Employee> {
42
42
  version?: number = 1
43
43
 
44
44
  @ManyToOne(type => Domain)
45
- @Field({ nullable: true })
45
+ @Field(type => Domain)
46
46
  domain?: Domain
47
47
 
48
48
  @RelationId((employee: Employee) => employee.domain)
@@ -159,8 +159,8 @@ export class EmployeeHistory implements HistoryEntityInterface<Employee> {
159
159
  DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'
160
160
  ? 'enum'
161
161
  : DATABASE_TYPE == 'oracle'
162
- ? 'varchar2'
163
- : 'smallint',
162
+ ? 'varchar2'
163
+ : 'smallint',
164
164
  enum: HistoryActionType
165
165
  })
166
166
  public action!: HistoryActionType
@@ -47,7 +47,7 @@ export class Employee {
47
47
  version?: number = 1
48
48
 
49
49
  @ManyToOne(type => Domain)
50
- @Field({ nullable: true })
50
+ @Field(type => Domain)
51
51
  domain?: Domain
52
52
 
53
53
  @RelationId((employee: Employee) => employee.domain)