From abd1b4926bc3aa1d0daba5bc5594a385898dd753 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Sun, 11 Oct 2020 15:17:35 +0100 Subject: added CAFSingleDateEvent event --- ctrack/register/models.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ctrack/register/models.py') 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): -- cgit v1.2.3