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

Validate year of release #7

Closed
php-coder opened this issue May 28, 2014 · 5 comments
Closed

Validate year of release #7

php-coder opened this issue May 28, 2014 · 5 comments
Assignees
Milestone

Comments

@php-coder
Copy link
Owner

Add year field validation at series creation page. It must be inside range [1840, $currentYear].

@php-coder php-coder changed the title Validate year Validate year of release May 28, 2014
@php-coder php-coder modified the milestone: 0.4 Jul 24, 2015
@php-coder php-coder self-assigned this Jul 24, 2015
@php-coder php-coder assigned cssru and unassigned php-coder Jan 11, 2016
@php-coder
Copy link
Owner Author

Because we already have a check for the year in future (see #8) then here we just need to check that the year >= 1840. I suggest to use @Min annotation for that.

@cssru
Copy link
Contributor

cssru commented Jan 11, 2016

Ага, а я думал - на стороне клиента проверку реализовать.

@php-coder
Copy link
Owner Author

Technically it's already "validated" on the client side -- there is a select with options from 1840 to 2016. So, user couldn't choose the year less than 1840. But... this check intended not for ordinary users :)

@cssru
Copy link
Contributor

cssru commented Jan 11, 2016

Year, angry users may want to put your app down, right?

@php-coder
Copy link
Owner Author

:-) No, probably, it can't break the application, but a) I want to be sure that my data satisfies the constraints b) it's a trivial task that could be accomplished by newcomers :)

BTW, if we would use PostgreSQL, for instance, we could add a CHECK() constraint (I don't try it, but looks like we could).

Another idea about protecting the data is: maybe we would write some logic that operates on the series' year and if someone put -1 as the year this logic goes crazy :)

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

2 participants