diff options
Diffstat (limited to '')
-rw-r--r-- | ctrack/register/models.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ctrack/register/models.py b/ctrack/register/models.py index c0467b0..12247e8 100644 --- a/ctrack/register/models.py +++ b/ctrack/register/models.py @@ -6,6 +6,7 @@ from typing import Optional, Dict from django.contrib.auth import get_user_model from django.db import models +from ctrack.caf.models import CAF from ctrack.organisations.models import Person from ctrack.users.models import User @@ -92,6 +93,17 @@ class SingleDateTimeEventMixin(models.Model): abstract = True +class SingleDateMixin(models.Model): + date = models.DateField() + + class Meta: + abstract = True + + +class CAFMixin(models.Model): + related_caf = models.ForeignKey(CAF, on_delete=models.CASCADE) + + class SingleDateTimeEvent(EventBase, ThirdPartyEventMixin, SingleDateTimeEventMixin): AVAILABLE_TYPES = [ (EventType.PHONE_CALL.name, "Phone Call"), @@ -110,6 +122,13 @@ class MeetingEvent(EventBase, ThirdPartyEventMixin, SingleDateTimeEventMixin): type_descriptor = models.CharField(max_length=50, choices=AVAILABLE_TYPES) +class CAFSingleDateEvent(EventBase, CAFMixin, SingleDateMixin): + AVAILABLE_TYPES = [ + (EventType.CAF_INITIAL_CAF_RECEIVED.name, "CAF - Initial CAF Received") + ] + type_descriptor = models.CharField(max_length=50, choices=AVAILABLE_TYPES) + + # OLD CODE BELOW class EngagementType(models.Model): |