-
Notifications
You must be signed in to change notification settings - Fork 2
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
✨(backend) add start and end date on OrderGroup model #1032
base: main
Are you sure you want to change the base?
✨(backend) add start and end date on OrderGroup model #1032
Conversation
900f92a
to
b844aa3
Compare
models.CheckConstraint( | ||
check=~models.Q(start__isnull=True) ^ models.Q(end__isnull=True), | ||
name="both_start_and_end_dates_must_be_set_or_neither", | ||
violation_error_message=_( | ||
"Both start and end dates must be set, or neither." | ||
), | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we need this rule. We should talk bout it IRL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as seen in IRL, we will take away this model constraint because we will use those fields for :
- 🐦 early birds : set the end date only
- ⌛ last minute : set the beginning date only
Concerning the field is_active
on OrderGroup
model :
- refer to
is_active
value in database ifstart
norend
datetime are setted. - calculate through the
OrderGroupSerializer
andAdminOrderGroupSerializer
the fieldis_active
if either start or end or both datetimes are setted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REVIEWING COMMENT : (WIP)
...
- 🐦 early birds : set the end date only (en fonction de la date d'ouverture et la date de fin du groupe)
- ⌛ last minute : set the beginning date only (en fonction de la date de cloture du cours)
...
4b48e0b
to
b48a129
Compare
We want to be able to define a starting and ending date on order groups. This will allow to use them as promotional sessions on a given course with a fix number of available seats. For now, order groups work just as before, but if you define a starting date, you should define also an ending date of validity.
b48a129
to
5355f60
Compare
We want to be able to define a starting and ending date on order groups. This will allow to use them as promotional sessions on a given course with a fix number of available seats.
For now, order groups work just as before, but if you define a starting date, you should define also an ending date of validity. They are either both set, or neither.
The start date cannot be greater than the end date.
Proposal
start
andend
datetime fields onOrderGroup
model