Skip to content

Commit ebf1091

Browse files
committed
add reviews to submission queries, add SubmissionReview class
1 parent 97d2965 commit ebf1091

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

indico/queries/submission.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@ class ListSubmissions(PagedRequest):
6262
deleted
6363
retrieved
6464
errors
65+
reviews {
66+
id
67+
createdAt
68+
createdBy
69+
completedAt
70+
rejected
71+
reviewType
72+
notes
73+
}
6574
}
6675
pageInfo {
6776
endCursor
@@ -124,6 +133,15 @@ class GetSubmission(GraphQLRequest):
124133
retrieved
125134
deleted
126135
errors
136+
reviews {
137+
id
138+
createdAt
139+
createdBy
140+
completedAt
141+
rejected
142+
reviewType
143+
notes
144+
}
127145
}
128146
}
129147
"""
@@ -158,6 +176,15 @@ class WaitForSubmissions(RequestChain):
158176
retrieved
159177
deleted
160178
errors
179+
reviews {
180+
id
181+
createdAt
182+
createdBy
183+
completedAt
184+
rejected
185+
reviewType
186+
notes
187+
}
161188
}
162189
}
163190
}

indico/types/submission.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
"PENDING_AUTO_REVIEW",
1111
]
1212

13+
VALID_REVIEW_TYPES = [
14+
"MANUAL",
15+
"AUTO",
16+
"ADMIN",
17+
]
1318

1419
SUBMISSION_RESULT_VERSIONS = ["ONE", "TWO", "THREE", "OLDEST_SUPPORTED", "LATEST"]
1520

@@ -32,6 +37,29 @@ class SubmissionRetries(BaseType):
3237
submission_id: int
3338

3439

40+
class SubmissionReviews(BaseType):
41+
f"""
42+
Information about a submissions Reviews.
43+
44+
Attributes:
45+
id (int): The ID of the review.
46+
submission_id (int): The ID of the submission that is being reviewed.
47+
created_at (str): Timestamp of when the document was checked out
48+
created_by (int): The ID of the User who submitted the review.
49+
completed_at (str): Timestamp of when the review was submitted.
50+
rejected (bool): Whether a submission has been rejected.
51+
review_type (str): Type of review. One of {VALID_REVIEW_TYPES}
52+
notes (str): Rejection reasons provided by user.
53+
"""
54+
id: int
55+
submission_id: int
56+
created_at: str
57+
created_by: int
58+
completed_at: str
59+
rejected: bool
60+
review_type: str
61+
notes: str
62+
3563
class Submission(BaseType):
3664
f"""
3765
A Submission in the Indico Platform.
@@ -71,3 +99,4 @@ class Submission(BaseType):
7199
deleted: bool
72100
errors: str
73101
retries: List[SubmissionRetries]
102+
reviews: List[SubmissionReviews]

0 commit comments

Comments
 (0)