@things-factory/quotation 8.0.0-beta.8 → 8.0.0

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.
@@ -0,0 +1,61 @@
1
+ import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'
2
+ import GraphQLUpload from 'graphql-upload/GraphQLUpload.js'
3
+ import { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'
4
+
5
+ import { ObjectRef, ScalarObject } from '@things-factory/shell'
6
+
7
+ import { Quotation, QuotationStatus } from './quotation'
8
+
9
+ @InputType()
10
+ export class NewQuotation {
11
+ @Field()
12
+ name: string
13
+
14
+ @Field({ nullable: true })
15
+ description?: string
16
+
17
+ @Field(type => QuotationStatus, { nullable: true })
18
+ state?: QuotationStatus
19
+
20
+ @Field({ nullable: true })
21
+ active?: boolean
22
+
23
+ @Field({ nullable: true })
24
+ params?: string
25
+
26
+ @Field(type => GraphQLUpload, { nullable: true })
27
+ thumbnail?: FileUpload
28
+ }
29
+
30
+ @InputType()
31
+ export class QuotationPatch {
32
+ @Field(type => ID, { nullable: true })
33
+ id?: string
34
+
35
+ @Field({ nullable: true })
36
+ name?: string
37
+
38
+ @Field({ nullable: true })
39
+ description?: string
40
+
41
+ @Field(type => QuotationStatus, { nullable: true })
42
+ state?: QuotationStatus
43
+
44
+ @Field({ nullable: true })
45
+ active?: boolean
46
+
47
+ @Field(type => GraphQLUpload, { nullable: true })
48
+ thumbnail?: FileUpload
49
+
50
+ @Field({ nullable: true })
51
+ cuFlag?: string
52
+ }
53
+
54
+ @ObjectType()
55
+ export class QuotationList {
56
+ @Field(type => [Quotation])
57
+ items: Quotation[]
58
+
59
+ @Field(type => Int)
60
+ total: number
61
+ }
@@ -0,0 +1,97 @@
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'
13
+ import { ObjectType, Field, Int, ID, registerEnumType } from 'type-graphql'
14
+
15
+ import { Domain } from '@things-factory/shell'
16
+ import { User } from '@things-factory/auth-base'
17
+
18
+ export enum QuotationStatus {
19
+ STATUS_A = 'STATUS_A',
20
+ STATUS_B = 'STATUS_B'
21
+ }
22
+
23
+ registerEnumType(QuotationStatus, {
24
+ name: 'QuotationStatus',
25
+ description: 'state enumeration of a quotation'
26
+ })
27
+
28
+ @Entity()
29
+ @Index('ix_quotation_0', (quotation: Quotation) => [quotation.domain, quotation.name, quotation.deletedAt], {
30
+ unique: true
31
+ })
32
+ @ObjectType({ description: 'Entity for Quotation' })
33
+ export class Quotation {
34
+ @PrimaryGeneratedColumn('uuid')
35
+ @Field(type => ID)
36
+ readonly id: string
37
+
38
+ @VersionColumn()
39
+ @Field({ nullable: true })
40
+ version?: number = 1
41
+
42
+ @ManyToOne(type => Domain)
43
+ @Field(type => Domain)
44
+ domain?: Domain
45
+
46
+ @RelationId((quotation: Quotation) => quotation.domain)
47
+ domainId?: string
48
+
49
+ @Column()
50
+ @Field({ nullable: true })
51
+ name?: string
52
+
53
+ @Column({ nullable: true })
54
+ @Field({ nullable: true })
55
+ description?: string
56
+
57
+ @Column({ nullable: true })
58
+ @Field({ nullable: true })
59
+ active?: boolean
60
+
61
+ @Column({ nullable: true })
62
+ @Field({ nullable: true })
63
+ state?: QuotationStatus
64
+
65
+ @Column({ nullable: true })
66
+ @Field({ nullable: true })
67
+ params?: string
68
+
69
+ @CreateDateColumn()
70
+ @Field({ nullable: true })
71
+ createdAt?: Date
72
+
73
+ @UpdateDateColumn()
74
+ @Field({ nullable: true })
75
+ updatedAt?: Date
76
+
77
+ @DeleteDateColumn()
78
+ @Field({ nullable: true })
79
+ deletedAt?: Date
80
+
81
+ @ManyToOne(type => User, { nullable: true })
82
+ @Field(type => User, { nullable: true })
83
+ creator?: User
84
+
85
+ @RelationId((quotation: Quotation) => quotation.creator)
86
+ creatorId?: string
87
+
88
+ @ManyToOne(type => User, { nullable: true })
89
+ @Field(type => User, { nullable: true })
90
+ updater?: User
91
+
92
+ @RelationId((quotation: Quotation) => quotation.updater)
93
+ updaterId?: string
94
+
95
+ @Field(type => String, { nullable: true })
96
+ thumbnail?: string
97
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "extends": "../../tsconfig-base.json",
3
+ "compilerOptions": {
4
+ "strict": false,
5
+ "module": "commonjs",
6
+ "outDir": "../dist-server",
7
+ "baseUrl": "./"
8
+ },
9
+ "include": ["./**/*"]
10
+ }