-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.gql
684 lines (599 loc) · 17.9 KB
/
schema.gql
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
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
# -----------------------------------------------
# !!! THIS FILE WAS GENERATED BY TYPE-GRAPHQL !!!
# !!! DO NOT MODIFY THIS FILE BY YOURSELF !!!
# -----------------------------------------------
type AcceptedLeaseInfo {
history_id: String!
lease_id: String!
}
"""Response from USPS Address Verify API"""
type AddressVerification {
address_1: String!
address_2: String!
city: String!
state: String!
zip: String!
}
type AddressVerificationAPIResponse {
data: AddressVerification
error: String
success: Boolean!
}
"""Cas Auth Information"""
type CasAuthInfo {
auth_type: String
cas_id: String
institution_id: String
}
input CollectionFetchInput {
count: Int!
offset: Int!
}
"""Ownership Confirmation Activity"""
type ConfirmationActivity {
date_submitted: String!
full_name: String
message: String!
user_id: String!
user_type: String!
}
type DeclineInfo {
date: String!
student_id: String!
}
type Digit {
value: Float!
}
"""Represents a digit"""
type DigitAPIResponse {
data: Digit
error: String
success: Boolean!
}
"""The directions coordinates information"""
type DirectionCoordinates {
coordinates: [[Float!]!]!
distance: Float!
}
"""Feedback submission entry"""
type Feedback {
date_submitted: String!
message: String!
submitter_id: String!
tags: [String!]!
user_type: String!
}
type FeedbackAPIResponse {
data: Feedback
error: String
success: Boolean!
}
"""a collection of feedback response"""
type FeedbackCollection {
feedback_collection: [Feedback!]!
}
type FeedbackCollectionAPIResponse {
data: FeedbackCollection
error: String
success: Boolean!
}
"""Institution Model"""
type Institution {
_id: ID!
edu_suffix: String
location: InstitutionLocationInfo!
name: String!
s3_thumb_key: String
}
type InstitutionAPIResponse {
data: Institution
error: String
success: Boolean!
}
"""A collection of Institutions"""
type InstitutionList {
institutions: [Institution!]!
}
type InstitutionListAPIResponse {
data: InstitutionList
error: String
success: Boolean!
}
"""Institution Location"""
type InstitutionLocationInfo {
address: String!
city: String!
latitude: Float!
longitude: Float!
state: String!
zip: String!
}
"""Landlord model"""
type Landlord {
_id: ID!
confirmation_key: String
email: String!
first_name: String!
landlord_reset_key: String
landlord_reset_link_exp: String
last_name: String!
onboarded: Boolean
password: String
phone_number: String
type: String
user_settings: LandlordUserSettings
}
type LandlordAPIResponse {
data: Landlord
error: String
success: Boolean!
}
input LandlordInput {
_id: String
email: String
first_name: String
last_name: String
password: String
phone_number: String
}
"""Landlord User Settings"""
type LandlordUserSettings {
push_subscriptions: [PushSubscription!]!
recieve_email_notifications: Boolean!
}
"""Schema for the Lease document"""
type Lease {
_id: ID!
active: Boolean!
external_occupant: Boolean!
lease_availability_end_date: String
lease_availability_start_date: String
lease_document_id: String
lease_history: [LeaseHistory!]!
occupant_doc: Student
occupant_id: String
ownership_id: String!
price_per_month: Float!
priority: LeasePriority
student_interests: [StudentInterest!]!
students_that_declined: [DeclineInfo!]
}
type LeaseAndAvailability {
able_to_lease: Boolean!
lease: Lease!
}
"""API Response class for the Lease object."""
type LeaseAPIResponse {
data: Lease
error: String
success: Boolean!
}
"""A collection of leases"""
type LeaseCollection {
leases: [Lease!]!
}
"""API Response class for Lease collection object"""
type LeaseCollectionAPIResponse {
data: LeaseCollection
error: String
success: Boolean!
}
"""Lease Document Schema"""
type LeaseDocument {
_id: ID!
documents: [S3Document!]!
landlord_id: String!
lease_name: String!
}
"""API Response class for Lease Document"""
type LeaseDocumentAPIResponse {
data: LeaseDocument
error: String
success: Boolean!
}
"""Information about an instance of a lease's activation"""
type LeaseHistory {
_id: String
end_date: String!
price: Float!
property_images: [LeaseImageInfo!]!
review_of_landlord: ReviewAndResponse
review_of_property: ReviewAndResponse
start_date: String!
student_id: String!
}
type LeaseHistorySummary {
landlord: Landlord!
lease: Lease!
lease_history: LeaseHistory!
lease_history_id: String!
property: Property!
room_no: Int!
}
type LeaseHistorySummaryAPIResponse {
data: LeaseHistorySummary
error: String
success: Boolean!
}
type LeaseHistorySummaryCollection {
histories: [LeaseHistorySummary!]!
}
type LeaseHistorySummaryCollectionAPIResponse {
data: LeaseHistorySummaryCollection
error: String
success: Boolean!
}
"""Property Image info"""
type LeaseImageInfo {
date_uploaded: String!
s3_key: String!
}
"""Object model for the priority object for a lease"""
type LeasePriority {
end_date: String!
level: Int!
start_date: String!
}
"""Summary of lease information"""
type LeaseSummary {
institutions: [Institution!]!
lease: Lease!
lease_doc: LeaseDocument
property: Property!
room_no: Int!
students: [Student!]!
}
"""API Response for lease summary"""
type LeaseSummaryAPIResponse {
data: LeaseSummary
error: String
success: Boolean!
}
"""Input for describing the creation of a lease"""
input LeaseUpdateInput {
active: Boolean
external_occupant: Boolean
lease_id: String!
lease_priority: Int
price_per_month: Float
priority_end_date: String
priority_start_date: String
}
"""Multiple lease documents"""
type MultipleLeaseDocuments {
lease_documents: [LeaseDocument!]!
}
"""Multiple lease documents response"""
type MultipleLeaseDocumentsAPIResponse {
data: MultipleLeaseDocuments
error: String
success: Boolean!
}
type Mutation {
acceptLeaseAgreement(lease_id: String!, student_id: String!): LeaseAPIResponse!
acceptOrDeclineStudentInterest(action: String!, lease_id: String!, student_id: String!): LeaseAPIResponse!
activateLease(lease_document_id: String!, lease_end_date: String!, lease_id: String!, lease_start_date: String!, price_per_month: Float!): LeaseAPIResponse!
addImagesToProperty(property_id: String!, s3_keys: [String!]!): PropertyAPIResponse!
addLandlordResponse(history_id: String!, lease_id: String!, response_type: String!, review_response: String!): LeaseAPIResponse!
addLandlordResponseToReview(landlord_id: String!, landlord_response: String!, lease_history_id: String!, lease_id: String!): LeaseAPIResponse!
addLeaseHistory(end_date: String!, lease_id: String!, start_date: String!, student_id: String!): LeaseAPIResponse!
addNewLeaseDocument(document_keys: [String!]!, document_mimes: [String!]!, landlord_id: String!, lease_name: String!): LeaseDocumentAPIResponse!
addOwnershipConfirmationActivity(date_submitted: String!, message: String!, ownership_id: String!, user_id: String!, user_type: String!): OwnershipAPIResponse!
addOwnershipDocuments(documents_info: [OwnershipDocumentInput!]!, ownership_id: String!): OwnershipAPIResponse!
addPropertyToStudentCollection(property_id: String!, student_id: String!): PropertyCollectionEntriesAPIResponse!
addReviewForLease(landlord_rating: Float!, landlord_review: String!, lease_id: String!, property_images: [String!]!, property_rating: Float!, property_review: String!, student_id: String!): LeaseAPIResponse!
changeOwnershipStatus(new_status: String!, ownership_id: String!, status_changer_user_id: String!, status_changer_user_type: String!, with_landlord: Boolean!, with_property: Boolean!): OwnershipAPIResponse!
confirmLandlordEmail(confirm_key: String!, email: String!): LandlordAPIResponse!
confirmStudentEmail(confirm_key: String!, email: String!): StudentAPIResponse!
createLandlord(new_landlord: LandlordInput!): LandlordAPIResponse!
createOwnershipReview(address_line: String!, address_line_2: String!, city: String!, landlord_id: String!, state: String!, zip_code: String!): OwnershipAPIResponse!
createStudent(email: String!, first_name: String!, last_name: String!, password: String!, preferred_email: String): StudentAPIResponse!
declineLeaseAgreement(lease_id: String!, student_id: String!): LeaseAPIResponse!
expressInterest(lease_id: String!, student_id: String!): LeaseAPIResponse!
markStudentNotificationAsSeen(notification_id: String!, student_id: String!): StudentNotificationAPIResponse!
removeImageFromProperty(property_id: String!, s3_key: String!): PropertyAPIResponse!
removePropertyFromStudentCollection(property_id: String!, student_id: String!): PropertyCollectionEntriesAPIResponse!
resendStudentEmailConfirmation: StudentAPIResponse!
resetPassword(email: String!, new_password: String!, reset_key: String!): LandlordAPIResponse!
saveConveniencePreferences(preferences: [String!]!): StudentAPIResponse!
sendPasswordReset(email: String!): LandlordAPIResponse!
setLandlordOnboarded(landlord_id: String!): LandlordAPIResponse!
Stats_LandlordAccountCreation: StatsResponse!
Stats_LandlordLogin: StatsResponse!
Stats_LandlordOpenLease(lease_id: String!, property_id: String!): StatsResponse!
Stats_StudentAccountCreation: StatsResponse!
Stats_StudentLogin: StatsResponse!
studentEmailConfirmed: StudentAPIResponse!
submitFeedback(message: String!, submitter_id: String!, tags: [String!]!, user_type: String!): FeedbackAPIResponse!
updatePhoneNumber(landlord_id: String!, phone_number: String!): LandlordAPIResponse!
updatePropertyDetails(bathrooms: Int, description: String, furnished: Boolean, has_ac: Boolean, has_heater: Boolean, has_washer: Boolean, property_id: String!, rooms: Int, sq_ft: Int): PropertyAPIResponse!
updateStudent(_id: String!, new_student: StudentInput!): StudentAPIResponse!
updateStudentSearchStatus(id: String!, price_end: Float, price_start: Float, search_end: String, search_start: String, searching: Boolean!): StudentAPIResponse!
updateUnoccupiedLeases(leases_info: [LeaseUpdateInput!]!, ownership_id: String!): LeaseCollectionAPIResponse!
}
type NotificationAction {
action_text: String!
action_url: String!
}
type NumberAPIResponse {
data: NumberValue
error: String
success: Boolean!
}
type NumberValue {
value: Float!
}
"""Property Ownership Document Information"""
type Ownership {
_id: ID!
confirmation_activity: [ConfirmationActivity!]!
date_submitted: String!
landlord_doc: Landlord
landlord_id: String!
ownership_documents: [OwnershipDocument!]!
property_doc: Property
property_id: String
status: String!
status_change_history: [StatusChangeInfo!]!
}
type OwnershipAPIResponse {
data: Ownership
error: String
success: Boolean!
}
"""Property Ownership Collection"""
type OwnershipCollection {
ownerships: [Ownership!]!
}
type OwnershipCollectionAPIResponse {
data: OwnershipCollection
error: String
success: Boolean!
}
"""Ownership Document Information"""
type OwnershipDocument {
date_uploaded: String!
format: String!
s3_doc_key: String!
}
"""Input for adding ownership documents"""
input OwnershipDocumentInput {
format: String!
s3_doc_key: String!
}
"""Property model"""
type Property {
_id: ID!
address_line: String!
address_line_2: String
city: String!
details: PropertyDetails
directions: [PropertyDirections!]
landlord: String!
landlord_doc: Landlord
leases: [Lease!]
state: String!
zip: String!
}
type PropertyAPIResponse {
data: Property
error: String
success: Boolean!
}
"""An array of collection entries"""
type PropertyCollectionEntries {
collection_entries: [Property!]!
}
type PropertyCollectionEntriesAPIResponse {
data: PropertyCollectionEntries
error: String
success: Boolean!
}
"""Details describing the property"""
type PropertyDetails {
bathrooms: Int!
description: String!
furnished: Boolean!
has_ac: Boolean!
has_heater: Boolean!
has_washer: Boolean!
property_images: [PropertyImageInfo!]!
rooms: Int!
sq_ft: Float!
}
"""Property directions to an institution"""
type PropertyDirections {
cycling_regular_directions: [DirectionCoordinates!]
driving_car_directions: [DirectionCoordinates!]
foot_walking_directions: [DirectionCoordinates!]
institution_id: String!
}
"""Property Image info"""
type PropertyImageInfo {
date_uploaded: String!
s3_key: String!
}
"""Collection of properties"""
type PropertyList {
properties: [Property!]!
}
type PropertyListAPIResponse {
data: PropertyList
error: String
success: Boolean!
}
input PropertyReviewInput {
count: Int
offset: Int
withReviews: Boolean!
}
input PropertySearchInput {
count: Int
offset: Int
}
type PropertySearchResult {
landlord_first_name: String!
landlord_last_name: String!
landlord_rating_avg: Float!
landlord_rating_count: Int!
lease_count: Int!
price_range: [Float!]!
property: Property!
property_rating_avg: Float!
property_rating_count: Int!
}
type PropertySearchResultCollection {
search_results: [PropertySearchResult!]!
}
type PropertySearchResultCollectionAPIResult {
data: PropertySearchResultCollection
error: String
success: Boolean!
}
type PropertySummary {
landlord: Landlord!
leases: [LeaseAndAvailability!]!
property: Property!
}
type PropertySummaryAPIResponse {
data: PropertySummary
error: String
success: Boolean!
}
"""Push Subscription Details"""
type PushSubscription {
endpoint: String!
keys: PushSubscriptionKeys!
}
"""Keys for push subscription"""
type PushSubscriptionKeys {
auth: String!
p256dh: String!
}
type Query {
canAddReview(property_id: String!, student_id: String!): DigitAPIResponse!
checkEligibleForLeaseAgreement(lease_id: String!, student_id: String!): LeaseAPIResponse!
checkPasswordResetKey(email: String!, reset_key: String!): LandlordAPIResponse!
getAcceptedLeaseInfo(history_id: String!, lease_id: String!, student_id: String!): LeaseHistorySummaryAPIResponse!
getAcceptedLeases(student_id: String!): LeaseHistorySummaryCollectionAPIResponse!
getFeedback(limit: Float!, offset: Float!): FeedbackCollectionAPIResponse!
getInstitution(_id: String!): InstitutionAPIResponse!
getLandlord(_id: String!): LandlordAPIResponse!
getLeaseDocumentsForLandlord(landlord_id: String!): MultipleLeaseDocumentsAPIResponse!
getLeasesAndOccupants(ownership_id: String!): LeaseCollectionAPIResponse!
getLeaseSummary(lease_id: String!): LeaseSummaryAPIResponse!
getMatchingInstitutions(partial_name: String!): InstitutionListAPIResponse!
getOwnership(_id: String!): OwnershipAPIResponse!
getOwnershipConflicts(ownership_id: String!): OwnershipCollectionAPIResponse!
getOwnershipForProperty(landlord_id: String!, property_id: String!): OwnershipAPIResponse!
getOwnershipsForLandlord(landlord_id: String!, with_landlord: Boolean, with_properties: Boolean): OwnershipCollectionAPIResponse!
getOwnershipsInReview: OwnershipCollectionAPIResponse!
getPropertiesForLandlord(landlord_id: String!, status: String, with_leases: Boolean): PropertyListAPIResponse!
getProperty(_id: String!, reviewOptions: PropertyReviewInput!, withLandlord: Boolean!): PropertyAPIResponse!
getPropertyForOwnership(ownership_id: String!): PropertyAPIResponse!
getPropertyOwnedByLandlord(landlord_id: String!, property_id: String!, with_leases: Boolean): PropertyAPIResponse!
getPropertySummary(property_id: String!, student_id: String!): PropertySummaryAPIResponse!
getRoomNo(lease_id: String!, ownership_id: String!): NumberAPIResponse!
getStudent(_id: String!): StudentAPIResponse!
getStudentNotifications(student_id: String!): StudentNotificationAPIResponse!
getStudentSavedCollection(_id: String!, collectionOptions: CollectionFetchInput!): PropertyCollectionEntriesAPIResponse!
resendEamilConfirmation(landlord_id: String!): LandlordAPIResponse!
searchForProperties(distance: Float!, price_end: Float!, price_start: Float!, rooms: Int!): PropertySearchResultCollectionAPIResult!
searchProperties(searchOptions: PropertySearchInput!): PropertyListAPIResponse!
studentAccessShouldBeRestricted: StudentAPIResponse!
verifyAddress(address_1: String!, address_2: String!, city: String!, state: String!, zip: String!): AddressVerificationAPIResponse!
}
"""Review & Response"""
type ReviewAndResponse {
rating: Float!
response: String
review: String!
}
type S3Document {
mime_type: String!
s3_key: String!
}
"""Status of student search"""
type SearchStatus {
date_updated: String!
price_end: Float
price_start: Float
search_end: String
search_start: String
searching: Boolean!
}
type StatsResponse {
v: String!
}
"""Describes a status change in an ownership"""
type StatusChangeInfo {
changed_from: String!
changed_to: String!
date_changed: String!
status_changer_full_name: String
status_changer_user_id: String!
status_changer_user_type: String!
}
"""Student model"""
type Student {
_id: ID!
accepted_leases: [AcceptedLeaseInfo!]
auth_info: CasAuthInfo
confirmation_key: [String!]
conveinence_setup: Boolean
convenience_tags: [String!]
date_registered: String
edu_email: String
elevated_privileges: [String!]
email: String
first_name: String!
last_name: String!
notifications: [StudentNotification!]
password: String
phone_number: String
saved_collection: [String!]
search_status: SearchStatus
type: String
user_settings: StudentUserSettings
}
type StudentAPIResponse {
data: Student
error: String
success: Boolean!
}
input StudentInput {
_id: String
email: String
first_name: String
last_name: String
}
"""Student interest object"""
type StudentInterest {
accepted: Boolean
date: String!
student_id: String!
}
type StudentNotification {
_id: String!
action: NotificationAction
body: String!
date_created: String!
date_seen: String
subject: String!
}
type StudentNotificationAPIResponse {
data: StudentNotificationCollection
error: String
success: Boolean!
}
type StudentNotificationCollection {
notifications: [StudentNotification!]!
}
"""Student User Settinhs"""
type StudentUserSettings {
push_subscriptions: [PushSubscription!]!
recieve_email_notifications: Boolean!
}
type Subscription {
newFeedback: Feedback!
}