1
1
type Address {
2
- id : ID ! @unique
3
- street : String
4
- city : String
5
- postalCode : String
6
- country : String
2
+ id : ID ! @unique
3
+ street : String
4
+ city : String
5
+ postalCode : String
6
+ country : String
7
7
}
8
8
9
9
# Represents a company or an individual that is going to receive an invoice
10
10
type Customer {
11
- id : ID ! @unique
12
- name : String
13
- firstName : String !
14
- lastName : String !
15
- email : String !
16
- address : Address
17
- phone : String
18
- siret : String
19
- rcs : String
20
- rm : String
21
- serviceCompany : Company ! @relation (name : " CompanyCustomers " )
22
- quotes : [Quote!]! @relation (name : " CustomerQuotes " )
23
- commentViews : [CommentView!]! @relation (name : " CommentViewCustomer " )
11
+ id : ID ! @unique
12
+ name : String
13
+ firstName : String !
14
+ lastName : String !
15
+ email : String !
16
+ address : Address
17
+ phone : String
18
+ siret : String
19
+ rcs : String
20
+ rm : String
21
+ serviceCompany : Company ! @relation (name : " CompanyCustomers " )
22
+ quotes : [Quote!]! @relation (name : " CustomerQuotes " )
23
+ commentViews : [CommentView!]! @relation (name : " CommentViewCustomer " )
24
24
}
25
25
26
26
enum QuoteStatus {
27
- DRAFT
28
- SENT
29
- ACCEPTED
30
- REJECTED
31
- INVOICED
32
- INVOICED_ACCEPTED
27
+ DRAFT
28
+ SENT
29
+ ACCEPTED
30
+ REJECTED
31
+ INVOICED
32
+ INVOICED_ACCEPTED
33
33
}
34
34
35
35
enum QuoteTemplate {
36
- BLANK
37
- WEBSITE
38
- IDENTITY
36
+ BLANK
37
+ WEBSITE
38
+ IDENTITY
39
39
}
40
40
41
41
enum ItemStatus {
42
- PENDING
43
- FINISHED
44
- UPDATED
45
- UPDATED_SENT
46
- ADDED
47
- ADDED_SENT
42
+ PENDING
43
+ FINISHED
44
+ UPDATED
45
+ UPDATED_SENT
46
+ ADDED
47
+ ADDED_SENT
48
48
}
49
49
50
50
enum ReminderType {
51
- QUOTE_AFTER_10_DAYS
52
- QUOTE_AFTER_15_DAYS
53
- QUOTE_AFTER_20_DAYS
54
- QUOTE_5_DAYS_LEFT
55
- QUOTE_2_DAYS_LEFT
56
- AMENDMENT_AFTER_5_DAYS
57
- AMENDMENT_AFTER_10_DAYS
51
+ QUOTE_AFTER_10_DAYS
52
+ QUOTE_AFTER_15_DAYS
53
+ QUOTE_AFTER_20_DAYS
54
+ QUOTE_5_DAYS_LEFT
55
+ QUOTE_2_DAYS_LEFT
56
+ AMENDMENT_AFTER_5_DAYS
57
+ AMENDMENT_AFTER_10_DAYS
58
58
}
59
59
60
60
enum ReminderStatus {
61
- PENDING
62
- SENT
63
- ERROR
64
- CANCELED
61
+ PENDING
62
+ SENT
63
+ ERROR
64
+ CANCELED
65
65
}
66
66
67
67
enum JobType {
@@ -80,115 +80,115 @@ type CommentView {
80
80
}
81
81
82
82
type Comment {
83
- id : ID ! @unique
84
- text : String !
85
- authorUser : User
86
- authorCustomer : Customer
87
- viewedByUser : Boolean ! @default (value : false )
88
- viewedByCustomer : Boolean ! @default (value : false )
89
- views : [CommentView!]! @relation (name : " CommentViews " )
90
- item : Item ! @relation (name : " ItemComments " )
91
- createdAt : DateTime !
83
+ id : ID ! @unique
84
+ text : String !
85
+ authorUser : User
86
+ authorCustomer : Customer
87
+ viewedByUser : Boolean ! @default (value : false )
88
+ viewedByCustomer : Boolean ! @default (value : false )
89
+ views : [CommentView!]! @relation (name : " CommentViews " )
90
+ item : Item ! @relation (name : " ItemComments " )
91
+ createdAt : DateTime !
92
92
}
93
93
94
94
type Item {
95
- id : ID ! @unique
96
- name : String !
97
- description : String @default (value : " " )
98
- unitPrice : Int ! @default (value : 0 )
99
- # when unit has been changed but not yet validated
100
- pendingUnit : Float
101
- unit : Float @default (value : 0 )
102
- comments : [Comment!]! @relation (name : " ItemComments " )
103
- vatRate : Int ! @default (value : 0 )
104
- status : ItemStatus ! @default (value : PENDING )
105
- section : Section ! @relation (name : " SectionItems " )
95
+ id : ID ! @unique
96
+ name : String !
97
+ description : String @default (value : " " )
98
+ unitPrice : Int ! @default (value : 0 )
99
+ # when unit has been changed but not yet validated
100
+ pendingUnit : Float
101
+ unit : Float @default (value : 0 )
102
+ comments : [Comment!]! @relation (name : " ItemComments " )
103
+ vatRate : Int ! @default (value : 0 )
104
+ status : ItemStatus ! @default (value : PENDING )
105
+ section : Section ! @relation (name : " SectionItems " )
106
106
}
107
107
108
108
type Section {
109
- id : ID ! @unique
110
- name : String !
111
- items : [Item!]! @relation (name : " SectionItems " , onDelete : CASCADE )
112
- option : Option ! @relation (name : " OptionSections " )
109
+ id : ID ! @unique
110
+ name : String !
111
+ items : [Item!]! @relation (name : " SectionItems " , onDelete : CASCADE )
112
+ option : Option ! @relation (name : " OptionSections " )
113
113
}
114
114
115
115
type Option {
116
- id : ID ! @unique
117
- name : String !
118
- proposal : Json ! @default (value : " {}" )
119
- sections : [Section!]! @relation (name : " OptionSections " , onDelete : CASCADE )
120
- quote : Quote ! @relation (name : " QuoteOptions " )
116
+ id : ID ! @unique
117
+ name : String !
118
+ proposal : Json ! @default (value : " {}" )
119
+ sections : [Section!]! @relation (name : " OptionSections " , onDelete : CASCADE )
120
+ quote : Quote ! @relation (name : " QuoteOptions " )
121
121
}
122
122
123
123
type Quote {
124
- id : ID ! @unique
125
- name : String !
126
- template : QuoteTemplate @default (value : BLANK )
127
- customer : Customer ! @relation (name : " CustomerQuotes " )
128
- # this token is a way to restrict access to anyone else than the customer
129
- token : String ! @unique
130
- status : QuoteStatus ! @default (value : DRAFT )
131
- options : [Option!]! @relation (name : " QuoteOptions " , onDelete : CASCADE )
132
- viewedByCustomer : Boolean ! @default (value : false )
133
- reminders : [Reminder!]! @relation (name : " QuoteReminders " , onDelete : CASCADE )
134
- issuedAt : DateTime
135
- createdAt : DateTime !
136
- updatedAt : DateTime !
137
-
138
- acceptedQuotesLogs : [Log!]! @relation (name : " AcceptedQuotesLogs " )
139
- acceptedAmendmentsLogs : [Log!]! @relation (name : " AcceptedAmendmentsLogs " )
124
+ id : ID ! @unique
125
+ name : String !
126
+ template : QuoteTemplate @default (value : BLANK )
127
+ customer : Customer ! @relation (name : " CustomerQuotes " )
128
+ # this token is a way to restrict access to anyone else than the customer
129
+ token : String ! @unique
130
+ status : QuoteStatus ! @default (value : DRAFT )
131
+ options : [Option!]! @relation (name : " QuoteOptions " , onDelete : CASCADE )
132
+ viewedByCustomer : Boolean ! @default (value : false )
133
+ reminders : [Reminder!]! @relation (name : " QuoteReminders " , onDelete : CASCADE )
134
+ issuedAt : DateTime
135
+ createdAt : DateTime !
136
+ updatedAt : DateTime !
137
+
138
+ acceptedQuotesLogs : [Log!]! @relation (name : " AcceptedQuotesLogs " )
139
+ acceptedAmendmentsLogs : [Log!]! @relation (name : " AcceptedAmendmentsLogs " )
140
140
}
141
141
142
142
type Company {
143
- id : ID ! @unique
144
- name : String
145
- owner : User ! @relation (name : " CompanyOwner " )
146
- email : String
147
- address : Address
148
- phone : String
149
- type : String
150
- siret : String
151
- rcs : String
152
- rcsCity : String
153
- rm : String
154
- vat : String
155
- logo : File @relation (name : " CompanyLogo " )
156
- customers : [Customer!]! @relation (name : " CompanyCustomers " )
143
+ id : ID ! @unique
144
+ name : String
145
+ owner : User ! @relation (name : " CompanyOwner " )
146
+ email : String
147
+ address : Address
148
+ phone : String
149
+ type : String
150
+ siret : String
151
+ rcs : String
152
+ rcsCity : String
153
+ rm : String
154
+ vat : String
155
+ logo : File @relation (name : " CompanyLogo " )
156
+ customers : [Customer!]! @relation (name : " CompanyCustomers " )
157
157
}
158
158
159
159
type User {
160
- id : ID ! @unique
161
- email : String ! @unique
162
- password : String !
163
- firstName : String !
164
- lastName : String !
165
- company : Company ! @relation (name : " CompanyOwner " )
166
- defaultDailyPrice : Int @default (value : 350 )
167
- defaultVatRate : Int @default (value : 20 )
168
- commentViews : [CommentView!]! @relation (name : " CommentViewUser " )
169
- workingFields : [String!]!
170
- jobType : JobType
171
- interestedFeatures : [String!]!
172
- hasUpcomingProject : Boolean
173
- createdAt : DateTime !
174
- updatedAt : DateTime !
160
+ id : ID ! @unique
161
+ email : String ! @unique
162
+ password : String !
163
+ firstName : String !
164
+ lastName : String !
165
+ company : Company ! @relation (name : " CompanyOwner " )
166
+ defaultDailyPrice : Int @default (value : 350 )
167
+ defaultVatRate : Int @default (value : 20 )
168
+ commentViews : [CommentView!]! @relation (name : " CommentViewUser " )
169
+ workingFields : [String!]!
170
+ jobType : JobType
171
+ interestedFeatures : [String!]!
172
+ hasUpcomingProject : Boolean
173
+ createdAt : DateTime !
174
+ updatedAt : DateTime !
175
175
}
176
176
177
177
type Reminder {
178
- id : ID ! @unique
179
- quote : Quote ! @relation (name : " QuoteReminders " )
180
- postHookId : String !
181
- type : ReminderType !
182
- sendingDate : DateTime !
183
- status : ReminderStatus @default (value : PENDING )
178
+ id : ID ! @unique
179
+ quote : Quote ! @relation (name : " QuoteReminders " )
180
+ postHookId : String !
181
+ type : ReminderType !
182
+ sendingDate : DateTime !
183
+ status : ReminderStatus @default (value : PENDING )
184
184
}
185
185
186
186
type Log {
187
- ip : String !
187
+ ip : String !
188
188
189
- acceptedQuotes : [Quote!]! @relation (name : " AcceptedQuotesLogs " )
190
- acceptedAmendments : [Quote!]! @relation (name : " AcceptedAmendmentsLogs " )
191
- createdAt : DateTime !
189
+ acceptedQuotes : [Quote!]! @relation (name : " AcceptedQuotesLogs " )
190
+ acceptedAmendments : [Quote!]! @relation (name : " AcceptedAmendmentsLogs " )
191
+ createdAt : DateTime !
192
192
}
193
193
194
194
type File {
0 commit comments