-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathusersSchema.ts
More file actions
138 lines (117 loc) · 2.89 KB
/
Copy pathusersSchema.ts
File metadata and controls
138 lines (117 loc) · 2.89 KB
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
/**
* usersSchema.ts
* GraphQL declarations for Users
*/
import { gql } from "graphql-tag";
import { UserRow } from "../../database/knex/tables.js";
export interface PassedModule {
moduleID: number;
moduleName: string;
passedDate: Date;
makerspaceID: number;
}
export interface User extends UserRow {
passedModules?: PassedModule[];
}
export const UsersTypeDefs = gql`
type PassedModule {
moduleID: ID!
moduleName: String!
passedDate: DateTime!
makerspaceID: ID
}
type User {
id: ID!
firstName: String!
lastName: String!
pronouns: String
isStudent: Boolean!
registrationDate: DateTime!
admin: Boolean!
holds: [Hold]
passedModules: [PassedModule]
accessChecks: [AccessCheck]
expectedGraduation: String
college: String
cardTagID: String
room: Room
roomMonitoring: Room
notes: String
activeHold: Boolean
trainingHolds: [TrainingHold]
manager: [Int]
staff: [Int]
trainer: [Int]
restrictions: [Restriction]
currencyAccount: CurrencyAccount!
"""
The number-letter combination that is attached to your RIT email
(ie. abc1234). Not sensitive info. Stored plainly.
Not to be confused with the universityID.
"""
ritUsername: String!
"""
Has the user completed the signup form?
"""
setupComplete: Boolean
"""
Is the user's account suspended/archived?
"""
archived: Boolean!
forceArchive: Boolean
}
input StudentUserInput {
ritUsername: String!
firstName: String!
lastName: String!
expectedGraduation: String!
college: String!
major: String!
}
input FacultyUserInput {
firstName: String!
lastName: String!
}
type Count {
count: Int
}
extend type Query {
users(searchText: String): [User]
usersLimit(searchText: String): [User]
user(id: ID!): User
currentUser: User
isUserWelcomed(userID: ID!, roomID: ID!): Boolean
numUsers: Count
userByUsernameorUID(value: String): User
}
extend type Mutation {
createUser(
firstName: String
lastName: String
ritUsername: String
): User
updateStudentProfile(
userID: ID!
pronouns: String
college: String
expectedGraduation: String
): User
archiveUser(userID: ID!): User
setCardTagID(
userID: ID!
cardTagID: String
): User
setNotes(
userID: ID!
notes: String!
): User
setUserAdmin(userID: ID!, admin: Boolean): Boolean
makeUserManager(userID: ID!, makerspaceID: ID!): [Int]
makeUserStaff(userID: ID!, makerspaceID: ID!): [Int]
makeUserTrainer(userID: ID!, equipmentID: ID!): [Int]
revokeUserManager(userID: ID!, makerspaceID: ID!): [Int]
revokeUserStaff(userID: ID!, makerspaceID: ID!): [Int]
revokeUserTrainer(userID: ID!, equipmentID: ID!): [Int]
forceArchiveUser(userID: ID!, force: Boolean): User
}
`;