Skip to content

Conversation

@sonwezali
Copy link
Contributor

fetch task volunteers and add completion logic

@sonwezali sonwezali added this to the Milestone 1.5 - DaVinci milestone Oct 26, 2025
@sonwezali sonwezali self-assigned this Oct 26, 2025
@sonwezali sonwezali added priority-medium Medium level priority issue medium-effort Medium-effort is needed need_review The issue needs review frontend Related to UI or frontend logic labels Oct 26, 2025
acceptedVolunteersCount < request.volunteer_number &&
!volunteerRecord;
const canWithdraw = isAuthenticated && !isTaskCreator && volunteerRecord;
const canMarkAsComplete =
Copy link
Contributor

Choose a reason for hiding this comment

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

This logic appears to have a flaw. The canMarkAsComplete variable will evaluate to false when acceptedVolunteersCount > 0 but less than the required number of volunteers. This is because the request.status remains "POSTED" until the required number of volunteers is met.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are definitely right. However, I think the problem is not related to this implementation but to the backend. In app/backend/core/models/task.py, we should update the logic of making a request "ASSIGNED" from the "POSTED" state as follows:

# Current logic:
  if current_assignee_count < self.volunteer_number:
      if self.status == TaskStatus.ASSIGNED:
          self.status = TaskStatus.POSTED
          self.save()
          return True
  elif current_assignee_count >= self.volunteer_number:
      if self.status == TaskStatus.POSTED:
          self.status = TaskStatus.ASSIGNED
          self.save()
          return True

  # New logic:
  if current_assignee_count < 1:
      if self.status == TaskStatus.ASSIGNED:
          self.status = TaskStatus.POSTED
          self.save()
          return True
  elif current_assignee_count >= 1:
      if self.status == TaskStatus.POSTED:
          self.status = TaskStatus.ASSIGNED
          self.save()
          return True

Let me know what you think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would like to here from you friends.

@aahmeterenasl @erayyuklu @akcayyusufkaan @erdkocak

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

Labels

frontend Related to UI or frontend logic medium-effort Medium-effort is needed need_review The issue needs review priority-medium Medium level priority issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants