@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/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/approval-line/approval-line.js +7 -2
- package/dist-server/service/approval-line/approval-line.js.map +1 -1
- package/dist-server/service/department/department-history.js +11 -3
- package/dist-server/service/department/department-history.js.map +1 -1
- package/dist-server/service/department/department.js +1 -1
- package/dist-server/service/department/department.js.map +1 -1
- package/dist-server/service/employee/employee-history.js +1 -1
- package/dist-server/service/employee/employee-history.js.map +1 -1
- package/dist-server/service/employee/employee.js +1 -1
- package/dist-server/service/employee/employee.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/server/service/approval-line/approval-line.ts +25 -5
- package/server/service/department/department-history.ts +29 -7
- package/server/service/department/department.ts +1 -1
- package/server/service/employee/employee-history.ts +3 -3
- package/server/service/employee/employee.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@things-factory/organization",
|
|
3
|
-
"version": "7.0.1-alpha.
|
|
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.
|
|
36
|
-
"@things-factory/contact": "^7.0.1-alpha.
|
|
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": "
|
|
39
|
+
"gitHead": "6423c664e70e7877c362b4aebb7f169e4a2ad22d"
|
|
40
40
|
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
import {
|
|
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(
|
|
40
|
-
|
|
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(
|
|
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 {
|
|
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(
|
|
17
|
-
|
|
18
|
-
|
|
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(
|
|
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:
|
|
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
|
|
@@ -42,7 +42,7 @@ export class EmployeeHistory implements HistoryEntityInterface<Employee> {
|
|
|
42
42
|
version?: number = 1
|
|
43
43
|
|
|
44
44
|
@ManyToOne(type => Domain)
|
|
45
|
-
@Field(
|
|
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
|
-
|
|
163
|
-
|
|
162
|
+
? 'varchar2'
|
|
163
|
+
: 'smallint',
|
|
164
164
|
enum: HistoryActionType
|
|
165
165
|
})
|
|
166
166
|
public action!: HistoryActionType
|