feat: cancel voting (backend) - #6464
Conversation
ab9ee48 to
b93e843
Compare
b93e843 to
772d388
Compare
|
I'd like to bring up a general point that caught my eye again in this PR. The OpenTelemetry stuff tends to clutter up the method quite a bit. Could you check if it makes sense to extract that into separate methods for your PR? |
… can be canceled, still missing unit tests though
568dfa4 to
fdd8eee
Compare
|
The deployment to the dev cluster was successful. You can find the deployment here: https://6464.development.scrumlr.fra.ics.inovex.io Deployed Images
|
| @@ -49,8 +49,9 @@ type VotingCreateRequest struct { | |||
|
|
|||
| // VotingCloseRequest represents the request to update a voting session. | |||
| type VotingCloseRequest struct { | |||
There was a problem hiding this comment.
I think we should rename this struct now to VotingUpdateRequest or something like this
| AddVote(ctx context.Context, req VoteRequest) (*Vote, error) | ||
| RemoveVote(ctx context.Context, req VoteRequest) error | ||
| Close(ctx context.Context, id uuid.UUID, board uuid.UUID, affectedNotes []Note) (*Voting, error) | ||
| Update(ctx context.Context, id uuid.UUID, board uuid.UUID, affectedNotes []Note, votingStatus VotingStatus) (*Voting, error) |
There was a problem hiding this comment.
What do you think of changing the signature so that first the status is requested and then the notes?
| } | ||
| } | ||
|
|
||
| func (service *Service) Update(ctx context.Context, id uuid.UUID, board uuid.UUID, affectedNotes []Note, votingStatus VotingStatus) (*Voting, error) { |
There was a problem hiding this comment.
Public functions should be before private functions
| ) | ||
|
|
||
| // VotingStatus is the state of a voting session and can be one of open, aborted or closed. | ||
| // VotingStatus is the state of a voting session and can be one of open, canceled or closed. |
There was a problem hiding this comment.
Also change the comment to aborted
|
The e2e tests need an update because the voting update now requires the status |
Description
I implemented a new canceled state that uses the ABORT db enum to update the voting and set its state to canceled. For this, new functions were created to cancel the voting without triggering the evaluation of the voting.
Changelog
Checklist
Stack created with GitHub Stacks CLI • Give Feedback 💬