aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/register/models.py
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-10-11 19:32:34 +0100
committerMatthew Lemon <lemon@matthewlemon.com>2020-10-11 19:32:34 +0100
commit721c0e7e3056d6e14499b807cdc2837505c5ca18 (patch)
treeae1bf3b6951b28cf9c6c761e250c4eb9b9b09186 /ctrack/register/models.py
parent851017203f9962c2d9bd2f483e736ef88ef8f8aa (diff)
first test for caf periodic event
Diffstat (limited to '')
-rw-r--r--ctrack/register/models.py20
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