Skip to content

Commit

Permalink
feat: added code review requests
Browse files Browse the repository at this point in the history
  • Loading branch information
bgenia committed Aug 28, 2023
1 parent 107c2fe commit 33f8850
Show file tree
Hide file tree
Showing 9 changed files with 379 additions and 1 deletion.
33 changes: 33 additions & 0 deletions requests/calendar_add_code_review_to_event_slot.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package requests

import "github.com/s21toolkit/s21client/gql"

type Variables_CalendarAddCodeReviewToEventSlot struct {
StudentGoalID string `json:"studentGoalId"`
StartTime string `json:"startTime"`
}


type Data_CalendarAddCodeReviewToEventSlot struct {
Data_Student_CalendarAddCodeReviewToEventSlot Data_Student_CalendarAddCodeReviewToEventSlot `json:"student"`
}

type Data_Student_CalendarAddCodeReviewToEventSlot struct {
Data_AddBookingCodeReviewToEventSlot_CalendarAddCodeReviewToEventSlot Data_AddBookingCodeReviewToEventSlot_CalendarAddCodeReviewToEventSlot `json:"addBookingCodeReviewToEventSlot"`
Typename string `json:"__typename"`
}

type Data_AddBookingCodeReviewToEventSlot_CalendarAddCodeReviewToEventSlot struct {
ID string `json:"id"`
Typename string `json:"__typename"`
}


func (ctx *RequestContext) CalendarAddCodeReviewToEventSlot(variables Variables_CalendarAddCodeReviewToEventSlot) (Data_CalendarAddCodeReviewToEventSlot, error) {
request := gql.NewQueryRequest[Variables_CalendarAddCodeReviewToEventSlot](
"mutation calendarAddCodeReviewToEventSlot($studentGoalId: ID!, $startTime: DateTime!) {\n student {\n addBookingCodeReviewToEventSlot(\n studentGoalId: $studentGoalId\n startTime: $startTime\n ) {\n id\n __typename\n }\n __typename\n }\n}\n",
variables,
)

return GqlRequest[Data_CalendarAddCodeReviewToEventSlot](ctx, request)
}
48 changes: 48 additions & 0 deletions requests/calendar_get_code_review_data.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package requests

import "github.com/s21toolkit/s21client/gql"

type Variables_CalendarGetCodeReviewData struct {
StudentGoalID string `json:"studentGoalId"`
}


type Data_CalendarGetCodeReviewData struct {
Data_Student_CalendarGetCodeReviewData Data_Student_CalendarGetCodeReviewData `json:"student"`
}

type Data_Student_CalendarGetCodeReviewData struct {
Data_GetStudentModuleByStudentGoalID_CalendarGetCodeReviewData Data_GetStudentModuleByStudentGoalID_CalendarGetCodeReviewData `json:"getStudentModuleByStudentGoalId"`
Typename string `json:"__typename"`
}

type Data_GetStudentModuleByStudentGoalID_CalendarGetCodeReviewData struct {
ModuleTitle string `json:"moduleTitle"`
Data_CurrentTask_CalendarGetCodeReviewData Data_CurrentTask_CalendarGetCodeReviewData `json:"currentTask"`
Typename string `json:"__typename"`
}

type Data_CurrentTask_CalendarGetCodeReviewData struct {
Data_Task_CalendarGetCodeReviewData Data_Task_CalendarGetCodeReviewData `json:"task"`
Typename string `json:"__typename"`
}

type Data_Task_CalendarGetCodeReviewData struct {
Data_StudentTaskAdditionalAttributes_CalendarGetCodeReviewData Data_StudentTaskAdditionalAttributes_CalendarGetCodeReviewData `json:"studentTaskAdditionalAttributes"`
Typename string `json:"__typename"`
}

type Data_StudentTaskAdditionalAttributes_CalendarGetCodeReviewData struct {
CodeReviewDuration int64 `json:"codeReviewDuration"`
Typename string `json:"__typename"`
}


func (ctx *RequestContext) CalendarGetCodeReviewData(variables Variables_CalendarGetCodeReviewData) (Data_CalendarGetCodeReviewData, error) {
request := gql.NewQueryRequest[Variables_CalendarGetCodeReviewData](
"query calendarGetCodeReviewData($studentGoalId: ID!) {\n student {\n getStudentModuleByStudentGoalId(studentGoalId: $studentGoalId) {\n moduleTitle\n currentTask {\n task {\n studentTaskAdditionalAttributes {\n codeReviewDuration\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n}\n",
variables,
)

return GqlRequest[Data_CalendarGetCodeReviewData](ctx, request)
}
40 changes: 39 additions & 1 deletion requests/calendar_get_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,50 @@ type Data_GetMyCalendarEvent_CalendarGetEvents struct {
Bookings []interface{} `json:"bookings"`
Exam interface{} `json:"exam"`
StudentCodeReview interface{} `json:"studentCodeReview"`
Activity interface{} `json:"activity"`
Data_Activity_CalendarGetEvents *Data_Activity_CalendarGetEvents `json:"activity"`
Goals []interface{} `json:"goals"`
Penalty interface{} `json:"penalty"`
Typename string `json:"__typename"`
}

type Data_Activity_CalendarGetEvents struct {
ActivityEventID string `json:"activityEventId"`
EventID string `json:"eventId"`
Name string `json:"name"`
BeginDate string `json:"beginDate"`
EndDate string `json:"endDate"`
IsRegistered bool `json:"isRegistered"`
Description string `json:"description"`
CurrentStudentsCount int64 `json:"currentStudentsCount"`
MaxStudentCount int64 `json:"maxStudentCount"`
Location string `json:"location"`
UpdateDate string `json:"updateDate"`
IsWaitListActive bool `json:"isWaitListActive"`
IsInWaitList bool `json:"isInWaitList"`
StopRegisterDate string `json:"stopRegisterDate"`
Typename string `json:"__typename"`
Data_StudentFeedback_CalendarGetEvents Data_StudentFeedback_CalendarGetEvents `json:"studentFeedback"`
Status string `json:"status"`
ActivityType string `json:"activityType"`
IsMandatory bool `json:"isMandatory"`
IsVisible bool `json:"isVisible"`
Comments []interface{} `json:"comments"`
Organizers []Data_Organizer_CalendarGetEvents `json:"organizers"`
}

type Data_Organizer_CalendarGetEvents struct {
ID string `json:"id"`
Login string `json:"login"`
Typename string `json:"__typename"`
}

type Data_StudentFeedback_CalendarGetEvents struct {
ID string `json:"id"`
Rating int64 `json:"rating"`
Comment string `json:"comment"`
Typename string `json:"__typename"`
}

type Data_EventSlot_CalendarGetEvents struct {
ID string `json:"id"`
Type string `json:"type"`
Expand Down
32 changes: 32 additions & 0 deletions requests/calendar_get_student_code_reviews.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package requests

import "github.com/s21toolkit/s21client/gql"

type Variables_CalendarGetStudentCodeReviews struct {
StudentGoalID string `json:"studentGoalId"`
}


type Data_CalendarGetStudentCodeReviews struct {
Data_Student_CalendarGetStudentCodeReviews Data_Student_CalendarGetStudentCodeReviews `json:"student"`
}

type Data_Student_CalendarGetStudentCodeReviews struct {
Data_GetStudentCodeReviews_CalendarGetStudentCodeReviews Data_GetStudentCodeReviews_CalendarGetStudentCodeReviews `json:"getStudentCodeReviews"`
Typename string `json:"__typename"`
}

type Data_GetStudentCodeReviews_CalendarGetStudentCodeReviews struct {
SecondRoundStartDate string `json:"secondRoundStartDate"`
Typename string `json:"__typename"`
}


func (ctx *RequestContext) CalendarGetStudentCodeReviews(variables Variables_CalendarGetStudentCodeReviews) (Data_CalendarGetStudentCodeReviews, error) {
request := gql.NewQueryRequest[Variables_CalendarGetStudentCodeReviews](
"query calendarGetStudentCodeReviews($studentGoalId: ID!) {\n student {\n getStudentCodeReviews(studentGoalId: $studentGoalId) {\n secondRoundStartDate\n __typename\n }\n __typename\n }\n}\n",
variables,
)

return GqlRequest[Data_CalendarGetStudentCodeReviews](ctx, request)
}
48 changes: 48 additions & 0 deletions requests/get_available_code_review_projects.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package requests

import "github.com/s21toolkit/s21client/gql"

type Variables_GetAvailableCodeReviewProjects struct {
Variables_Paging_GetAvailableCodeReviewProjects Variables_Paging_GetAvailableCodeReviewProjects `json:"paging"`
}

type Variables_Paging_GetAvailableCodeReviewProjects struct {
Offset int64 `json:"offset"`
Limit int64 `json:"limit"`
}


type Data_GetAvailableCodeReviewProjects struct {
Data_Student_GetAvailableCodeReviewProjects Data_Student_GetAvailableCodeReviewProjects `json:"student"`
}

type Data_Student_GetAvailableCodeReviewProjects struct {
GetAvailableCodeReviewProjects []Data_GetAvailableCodeReviewProject_GetAvailableCodeReviewProjects `json:"getAvailableCodeReviewProjects"`
Typename string `json:"__typename"`
}

type Data_GetAvailableCodeReviewProject_GetAvailableCodeReviewProjects struct {
GoalID string `json:"goalId"`
GoalTitle string `json:"goalTitle"`
StudentGoalID string `json:"studentGoalId"`
StudentCodeReviewStatus string `json:"studentCodeReviewStatus"`
GoalExecutionType string `json:"goalExecutionType"`
Data_StudentTaskAdditionalAttributesModel_GetAvailableCodeReviewProjects Data_StudentTaskAdditionalAttributesModel_GetAvailableCodeReviewProjects `json:"studentTaskAdditionalAttributesModel"`
Typename string `json:"__typename"`
}

type Data_StudentTaskAdditionalAttributesModel_GetAvailableCodeReviewProjects struct {
CodeReviewCost int64 `json:"codeReviewCost"`
CodeReviewDuration int64 `json:"codeReviewDuration"`
Typename string `json:"__typename"`
}


func (ctx *RequestContext) GetAvailableCodeReviewProjects(variables Variables_GetAvailableCodeReviewProjects) (Data_GetAvailableCodeReviewProjects, error) {
request := gql.NewQueryRequest[Variables_GetAvailableCodeReviewProjects](
"query getAvailableCodeReviewProjects($paging: PagingInput!) {\n student {\n getAvailableCodeReviewProjects(paging: $paging) {\n ...CodeReviewProject\n __typename\n }\n __typename\n }\n}\n\nfragment CodeReviewProject on CodeReview {\n goalId\n goalTitle\n studentGoalId\n studentCodeReviewStatus\n goalExecutionType\n studentTaskAdditionalAttributesModel {\n codeReviewCost\n codeReviewDuration\n __typename\n }\n __typename\n}\n",
variables,
)

return GqlRequest[Data_GetAvailableCodeReviewProjects](ctx, request)
}
44 changes: 44 additions & 0 deletions requests/get_code_review_my_student.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package requests

import "github.com/s21toolkit/s21client/gql"

type Variables_GetCodeReviewMyStudent struct {
StudentGoalID string `json:"studentGoalId"`
}


type Data_GetCodeReviewMyStudent struct {
Data_Student_GetCodeReviewMyStudent Data_Student_GetCodeReviewMyStudent `json:"student"`
}

type Data_Student_GetCodeReviewMyStudent struct {
Data_GetMyStudentCodeReview_GetCodeReviewMyStudent *Data_GetMyStudentCodeReview_GetCodeReviewMyStudent `json:"getMyStudentCodeReview"`
Typename string `json:"__typename"`
}

type Data_GetMyStudentCodeReview_GetCodeReviewMyStudent struct {
ReviewerCommentsCount int64 `json:"reviewerCommentsCount"`
CodeReviewRounds []Data_CodeReviewRound_GetCodeReviewMyStudent `json:"codeReviewRounds"`
Typename string `json:"__typename"`
}

type Data_CodeReviewRound_GetCodeReviewMyStudent struct {
EventID *string `json:"eventId"`
CodeReviewRoundType string `json:"codeReviewRoundType"`
CodeReviewStatus string `json:"codeReviewStatus"`
StartTime string `json:"startTime"`
EndTime string `json:"endTime"`
MergeRequestURL string `json:"mergeRequestURL"`
CreateTime string `json:"createTime"`
Typename string `json:"__typename"`
}


func (ctx *RequestContext) GetCodeReviewMyStudent(variables Variables_GetCodeReviewMyStudent) (Data_GetCodeReviewMyStudent, error) {
request := gql.NewQueryRequest[Variables_GetCodeReviewMyStudent](
"query getCodeReviewMyStudent($studentGoalId: ID!) {\n student {\n getMyStudentCodeReview(studentGoalId: $studentGoalId) {\n reviewerCommentsCount\n codeReviewRounds {\n ...CodeReviewRound\n __typename\n }\n __typename\n }\n __typename\n }\n}\n\nfragment CodeReviewRound on CodeReviewRound {\n eventId\n codeReviewRoundType\n codeReviewStatus\n startTime\n endTime\n mergeRequestURL\n createTime\n __typename\n}\n",
variables,
)

return GqlRequest[Data_GetCodeReviewMyStudent](ctx, request)
}
71 changes: 71 additions & 0 deletions requests/get_code_review_project_info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
package requests

import "github.com/s21toolkit/s21client/gql"

type Variables_GetCodeReviewProjectInfo struct {
StudentGoalID string `json:"studentGoalId"`
}


type Data_GetCodeReviewProjectInfo struct {
Data_Student_GetCodeReviewProjectInfo Data_Student_GetCodeReviewProjectInfo `json:"student"`
}

type Data_Student_GetCodeReviewProjectInfo struct {
Data_GetStudentModuleByStudentGoalID_GetCodeReviewProjectInfo Data_GetStudentModuleByStudentGoalID_GetCodeReviewProjectInfo `json:"getStudentModuleByStudentGoalId"`
Typename string `json:"__typename"`
}

type Data_GetStudentModuleByStudentGoalID_GetCodeReviewProjectInfo struct {
ID string `json:"id"`
ModuleTitle string `json:"moduleTitle"`
Data_StudyModule_GetCodeReviewProjectInfo Data_StudyModule_GetCodeReviewProjectInfo `json:"studyModule"`
Data_CurrentTask_GetCodeReviewProjectInfo Data_CurrentTask_GetCodeReviewProjectInfo `json:"currentTask"`
Typename string `json:"__typename"`
}

type Data_CurrentTask_GetCodeReviewProjectInfo struct {
ID string `json:"id"`
TaskID string `json:"taskId"`
Data_Task_GetCodeReviewProjectInfo Data_Task_GetCodeReviewProjectInfo `json:"task"`
Typename string `json:"__typename"`
}

type Data_Task_GetCodeReviewProjectInfo struct {
Data_Content_GetCodeReviewProjectInfo Data_Content_GetCodeReviewProjectInfo `json:"content"`
AssignmentType string `json:"assignmentType"`
Data_StudentTaskAdditionalAttributes_GetCodeReviewProjectInfo Data_StudentTaskAdditionalAttributes_GetCodeReviewProjectInfo `json:"studentTaskAdditionalAttributes"`
Typename string `json:"__typename"`
}

type Data_Content_GetCodeReviewProjectInfo struct {
Body string `json:"body"`
Typename string `json:"__typename"`
}

type Data_StudentTaskAdditionalAttributes_GetCodeReviewProjectInfo struct {
CodeReviewDuration int64 `json:"codeReviewDuration"`
CodeReviewCost int64 `json:"codeReviewCost"`
Typename string `json:"__typename"`
}

type Data_StudyModule_GetCodeReviewProjectInfo struct {
Duration int64 `json:"duration"`
Data_Stage_GetCodeReviewProjectInfo Data_Stage_GetCodeReviewProjectInfo `json:"stage"`
Typename string `json:"__typename"`
}

type Data_Stage_GetCodeReviewProjectInfo struct {
Name string `json:"name"`
Typename string `json:"__typename"`
}


func (ctx *RequestContext) GetCodeReviewProjectInfo(variables Variables_GetCodeReviewProjectInfo) (Data_GetCodeReviewProjectInfo, error) {
request := gql.NewQueryRequest[Variables_GetCodeReviewProjectInfo](
"query getCodeReviewProjectInfo($studentGoalId: ID!) {\n student {\n getStudentModuleByStudentGoalId(studentGoalId: $studentGoalId) {\n ...CodeReviewProjectInfo\n __typename\n }\n __typename\n }\n}\n\nfragment CodeReviewProjectInfo on StudentModule {\n id\n moduleTitle\n studyModule {\n duration\n stage {\n name\n __typename\n }\n __typename\n }\n currentTask {\n ...CodeReviewCurrentTaskInfo\n __typename\n }\n __typename\n}\n\nfragment CodeReviewCurrentTaskInfo on StudentTask {\n id\n taskId\n task {\n content {\n body\n __typename\n }\n assignmentType\n studentTaskAdditionalAttributes {\n codeReviewDuration\n codeReviewCost\n __typename\n }\n __typename\n }\n __typename\n}\n",
variables,
)

return GqlRequest[Data_GetCodeReviewProjectInfo](ctx, request)
}
32 changes: 32 additions & 0 deletions requests/get_first_round_code_review_projects.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package requests

import "github.com/s21toolkit/s21client/gql"

type Variables_GetFirstRoundCodeReviewProjects struct {
Variables_Paging_GetFirstRoundCodeReviewProjects Variables_Paging_GetFirstRoundCodeReviewProjects `json:"paging"`
}

type Variables_Paging_GetFirstRoundCodeReviewProjects struct {
Offset int64 `json:"offset"`
Limit int64 `json:"limit"`
}


type Data_GetFirstRoundCodeReviewProjects struct {
Data_Student_GetFirstRoundCodeReviewProjects Data_Student_GetFirstRoundCodeReviewProjects `json:"student"`
}

type Data_Student_GetFirstRoundCodeReviewProjects struct {
GetFirstRoundCodeReviewProjects []interface{} `json:"getFirstRoundCodeReviewProjects"`
Typename string `json:"__typename"`
}


func (ctx *RequestContext) GetFirstRoundCodeReviewProjects(variables Variables_GetFirstRoundCodeReviewProjects) (Data_GetFirstRoundCodeReviewProjects, error) {
request := gql.NewQueryRequest[Variables_GetFirstRoundCodeReviewProjects](
"query getFirstRoundCodeReviewProjects($paging: PagingInput!) {\n student {\n getFirstRoundCodeReviewProjects(paging: $paging) {\n ...CodeReviewProject\n __typename\n }\n __typename\n }\n}\n\nfragment CodeReviewProject on CodeReview {\n goalId\n goalTitle\n studentGoalId\n studentCodeReviewStatus\n goalExecutionType\n studentTaskAdditionalAttributesModel {\n codeReviewCost\n codeReviewDuration\n __typename\n }\n __typename\n}\n",
variables,
)

return GqlRequest[Data_GetFirstRoundCodeReviewProjects](ctx, request)
}
Loading

0 comments on commit 33f8850

Please sign in to comment.