Skip to content

✨Add priorization of årskull to events - #107

Open
solarmarius wants to merge 2 commits into
td-org-uit-no:masterfrom
solarmarius:feature/priorization
Open

✨Add priorization of årskull to events#107
solarmarius wants to merge 2 commits into
td-org-uit-no:masterfrom
solarmarius:feature/priorization

Conversation

@solarmarius

Copy link
Copy Markdown
  • Add prioritizedRegistrationDate and prioritizedYears fields to EventInput and EventUpdate models
  • Implement early registration access for specific årskull years
  • Update valid_registration() function to check prioritized access before regular registration
  • Add validation to ensure prioritized registration date occurs before regular registration date

- Add prioritizedRegistrationDate and prioritizedYears fields to EventInput and EventUpdate models
- Implement early registration access for specific årskull years
- Update valid_registration() function to check prioritized access before regular registration
- Add validation to ensure prioritized registration date occurs before regular registration date

@TorgrimRL TorgrimRL left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bra jobba Marius!
Ta en titt på kommentarene mine og gjerne oppdater testene til spesielt create event og update event slik at vi kan verifisere at alt du har laget funker som det skal. Legger deg til organisasjonen, da skal du kunne sjekke build pipelinen selv også.

Comment thread app/api/members.py Outdated
if values[key]:
updateInfo[key] = values[key]

# Check if classof is being updated and already has a value

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Kunne du forklart hvorfor du tenker å stoppe brukeren her?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Relatert til prioritering ved årskull - brukere som allerede har satt et årskull skal ikke kunne endre det for å hindre misbruk.

Comment thread app/utils/event_utils.py Outdated
400, "Prioritized registration date must be before regular registration date")
except ValueError:
raise HTTPException(
400, "Invalid date format for prioritized registration date")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Vil ikke vi også komme hit om det var parsingen til regular date som feilet og?

Comment thread app/utils/event_utils.py
validate_registartion_opening_time(
event.date, event.registrationOpeningDate)

if event.prioritizedRegistrationDate != None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bra at du sjekker at prioritizedRegistrationDate finnes, validerer den mot selve event-datoen, og – hvis ordinær åpning finnes – at prioritert < ordinær. 👍

Comment thread app/utils/event_utils.py Outdated
event.date, event.prioritizedRegistrationDate)

# Prioritized registration date must be before regular registration date
if event.registrationOpeningDate != None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fin ungåelse av unødvendig parsing.

Comment thread app/utils/event_utils.py


def valid_registration(opening_date):
def valid_registration(opening_date, member=None, event=None):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prioritert sjekk kommer først og “kortslutter” til True når vinduet er åpent – god rekkefølge og lett å lese. Bra

- Simplify date comparison in event_utils by using direct datetime comparison instead of redundant parsing
- Remove unnecessary nested conditionals when validating prioritized registration dates
- Clarify classof immutability comment to explain business logic preventing privilege manipulation
@solarmarius

Copy link
Copy Markdown
Author

Ser at parsing-logikken for validate_event_dates var overflødig, så har gjort den enklere. Samt spesifisert kommentar for classof under update_member.

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