TimePeriod describe a formal timeframe of membership validation
For example a membership record on 10th of February 2023 should be valid throught 1st of January 2023 to 31th of December 2023 if the formal timeframe chosen by association is the solar year for members registered in 2023
@ZompaSenior has proposed to implement it with a start and a duration (using RelativeDeltaField field)
An additional end=models.DateField(...) field could be added with a validation which impose that one and only one between duration or end field should be set. Or substituting duration with end. This should permit more fine selection of date interval, but make more complex to set regular interval (yearly, bimonthly, etc, etc)...I think response is obvious
Some notes
TimePeriod.duration == None could be used to intend a membership which doesn't end
TimePeriod.start == None could be used to intend a membership which is retroactively always valid
is not completely clear what field price is referring to, as is I think is the default price to create a membership for that period. In fact discounted or free memberships should be permits. I think this last observation is linked to logic inside Transaction connected to membership model
What to do
[x] Convert default in duration from formal string to a relativedelta from a function
[x] Specify price help text
[x] (optional) Add some method to create common relativedelta timeframe)
TimePeriod describe a formal timeframe of membership validation For example a membership record on 10th of February 2023 should be valid throught 1st of January 2023 to 31th of December 2023 if the formal timeframe chosen by association is the solar year for members registered in 2023
@ZompaSenior has proposed to implement it with a start and a duration (using RelativeDeltaField field)
Implementation
Question: using end_date instead of duration
An additional
end=models.DateField(...)
field could be added with a validation which impose that one and only one between duration or end field should be set. Or substitutingduration
withend
. This should permit more fine selection of date interval, but make more complex to set regular interval (yearly, bimonthly, etc, etc)...I think response is obviousSome notes
TimePeriod.duration == None
could be used to intend a membership which doesn't endTimePeriod.start == None
could be used to intend a membership which is retroactively always validprice
is referring to, as is I think is the default price to create a membership for that period. In fact discounted or free memberships should be permits. I think this last observation is linked to logic inside Transaction connected to membership modelWhat to do