Skip to content

[BACKEND] [DEFECT] Adjust logic behind validateUserRemaningSessions for sourcing capacities #967

@jji05

Description

@jji05

Is your feature request related to a problem? Please describe.

There is a major issue with validateUserRemaningSessions where if a user conveniently books a session that downgrades their membership status to casual, the capacity counting function validateUserRemaningSessions would give a false casual/member capacity due to the system counting capacities based on user roles.

Describe the solution you'd like

We need to update the booking schema to determine if a booking takes a casual or member slot.

Describe alternatives you've considered

This is open for discussion as there are several ways this user story could be completed.

Additional context

Reproduction steps:

  1. Have an account with 1 booking session and member status
  2. Book a session(which downgrades you to casual)
  3. Check admin panel for capacities (you will see that there is a casual capacity increase and the normal capacity is left untouched)

BEFORE MERGING

  • Integration test written for services
  • Schemas annotated if adding new models
  • Code generation run (hint: pnpm generate:types)
  • Appropriate mocks created where possible
  • PR Reviewed (For non-trivial changes)
  • Changes tested after rebasing on master or merging in master (hint: git fetch origin master:master, then git rebase master or git merge master)
  • All required PR checks passing

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendrelating to code in the /server directorybugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions