Skip to content
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

Improve handling of Statuses for Operations & Operators #291

Closed
3 tasks done
andrea-williams opened this issue Nov 17, 2023 · 1 comment
Closed
3 tasks done

Improve handling of Statuses for Operations & Operators #291

andrea-williams opened this issue Nov 17, 2023 · 1 comment

Comments

@andrea-williams
Copy link
Contributor

andrea-williams commented Nov 17, 2023

Describe the task

There's 2 goals to this ticket: (1) fix a bad-practice coding habit (that greatly increases the chance of errors); and (2) improve the readability of application status labels (e.g., not_registered -> Not Registered)

Acceptance Criteria

  • remove all manual assignments of status in code with enums (e.g., we don't want to use operation.status = 'Pending' bc it's bad practice. Replace with operation.status = OperationStatus.PENDING)
  • remove hacky string fixes to status strings in FE (such as calling capitalizeString() in Operations table)
  • rework the Status labels in Django models. Sepehr's suggestion is to use
class Statuses(models.TextChoices):

        NOT_REGISTERED = "Not Registered"

        PENDING = "Pending"

        APPROVED = "Approved"

        REJECTED = "Rejected"

Additional context

  • Add any other context about the task here.
  • Or here
@andrea-williams
Copy link
Contributor Author

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

No branches or pull requests

3 participants