@things-factory/work-shift 8.0.0 → 9.0.0-beta.3

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.
@@ -1,92 +0,0 @@
1
- import {
2
- Column,
3
- CreateDateColumn,
4
- Entity,
5
- Index,
6
- ManyToOne,
7
- PrimaryGeneratedColumn,
8
- RelationId,
9
- UpdateDateColumn
10
- } from 'typeorm'
11
- import { Field, ID, Int, ObjectType, registerEnumType } from 'type-graphql'
12
-
13
- import { Domain } from '@things-factory/shell'
14
- import { User } from '@things-factory/auth-base'
15
-
16
- export enum WorkShiftDateType {
17
- TheDayBefore = -1,
18
- TheDay = 0,
19
- TheDayAfter = 1
20
- }
21
-
22
- registerEnumType(WorkShiftDateType, {
23
- name: 'WorkShiftDateType',
24
- description: 'enumeration of a shift date'
25
- })
26
-
27
- @Entity()
28
- @Index('ix_work_shift_0', (workShift: WorkShift) => [workShift.domain, workShift.name], { unique: true })
29
- @Index('ix_work_shift_1', (workShift: WorkShift) => [workShift.domain, workShift.fromDate, workShift.fromTime], {
30
- unique: true
31
- })
32
- @ObjectType({ description: 'Entity for WorkShift' })
33
- export class WorkShift {
34
- @PrimaryGeneratedColumn('uuid')
35
- @Field(type => ID)
36
- readonly id: string
37
-
38
- @ManyToOne(type => Domain)
39
- @Field(type => Domain)
40
- domain?: Domain
41
-
42
- @RelationId((workShift: WorkShift) => workShift.domain)
43
- domainId?: string
44
-
45
- @Column()
46
- @Field()
47
- name: string
48
-
49
- @Column({
50
- nullable: true
51
- })
52
- @Field({ nullable: true })
53
- description?: string
54
-
55
- @Column()
56
- @Field({ nullable: true })
57
- fromDate: WorkShiftDateType
58
-
59
- @Column()
60
- @Field({ nullable: true })
61
- fromTime: string
62
-
63
- @Column()
64
- @Field({ nullable: true })
65
- toDate: WorkShiftDateType
66
-
67
- @Column()
68
- @Field({ nullable: true })
69
- toTime: string
70
-
71
- @CreateDateColumn()
72
- @Field({ nullable: true })
73
- createdAt?: Date
74
-
75
- @UpdateDateColumn()
76
- @Field({ nullable: true })
77
- updatedAt?: Date
78
-
79
- @ManyToOne(type => User, { nullable: true })
80
- @Field(type => User, { nullable: true })
81
- creator?: User
82
-
83
- @RelationId((workShift: WorkShift) => workShift.creator)
84
- creatorId?: string
85
-
86
- @ManyToOne(type => User, { nullable: true })
87
- @Field(type => User, { nullable: true })
88
- updater?: User
89
-
90
- @RelationId((workShift: WorkShift) => workShift.updater)
91
- updaterId?: string
92
- }
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../tsconfig-base.json",
3
- "compilerOptions": {
4
- "strict": false,
5
- "module": "commonjs",
6
- "outDir": "../dist-server",
7
- "baseUrl": "./"
8
- },
9
- "include": ["./**/*"]
10
- }