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

generations: Create type for school year #114

Open
BrunoRosendo opened this issue Feb 20, 2023 · 0 comments
Open

generations: Create type for school year #114

BrunoRosendo opened this issue Feb 20, 2023 · 0 comments

Comments

@BrunoRosendo
Copy link
Member

Currently, a generation is identified by a string named schoolYear that is validated by the SchoolYear validator. Its format is <xx-yy> where yy=xx+1.

This works fine but there are some places where we need to manage the years as integers and we might want to use school years for other models in the future. So, it'd be nice to create a SchoolYear type that makes it easier to get the school years and is always validated. We still want to save it as a string in the database, so a Converter might be useful, the same way that it's used for Permissions.

The current places where this would be useful are: SchoolYear validator inferSchoolYearIfNotSpecified in GenerationService. Please check if there are more cases when you implement this.

@BrunoRosendo BrunoRosendo added this to the Website MVP milestone Feb 20, 2023
@BrunoRosendo BrunoRosendo removed this from the Website MVP milestone Apr 5, 2023
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

1 participant