-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema.js
349 lines (312 loc) · 8 KB
/
schema.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
const { gql } = require('apollo-server-express');
module.exports = gql`
scalar DateTime
type Rating {
providerRating: Float
requesterRating: Float
}
type User {
id: ID!
username: String!
email: String!
nic: String
fullname: String
profession: String
contactNum: String
address: String
province: String
postalCode: String
city: String
town: String
bio: String
service_providing_status: Boolean
roles: [String]
provider_rating: String
provider_review_count: String
requester_rating: String
profile_state: String
profile_url: String
rating: Rating
}
type Admin {
id: ID!
username: String!
email: String!
}
type Location {
province: String!
city: String!
town: String!
}
type BudgetRange {
lowerLimit: Float!
upperLimit: Float!
}
type JobPosting {
id: ID!
heading: String!
location: Location!
category: String!
skills: [String]!
postedBy: User!
description: String
budgetRange: BudgetRange
updatedAt: DateTime
state: String
}
type JobPostingFeed {
jobPostings: [JobPosting]!
cursor: String!
hasNextPage: Boolean!
}
type JobBid {
id: ID!
proposedAmount: Float!
proposedDate: DateTime!
detailedBreakdown: String
bidBy: User
jobPosting: JobPosting
state: String
providerReview: String
providerRating: Float
requesterReview: String
requesterRating: Float
updatedAt: DateTime
}
type ServiceRequest {
id: ID!
requester_id: ID
provider_id: ID
date: String
time: String
payMethod: String
task: String!
min_price: String
max_price: String
location: String
image1: String
image2: String
image3: String
state: String
estimate: String
requestRating: Int
requestReview: String
customerReview: String
customerRating: Int
finalAmount: String
hasPaid: Boolean
}
type Service {
id: ID!
service_name: String!
description: String!
user_type: String!
image: String
}
type Complaint {
id: ID!
complainer: User
victim: String
title: String
complaint: String!
createdAt: DateTime!
}
type Message {
body: String
to: String!
}
type Conversation {
id: ID
members: [ID]
createdAt: DateTime
}
type NewMessage {
id: ID
conversationID: ID
sender: ID
text: String
createdAt: DateTime
}
type Query {
users: [User!]!
takeUsers(accountState: String!): [User!]!
takeServiceProviders: [User!]!
searchServiceProviderbyName(name: String!): [User!]!
searchServiceProviderbyProfession(profession: String!): [User!]!
searchServiceProviderbyProfessioninProvince(
profession: String!
province: String
city: String
rating: String
): [User!]!
viewAllServiceProviders: [User!]!
me: User!
pendingServiceRequestsForMe: [ServiceRequest!]
acceptedServiceRequestsForMe: [ServiceRequest!]
startedServiceRequestsForMe: [ServiceRequest!]
completedServiceRequestsForMe: [ServiceRequest!]
canceledServiceRequestsForMe: [ServiceRequest!]
rejectedServiceRequestsForMe: [ServiceRequest!]
reviewedServiceRequestsForMe: [ServiceRequest!]
pendingServiceRequestsbyMe: [ServiceRequest!]
acceptedServiceRequestsbyMe: [ServiceRequest!]
startedServiceRequestsbyMe: [ServiceRequest!]
completedServiceRequestsbyMe: [ServiceRequest!]
canceledServiceRequestsbyMe: [ServiceRequest!]
rejectedServiceRequestsbyMe: [ServiceRequest!]
reviewedServiceRequestsbyMe: [ServiceRequest!]
jobs: [JobPosting]
jobPostingFeed(
cursor: String
province: String!
city: String!
town: String!
category: String!
): JobPostingFeed
jobPosting(id: ID!): JobPosting!
viewAllServiceTypes: [Service]
getMyBids(state: String): [JobBid]
getJobBidById(id: ID!): JobBid!
getUserbyId(id: ID!): User!
getServiceRequestByID(id: ID!): ServiceRequest!
viewAllComplaints: [Complaint!]!
viewAllServices: [Service!]!
getMyJobPostings(state: String!): [JobPosting]
getMyJobPostingBids(id: ID!): [JobBid]
conversationsOfUser: [Conversation]
getNewMessages(conversationID: ID): [NewMessage]
getReviewedRequestsofUser(id: ID): [ServiceRequest]
getMyBidsForJobPosting(postingId:ID):JobBid
}
type Mutation {
signUp(username: String!, email: String!, password: String!): String!
signIn(email: String!, password: String!): String!
adminSignUp(
username: String!
email: String!
password: String!
securityKey: String!
): String!
adminSignIn(email: String!, password: String!): String!
makeMeServiceProvider(
fullname: String!
nic: String!
profession: String!
address: String!
contactNumber: String!
province: String!
city: String!
town: String!
bio: String
postalCode:String
profile_url:String
): User!
updateMe(
fullname: String
contactNum: String
address: String
profession: String
province: String
city: String
town: String
postalCode: String
profile_url: String
): User
registerServiceRequester(
fullname: String!
contactNum: String!
address: String!
city: String!
postalCode: String!
): User!
createServiceRequest(
provider_id: ID
date: String
time: String
payMethod: String
task: String!
min_price: String
max_price: String
location: String
image1: String
image2: String
image3: String
): ServiceRequest!
createBiddingJob(
date: String
time: String
payMethod: String
task: String!
min_price: String
max_price: String
image1: String
image2: String
image3: String
): ServiceRequest!
createJobPosting(
heading: String!
province: String!
city: String!
town: String!
category: String!
skills: [String]
description: String!
lowerLimit: Float!
upperLimit: Float!
payMethod: String
): JobPosting!
createJobBid(
proposedAmount: Float!
proposedDate: String!
detailedBreakdown: String
jobPosting: ID!
): JobBid!
changeStateJobBid(jobBidId: ID!, jobBidState: String!): JobBid!
rejectJobBid(jobBidId: ID!): JobBid
createService(
service_name: String
description: String
user_type: String
image: String
): Service!
cancelServiceRequest(id: ID): ServiceRequest!
rejectServiceRequest(id: ID): ServiceRequest!
acceptServiceRequest(id: ID, estimate: String): ServiceRequest!
startServiceRequest(id: ID, estimate: String): ServiceRequest!
completeServiceRequest(id: ID, finalAmount: String): ServiceRequest!
confirmCashPayment(id: ID): ServiceRequest!
rescheduleServiceRequest(
id: ID
date: String!
time: String!
): ServiceRequest!
editServiceRequest(id: ID, task: String!): ServiceRequest!
feedbackServiceRequest(
id: ID
requestRating: Int
requestReview: String
): ServiceRequest!
customerfeedbackServiceRequest(
id: ID
customerRating: Int
customerReview: String
): ServiceRequest!
makeComplaint(
complainer: ID
victim: String
title: String
complaint: String
): Complaint!
sendMessage( body: String, to: String): Message
newConverstion(senderID: ID, recieverID: ID): Conversation
addMessage(conversationID: ID, sender: ID, text: String): NewMessage
approveServiceProvider(provider_id: ID): User!
suspendServiceProvider(provider_id: ID): User!
acceptJobBid(jobPostingId: ID!, jobBidId: ID!): JobBid!
setProfileState(providerID: ID, state: String): User!
removeServiceProvider(id: ID): User!
removeComplaint(id: ID): Boolean!
addReviewToBid(type: String, id: ID, rating: Float, review: String): JobBid
changeServiceProvidingStatus:User
}
`;