diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-11 15:17:35 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-10-11 15:17:35 +0100 |
commit | abd1b4926bc3aa1d0daba5bc5594a385898dd753 (patch) | |
tree | 85b2e6e511765e5419035f03ecada0955c6620d0 /ctrack/register/models.py | |
parent | d4f1bdfadb39ed966c2aeddba1b7fff898042fe6 (diff) |
added CAFSingleDateEvent event
Diffstat (limited to 'ctrack/register/models.py')
-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): |