diff options
Diffstat (limited to '')
-rw-r--r-- | ctrack/register/models.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/ctrack/register/models.py b/ctrack/register/models.py index 549f77d..53b65a0 100644 --- a/ctrack/register/models.py +++ b/ctrack/register/models.py @@ -21,11 +21,11 @@ class EventType(Enum): CAF_FEEDBACK_EMAILED_OES = auto() CAF_RECEIVED = auto() CAF_EMAILED_ROSA = auto() + CAF_VALIDATION_SIGN_OFF = auto() + CAF_VALIDATION_RECORD_EMAILED_TO_OES = auto() # twin date caf events CAF_PEER_REVIEW_PERIOD = auto() CAF_VALIDATION_PERIOD = auto() - CAF_VALIDATION_SIGN_OFF = auto() - CAF_VALIDATION_RECORD_EMAILED_TO_OES = auto() def _style_descriptor(days: int) -> str: @@ -106,6 +106,14 @@ class SingleDateMixin(models.Model): abstract = True +class TwinDateMixin(models.Model): + start_date = models.DateField() + end_date = models.DateField() + + class Meta: + abstract = True + + class CAFMixin(models.Model): related_caf = models.ForeignKey(CAF, on_delete=models.CASCADE) @@ -143,6 +151,14 @@ class CAFSingleDateEvent(EventBase, CAFMixin, SingleDateMixin): ] +class CAFTwinDateEvent(EventBase, CAFMixin, TwinDateMixin): + AVAILABLE_TYPES = [ + (EventType.CAF_PEER_REVIEW_PERIOD.name, "CAF - Peer Review Period"), + (EventType.CAF_VALIDATION_PERIOD.name, "CAF - Validation Period"), + ] + type_descriptor = models.CharField(max_length=50, choices=AVAILABLE_TYPES) + + # OLD CODE BELOW |