Skip to content

feat: add registration form - #212

Draft
Panaetius wants to merge 2 commits into
mainfrom
feat/registration-form
Draft

feat: add registration form#212
Panaetius wants to merge 2 commits into
mainfrom
feat/registration-form

Conversation

@Panaetius

Copy link
Copy Markdown
Member

No description provided.

@Panaetius
Panaetius force-pushed the feat/registration-form branch 2 times, most recently from 4b64012 to dd25151 Compare August 21, 2026 12:28
@Panaetius
Panaetius force-pushed the feat/registration-form branch from dd25151 to 01a65d4 Compare August 21, 2026 12:33

@sabinem sabinem left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Panaetius Looks overall good. I left a few comments.

On further thought: we do need a selection type, as we are grouping by certain values such as affiliation, etc in the team assignments, so we need to be sure these values are normed.


option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/entities";

message Answer {

Copy link
Copy Markdown
Collaborator

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_id since the user_id is optional in ListParticipantsAnswers, otherwise it will unclear who answered the question. You can add the the user_id either here or in the ListParticpiantAnswersResponse.

Comment on lines +60 to +61
// Participant answers (admin)
rpc ListParticipantAnswers(hackathon.messages.hackathon_svc.ListParticipantAnswersRequest) returns (hackathon.messages.hackathon_svc.ListParticipantAnswersResponse);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's what's intended, the comment is wrong.

Comment on lines +43 to +46
field.Time("updated_at").
Default(time.Now).UpdateDefault(time.Now).
Comment("Timestamp of the last update."),
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpicky: name this modified_at to align with the rest of the tables in the schema

message Answer {
string question_id = 1;
string value = 2;
QuestionType type = 3 [(buf.validate.field).enum.defined_only = true];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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?

Comment on lines +36 to +38
field.Enum("type").
Values("text", "bool").
Comment("The type of the question (for readability when reading answers)."),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: remove the answer type as this should be part of the question.

(buf.validate.field).string.min_len = 1,
(buf.validate.field).string.max_len = 255
];
optional hackathon.entities.QuestionType type = 4;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: refuse a type change once an answer exists for a question.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that is planned.

Comment on lines +68 to +69
edge.To("answers", Answer.Type).
Comment("Answers submitted by participants for this question."),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: add a OnDelete so it it is clear what happens to answers when a question is removed.

func (Question) Indexes() []ent.Index {
return []ent.Index{
index.Fields("key", "hackathon_id").Unique(),
index.Fields("order"),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix: order is not unique, so for a deterministic ordering add a second field such as created_at.


message SubmitAnswersRequest {
string hackathon_id = 1 [(buf.validate.field).string.uuid = true];
repeated hackathon.entities.Answer answers = 2;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: does this overwrite all previous answers or only the ones returned?


option go_package = "github.com/swissdatasciencecenter/hackagon/components/backend/internal/proto/hackathon/messages/hackathon_svc";

message JoinRequest {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

second join call overwrites the first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants