-
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
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; | ||
|
|
||
| option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/entities"; | ||
|
|
||
| message Answer { | ||
| string question_id = 1; | ||
| string participant_id = 2; | ||
| oneof value { | ||
| string text_value = 3; | ||
| bool bool_value = 4; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| 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; | ||
| QUESTION_TYPE_ENUM = 3; | ||
| } | ||
|
|
||
| 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; | ||
| repeated string options = 7; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| 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; | ||
| repeated string options = 7; | ||
| } |
| 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,21 @@ | ||
| 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; | ||
| repeated string options = 7; | ||
| } | ||
| 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?
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. this is like a new submission, so all answers need to be passed (well, at least all mandatory ones). |
||
| } | ||
| 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.