-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
1990 lines (1637 loc) · 35.8 KB
/
schema.graphql
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
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
This file was automatically generated by 'graphql-codegen'.
Please do not edit this file directly.
To regenerate this file, run `npm run generate:gql`
"""
enum AddMemberErrorCode {
ALREADY_MEMBER
USER_NOT_FOUND
}
type AddMemberErrorResponse {
code: AddMemberErrorCode!
message: String!
}
input AddMemberInput {
"""
The email of the user ot add to the organization
"""
email: String
"""
The ID of the organization to add the user to
"""
organizationId: ID!
"""
The role of the user in the organization, defaults to Role.MEMBER
"""
role: Role
"""
The ID of the user to add to the organization
"""
userId: ID
}
union AddMemberResponse = AddMemberErrorResponse | AddMemberSuccessResponse
type AddMemberSuccessResponse {
member: Member!
}
type Booking {
cabins: [Cabin!]!
createdAt: DateTime!
email: String!
endDate: DateTime!
"""
Feedback from the cabin administrators to the user, e.g. why a booking was rejected
"""
feedback: String!
firstName: String!
guests: Guests!
id: ID!
lastName: String!
phoneNumber: String!
"""
Questions/comments from the user to the cabin administrators
"""
questions: String!
startDate: DateTime!
status: BookingStatus!
"""
Total cost of the booking, in NOK
"""
totalCost: Int!
}
type BookingContact {
email: String!
id: ID!
name: String!
phoneNumber: String!
updatedAt: DateTime!
}
type BookingContactResponse {
bookingContact: BookingContact!
}
input BookingInput {
email: String!
id: ID!
}
type BookingResponse {
booking: Booking
}
type BookingSemester {
bookingsEnabled: Boolean!
endAt: DateTime!
id: ID!
semester: Semester!
startAt: DateTime!
updatedAt: DateTime!
}
type BookingSemestersResponse {
fall: BookingSemester
spring: BookingSemester
}
enum BookingStatus {
CANCELLED
CONFIRMED
PENDING
REJECTED
}
type BookingTerms {
createdAt: DateTime!
file: RemoteFile!
id: ID!
}
type BookingTermsResponse {
bookingTerms: BookingTerms
}
input BookingsInput {
status: BookingStatus
}
type BookingsResponse {
bookings: [Booking!]!
total: Int!
}
type Cabin {
capacity: Int!
externalPrice: Int!
id: ID!
internalPrice: Int!
name: String!
price: CabinPriceGroup!
}
input CabinInput {
id: ID!
}
type CabinPrice {
weekday: Int!
weekend: Int!
}
type CabinPriceGroup {
external: CabinPrice!
internal: CabinPrice!
}
type CabinsResponse {
cabins: [Cabin!]!
}
type CalendarDay {
available: Boolean!
availableForCheckIn: Boolean!
availableForCheckOut: Boolean!
bookable: Boolean!
calendarDate: DateTime!
price: Int!
}
type CalendarMonth {
days: [CalendarDay!]!
month: Int!
year: Int!
}
input CreateCabinInput {
capacity: Int!
externalPrice: Int!
externalPriceWeekend: Int!
internalPrice: Int!
internalPriceWeekend: Int!
name: String!
}
type CreateCabinResponse {
cabin: Cabin!
}
input CreateDocumentInput {
categories: [DocumentCategoryInput!]
description: String
fileExtension: String!
name: String!
}
type CreateDocumentResponse {
document: Document!
"""
The URL to upload the file to, valid for 10 minutes
"""
uploadUrl: String!
}
input CreateEventCategoryInput {
name: String!
}
type CreateEventCategoryResponse {
category: EventCategory!
}
input CreateEventInput {
event: EventData!
}
type CreateEventResponse {
event: Event!
}
input CreateEventSlot {
capacity: Int!
gradeYears: [Int!]
}
input CreateListingInput {
"""
An optional URL to the application form for the listing.
"""
applicationUrl: String
"""
At what time the listing will close, will show as a deadline to users, and the listing will be hidden afterwards
"""
closesAt: DateTime!
"""
The description of the listing, can be markdown.
"""
description: String
"""
The name of the listing, will be visible to users.
"""
name: String!
"""
The ID of the organization that the listing belongs to.
"""
organizationId: ID!
}
type CreateListingResponse {
listing: Listing!
}
input CreateMerchantInput {
"""
Client ID for the merchant, retrieved from the payment provider.
"""
clientId: String!
"""
Client secret for the merchant, retrieved from the payment provider.
"""
clientSecret: String!
"""
The name of the merchant to create.
"""
name: String!
"""
Merchant serial number for the merchant, retrieved from the payment provider.
"""
serialNumber: String!
"""
Subscription key for the merchant, retrieved from the payment provider.
"""
subscriptionKey: String!
}
type CreateMerchantResponse {
"""
The merchant that was created.
"""
merchant: Merchant!
}
input CreateOrderInput {
"""
The ID of the product to create an order for.
"""
productId: ID!
}
type CreateOrderResponse {
order: Order!
}
input CreateOrganizationInput {
"""
The primary color (hex) for the organization, for example: #FF0000 for red.
"""
colorScheme: String
"""
The description of the organization, cannot exceed 10 000 characters
"""
description: String
"""
Features to enable for the organization. Defaults to an empty list.
Requires that the current user is a super user, otherwise, this field is ignored.
"""
featurePermissions: [FeaturePermission!]
"""
The name of the organization, must be unique and between 1 and 100 characters
"""
name: String!
}
type CreateOrganizationResponse {
organization: Organization!
}
input CreateSlotInput {
capacity: Int!
gradeYears: [Int!]
}
scalar Date
scalar DateTime
type DeleteDocumentCategoryResponse {
category: DocumentCategory!
}
input DeleteDocumentInput {
id: ID!
}
type DeleteDocumentResponse {
document: Document!
}
input DeleteEventCategoryInput {
id: ID!
}
type DeleteEventCategoryResponse {
category: EventCategory!
}
input DeleteListingInput {
id: ID!
}
type DeleteListingResponse {
listing: Listing!
}
input DeleteSlotInput {
id: ID!
}
type Document {
"""
The categories the document is in
"""
categories: [DocumentCategory!]!
"""
When the document was created
"""
createdAt: DateTime!
"""
The description of the document
"""
description: String!
"""
The remote file of the document
"""
file: RemoteFile!
id: ID!
"""
The display name of the document
"""
name: String!
"""
When the document was last updated
"""
updatedAt: DateTime!
}
type DocumentCategory {
"""
The ID of the category
"""
id: ID!
"""
The name of the category
"""
name: String!
}
input DocumentCategoryInput {
name: String!
}
type DocumentCategoryResponse {
categories: [DocumentCategory!]!
total: Int!
}
input DocumentInput {
id: ID!
}
type DocumentResponse {
document: Document
}
input DocumentsCategoryInput {
id: ID!
}
input DocumentsInput {
categories: [DocumentsCategoryInput!]
}
type DocumentsResponse {
documents: [Document!]!
total: Int!
}
type Event {
"""
canSignUp is true if the current user can sign up for the event, false otherwise.
If the user is not logged in, this will be always be false.
"""
canSignUp: Boolean!
"""
categories describes the categories that the event belongs to.
"""
categories: [EventCategory!]
"""
The contact email for the event organizer.
"""
contactEmail: String!
"""
The description of the event. We support markdown on the client, so this can be markdown.
"""
description: String!
"""
The end time of the event.
"""
endAt: DateTime!
id: ID!
"""
The location of the event
"""
location: String!
"""
The name of the event.
"""
name: String!
"""
The organization that is hosting the event.
"""
organization: Organization
"""
A short description of the event, intended to be a short summary/teaser of the event.
"""
shortDescription: String!
"""
The current user's sign up for the event, if the user is signed up for the event.
"""
signUp: SignUp
"""
signUpAvailability describes the availability of sign ups for the event for the current user.
"""
signUpAvailability: SignUpAvailability!
signUpDetails: EventSignUpDetails
signUps: SignUps
signUpsEnabled: Boolean!
"""
If true, signing up for the event requires that the user submits additional information.
"""
signUpsRequireUserProvidedInformation: Boolean!
"""
If true, sign ups can be retracted for the event. Otherwise, sign ups are final.
"""
signUpsRetractable: Boolean!
"""
The start time of the event.
"""
startAt: DateTime!
"""
The ticket information for the event, if the event is a TICKETS event.
"""
ticketInformation: EventTicketInformation
type: EventType!
user: EventUser
}
type EventCategoriesResponse {
categories: [EventCategory!]!
}
type EventCategory {
id: ID!
name: String!
}
input EventCategoryInput {
id: ID!
}
input EventData {
"""
categories is a list of cateogry IDs to which the event belongs
"""
categories: [EventCategoryInput!]
"""
Contact email for the event organizer
"""
contactEmail: String
"""
The description of the event, defaults to "". We support markdown on the client, so this can be markdown.
This will be displayed to users.
"""
description: String
"""
The end time of the event. If this is not provided, the event will be assumed to be two hours long.
This will be displayed to users.
"""
endAt: DateTime
"""
Location of the event
"""
location: String
"""
The name of the event, this will be displayed to users
"""
name: String!
"""
The ID of the organization that is hosting the event. Events must be hosted by an organization, and the user
creating the event must be a member of the organization.
"""
organizationId: ID!
"""
A short description of the event, intended to be a short summary/teaser of the event.
"""
shortDescription: String
"""
If the event is a sign up event, this will be the sign up details.
"""
signUpDetails: SignUpData
"""
If sign ups are currently enabled for the event. If this is false, users cannot sign up for the event. Defaults to
false
"""
signUpsEnabled: Boolean
"""
If true, signing up requires that the user submits additional information. Defaults to false
"""
signUpsRequireUserProvidedInformation: Boolean
"""
If true, users can retract their sign up for the event. Defaults to false
"""
signUpsRetractable: Boolean
"""
The start time of the event. Events must have a start time.
"""
startAt: DateTime!
"""
The event type
- BASIC has no sign ups, and no tickets
- SIGN_UPS has sign ups, but no tickets (free event)
- TICKETS has tickets and sign ups (paid event)
"""
type: EventType!
}
input EventInput {
id: ID!
}
type EventResponse {
event: Event!
}
type EventSignUpDetails {
capacity: Int!
signUpsEndAt: DateTime!
signUpsStartAt: DateTime!
}
input EventTicketData {
"""
MerchantID is the ID for the merchant, this will be the recipient of the payments.
"""
merchantId: ID!
"""
Price in øre, i.e. 100 = 1 NOK
"""
price: Int!
}
type EventTicketInformation {
product: Product
}
enum EventTicketStatus {
BOUGHT
NOT_BOUGHT
}
enum EventType {
"""
Basic event has no sign ups, and no tickets
"""
BASIC
"""
Sign up event has sign ups, but no tickets
"""
SIGN_UPS
"""
Ticketed event has tickets and sign ups
"""
TICKETS
}
type EventUser {
"""
The ID of the user
"""
id: ID!
signUp: SignUp
ticket: Order
"""
The ticket status for the user on the event, null if it's not a ticket event
"""
ticketStatus: EventTicketStatus
}
input EventsCategoryInput {
id: ID!
}
input EventsInput {
"""
Only return events that belong to the given categories
"""
categories: [EventsCategoryInput!]
"""
Only return events that end before the given time
"""
endBefore: DateTime
"""
If true, only return events that are currently happening, or will happen in the future
i.e. events where endAt is in the future.
"""
futureEventsOnly: Boolean
"""
Only return events that are hosted by the organizations with the given IDs
"""
organizations: [EventsOrganizationInput!]
"""
Only return events that start after the given time
"""
startAfter: DateTime
}
input EventsOrganizationInput {
id: ID!
}
type EventsResponse {
"""
All events, if futureEventsOnly is false, otherwise only future events
"""
events: [Event!]!
"""
The events that start next week, by week number
"""
nextWeek: [Event!]!
"""
The events that start this week, by week number
"""
thisWeek: [Event!]!
"""
The total number of events returned by this query (for now)
"""
total: Int!
"""
The events that start in two weeks or later, by week number
"""
twoWeeksOrLater: [Event!]!
}
enum FeaturePermission {
ARCHIVE_VIEW_DOCUMENTS
ARCHIVE_WRITE_DOCUMENTS
CABIN_ADMIN
EVENT_WRITE_SIGN_UPS
}
input GetAvailabilityCalendarInput {
cabins: [CabinInput!]!
count: Int!
guests: GuestsInput!
month: Int!
year: Int!
}
type GetAvailabilityCalendarResponse {
calendarMonths: [CalendarMonth!]!
}
type Guests {
external: Int!
internal: Int!
}
input GuestsInput {
external: Int!
internal: Int!
}
input HasFeaturePermissionInput {
featurePermission: FeaturePermission!
}
type HasFeaturePermissionResponse {
hasFeaturePermission: Boolean!
id: FeaturePermission!
}
input HasRoleInput {
organizationId: ID!
role: Role!
}
type HasRoleResponse {
hasRole: Boolean!
}
input InitiatePaymentAttemptInput {
"""
The ID of the order to initiate a payment attempt for.
"""
orderId: ID!
"""
The return URL to redirect the user to after the payment attempt has been completed.
"""
returnUrl: String!
}
type InitiatePaymentAttemptResponse {
"""
The URL to redirect the user to in order to complete the payment.
"""
redirectUrl: String!
}
type Listing {
"""
An optional URL to the application form for the listing, defaults to ""
"""
applicationUrl: String!
"""
When the listing closes, i.e. deadline, or when the listing is hidden from view.
"""
closesAt: DateTime!
"""
The description of the listing, can be markdown.
"""
description: String!
id: ID!
"""
The name/title of the listing, will be visible to users.
"""
name: String!
"""
The organization that the listing belongs to.
"""
organization: Organization!
}
input ListingInput {
id: ID!
}
type ListingResponse {
listing: Listing!
}
type ListingsResponse {
listings: [Listing!]!
}
type Member {
id: ID!
"""
The organization the member is a member of
"""
organization: Organization!
"""
The role of the member in the organization
"""
role: Role!
"""
The user that is a member of the organization
"""
user: PublicUser!
}
type Merchant {
id: ID!
name: String!
}
type MerchantsResponse {
merchants: [Merchant!]!
total: Int!
}
type Mutation {
"""
Add a member to the organization
"""
addMember(data: AddMemberInput!): AddMemberResponse!
"""
Create cabin, requires that the user is in an organization with the CABIN_ADMIN permission.
"""
createCabin(data: CreateCabinInput!): CreateCabinResponse!
createDocument(data: CreateDocumentInput!): CreateDocumentResponse!
"""
Create an event, requires that the user is logged in, and is a member of the organization that is hosting the event
"""
createEvent(data: CreateEventInput!): CreateEventResponse!
"""
Create a new event category, requires super user status
"""
createEventCategory(
data: CreateEventCategoryInput!
): CreateEventCategoryResponse!
createListing(data: CreateListingInput!): CreateListingResponse!
"""
Create a new Vipps merchant, and return the created merchant.
Requires super user status.
"""
createMerchant(data: CreateMerchantInput!): CreateMerchantResponse!
"""
Creates an order for the given product.
"""
createOrder(data: CreateOrderInput!): CreateOrderResponse!
"""
Create a new organization, and add the current user as an admin of the organization.
"""
createOrganization(
data: CreateOrganizationInput!
): CreateOrganizationResponse!
deleteDocument(data: DeleteDocumentInput!): DeleteDocumentResponse!
"""
Delete an event category, requires super user status
"""
deleteEventCategory(
data: DeleteEventCategoryInput!
): DeleteEventCategoryResponse!
deleteListing(data: DeleteListingInput!): DeleteListingResponse!
"""
Initiates a payment attempt for the given order.
"""
initiatePaymentAttempt(
data: InitiatePaymentAttemptInput!
): InitiatePaymentAttemptResponse!
newBooking(data: NewBookingInput!): NewBookingResponse!
"""
Remove a member from the organization by the ID of the membership.
"""
removeMember(data: RemoveMemberInput!): RemoveMemberResponse!
"""
Remove an active sign up for an event, requires that the user is logged in and a member of the organization that is hosting the event
"""
removeSignUp(data: RemoveSignUpInput!): RemoveSignUpResponse!
"""
Retract an active sign up for an event, requires that the user is logged in
"""
retractSignUp(data: RetractSignUpInput!): RetractSignUpResponse!
"""
Sign up for an event, requires that the user is logged in
"""
signUp(data: SignUpInput!): SignUpResponse!
"""
Update the user with the given ID with super user privileges, requires that
the caller is an authenticated super user. Otherwise, use updateUser.
"""
superUpdateUser(
data: SuperUpdateUserInput!
id: ID!
): SuperUpdateUserResponse!
"""
Updates the booking contact, requires that the user is in an organization with the CABIN_ADMIN permission.
"""
updateBookingContact(
data: UpdateBookingContactInput!
): UpdateBookingContactResponse!
"""
Updates the booking semester for the given semester, requires that the user is in an organization with
the CABIN_ADMIN permission.
"""
updateBookingSemester(
data: UpdateBookingSemesterInput!
): UpdateBookingSemesterResponse!
updateBookingStatus(data: UpdateBookingStatusInput!): UpdateBookingResponse!
"""
Update the bookingTerms for cabins, requires that the user is in an organization with the CABIN_ADMIN permission.
"""
updateBookingTerms: UpdateBookingTermsResponse!
"""
Updates the cabin with the given ID, requires that the user is in an organization with the CABIN_ADMIN permission.
"""
updateCabin(data: UpdateCabinInput!): UpdateCabinResponse!
updateDocument(data: UpdateDocumentInput!): UpdateDocumentResponse!