Skip to content

Commit 73ff3eb

Browse files
committed
Prettier eslint and fix
1 parent 10b9ed6 commit 73ff3eb

18 files changed

+1537
-970
lines changed

.babelrc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"presets": [
3-
[
4-
"env",
5-
{
6-
"targets": {
7-
"node": "10.11.0"
8-
}
9-
}
10-
]
3+
[
4+
"env",
5+
{
6+
"targets": {
7+
"node": "10.11.0"
8+
}
9+
}
10+
]
1111
],
1212
"plugins": []
1313
}

.eslintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"extends": ["airbnb-base"],
33
"env": {
44
"es6": true,
5-
"browser": true
5+
"node": true,
6+
"jest/globals": true
67
},
78
"parser": "babel-eslint",
89
"parserOptions": {
@@ -54,7 +55,7 @@
5455

5556
"import/extensions": 1
5657
},
57-
"plugins": ["prettier"],
58+
"plugins": ["prettier", "jest"],
5859
"settings": {
5960
"import/resolver": {
6061
"node": {

__tests__/Schema.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ import {graphql} from 'graphql';
88

99
import schema from '../schema.graphql';
1010

11+
const gql = String.raw;
12+
1113
const getUserTest = {
1214
id: 'Get User',
13-
query: `
15+
query: gql`
1416
query {
1517
me {
1618
id
@@ -55,7 +57,7 @@ describe('Schema', () => {
5557
id, query, variables, context: ctx, expected,
5658
} = obj;
5759

58-
test(`query: ${id}`, async () => await expect(
60+
test(`query: ${id}`, () => expect(
5961
graphql(mockSchema, query, null, {ctx}, variables),
6062
).resolves.toEqual(expected));
6163
});

datamodel.prisma

Lines changed: 128 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
11
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
77
}
88

99
# Represents a company or an individual that is going to receive an invoice
1010
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")
2424
}
2525

2626
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
3333
}
3434

3535
enum QuoteTemplate {
36-
BLANK
37-
WEBSITE
38-
IDENTITY
36+
BLANK
37+
WEBSITE
38+
IDENTITY
3939
}
4040

4141
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
4848
}
4949

5050
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
5858
}
5959

6060
enum ReminderStatus {
61-
PENDING
62-
SENT
63-
ERROR
64-
CANCELED
61+
PENDING
62+
SENT
63+
ERROR
64+
CANCELED
6565
}
6666

6767
enum JobType {
@@ -80,115 +80,115 @@ type CommentView {
8080
}
8181

8282
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!
9292
}
9393

9494
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")
106106
}
107107

108108
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")
113113
}
114114

115115
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")
121121
}
122122

123123
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")
140140
}
141141

142142
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")
157157
}
158158

159159
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!
175175
}
176176

177177
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)
184184
}
185185

186186
type Log {
187-
ip: String!
187+
ip: String!
188188
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!
192192
}
193193

194194
type File {

0 commit comments

Comments
 (0)