-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add registration form #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.entities; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
| import "hackathon/entities/question.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/entities"; | ||
|
|
||
| message Answer { | ||
| string question_id = 1; | ||
| string value = 2; | ||
| QuestionType type = 3 [(buf.validate.field).enum.defined_only = true]; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: remove the answer type here as it can be derived from the question? |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.entities; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/entities"; | ||
|
|
||
| enum QuestionType { | ||
| QUESTION_TYPE_UNSPECIFIED = 0; | ||
| QUESTION_TYPE_TEXT = 1; | ||
| QUESTION_TYPE_BOOL = 2; | ||
| } | ||
|
|
||
| message Question { | ||
| string id = 1; | ||
| string key = 2 [(buf.validate.field).string.pattern = "^[a-z][a-z0-9_]*$"]; | ||
| string label = 3; | ||
| QuestionType type = 4 [(buf.validate.field).enum.defined_only = true]; | ||
| bool mandatory = 5; | ||
| int32 order = 6; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,24 +6,36 @@ import "hackathon/messages/hackathon_svc/add_owner_request.proto"; | |
| import "hackathon/messages/hackathon_svc/add_owner_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/approve_participant_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/approve_participant_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/create_question_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/create_question_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/create_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/create_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/edit_question_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/edit_question_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/edit_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/edit_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/get_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/get_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/join_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/join_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/list_participant_answers_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/list_participant_answers_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/list_questions_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/list_questions_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/list_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/list_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/remove_owner_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/remove_owner_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/remove_participant_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/remove_participant_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/remove_question_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/remove_question_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/set_capabilities_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/set_capabilities_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/set_current_phase_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/set_current_phase_response.proto"; | ||
| import "hackathon/messages/hackathon_svc/submit_answers_request.proto"; | ||
| import "hackathon/messages/hackathon_svc/submit_answers_response.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon"; | ||
|
|
||
|
|
@@ -39,4 +51,12 @@ service HackathonService { | |
| rpc RemoveParticipant(hackathon.messages.hackathon_svc.RemoveParticipantRequest) returns (hackathon.messages.hackathon_svc.RemoveParticipantResponse); | ||
| rpc AddOwner(hackathon.messages.hackathon_svc.AddOwnerRequest) returns (hackathon.messages.hackathon_svc.AddOwnerResponse); | ||
| rpc RemoveOwner(hackathon.messages.hackathon_svc.RemoveOwnerRequest) returns (hackathon.messages.hackathon_svc.RemoveOwnerResponse); | ||
| // Registration questions | ||
| rpc CreateQuestion(hackathon.messages.hackathon_svc.CreateQuestionRequest) returns (hackathon.messages.hackathon_svc.CreateQuestionResponse); | ||
| rpc EditQuestion(hackathon.messages.hackathon_svc.EditQuestionRequest) returns (hackathon.messages.hackathon_svc.EditQuestionResponse); | ||
| rpc RemoveQuestion(hackathon.messages.hackathon_svc.RemoveQuestionRequest) returns (hackathon.messages.hackathon_svc.RemoveQuestionResponse); | ||
| rpc ListQuestions(hackathon.messages.hackathon_svc.ListQuestionsRequest) returns (hackathon.messages.hackathon_svc.ListQuestionsResponse); | ||
| rpc SubmitAnswers(hackathon.messages.hackathon_svc.SubmitAnswersRequest) returns (hackathon.messages.hackathon_svc.SubmitAnswersResponse); | ||
| // Participant answers (admin) | ||
| rpc ListParticipantAnswers(hackathon.messages.hackathon_svc.ListParticipantAnswersRequest) returns (hackathon.messages.hackathon_svc.ListParticipantAnswersResponse); | ||
|
Comment on lines
+60
to
+61
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix: The comment suggest that this service is admin only, but a participant should also have access to read his answers. Also waitlisted participants should be able to read what they answered.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, that's what's intended, the comment is wrong. |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
| import "hackathon/entities/question.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message CreateQuestionRequest { | ||
| string hackathon_id = 1 [(buf.validate.field).string.uuid = true]; | ||
| string key = 2 [ | ||
| (buf.validate.field).string.min_len = 1, | ||
| (buf.validate.field).string.max_len = 64, | ||
| (buf.validate.field).string.pattern = "^[a-z][a-z0-9_]*$" | ||
| ]; | ||
| string label = 3 [ | ||
| (buf.validate.field).string.min_len = 1, | ||
| (buf.validate.field).string.max_len = 255 | ||
| ]; | ||
| hackathon.entities.QuestionType type = 4 [(buf.validate.field).enum.defined_only = true]; | ||
| bool mandatory = 5; | ||
| int32 order = 6; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message CreateQuestionResponse { | ||
| string question_id = 1; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
| import "hackathon/entities/question.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message EditQuestionRequest { | ||
| string hackathon_id = 1 [(buf.validate.field).string.uuid = true]; | ||
| string question_id = 2 [(buf.validate.field).string.uuid = true]; | ||
| optional string label = 3 [ | ||
| (buf.validate.field).string.min_len = 1, | ||
| (buf.validate.field).string.max_len = 255 | ||
| ]; | ||
| optional hackathon.entities.QuestionType type = 4; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: refuse a type change once an answer exists for a question.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, that is planned. |
||
| optional bool mandatory = 5; | ||
| optional int32 order = 6; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message EditQuestionResponse {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,8 +2,12 @@ syntax = "proto3"; | |
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
| import "hackathon/entities/answer.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message JoinRequest { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: what happens to the answers on a second join call? Or can it only be issued once? Did we consider this in the backend?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. second join call overwrites the first. |
||
| string hackathon_id = 1; | ||
| string hackathon_id = 1 [(buf.validate.field).string.uuid = true]; | ||
| repeated hackathon.entities.Answer answers = 2; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message ListParticipantAnswersRequest { | ||
| string hackathon_id = 1 [(buf.validate.field).string.uuid = true]; | ||
| optional string user_id = 2 [(buf.validate.field).string.uuid = true]; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| import "hackathon/entities/answer.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message ListParticipantAnswersResponse { | ||
| repeated hackathon.entities.Answer answers = 1; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message ListQuestionsRequest { | ||
| string hackathon_id = 1 [(buf.validate.field).string.uuid = true]; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| import "hackathon/entities/question.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message ListQuestionsResponse { | ||
| repeated hackathon.entities.Question questions = 1; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message RemoveQuestionRequest { | ||
| string hackathon_id = 1 [(buf.validate.field).string.uuid = true]; | ||
| string question_id = 2 [(buf.validate.field).string.uuid = true]; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message RemoveQuestionResponse {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| import "buf/validate/validate.proto"; | ||
| import "hackathon/entities/answer.proto"; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message SubmitAnswersRequest { | ||
| string hackathon_id = 1 [(buf.validate.field).string.uuid = true]; | ||
| repeated hackathon.entities.Answer answers = 2; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: does this overwrite all previous answers or only the ones returned? |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package hackathon.messages.hackathon_svc; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc"; | ||
|
|
||
| message SubmitAnswersResponse {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: Answer needs a
user_idsince theuser_idis optional inListParticipantsAnswers, otherwise it will unclear who answered the question. You can add the theuser_ideither here or in theListParticpiantAnswersResponse.