aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ctrack/caf/migrations/0015_auto_20200303_0727.py19
-rw-r--r--ctrack/caf/migrations/0016_auto_20200303_0825.py36
-rw-r--r--ctrack/caf/models.py6
-rw-r--r--ctrack/caf/tests/factories.py7
-rw-r--r--ctrack/organisations/management/commands/populate_db.py4
-rw-r--r--ctrack/organisations/migrations/0005_auto_20200303_0727.py18
6 files changed, 87 insertions, 3 deletions
diff --git a/ctrack/caf/migrations/0015_auto_20200303_0727.py b/ctrack/caf/migrations/0015_auto_20200303_0727.py
new file mode 100644
index 0000000..d0f3e8a
--- /dev/null
+++ b/ctrack/caf/migrations/0015_auto_20200303_0727.py
@@ -0,0 +1,19 @@
+# Generated by Django 2.2.9 on 2020-03-03 07:27
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('caf', '0014_auto_20200228_2215'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='essentialservice',
+ name='caf',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='essential_services', to='caf.CAF'),
+ ),
+ ]
diff --git a/ctrack/caf/migrations/0016_auto_20200303_0825.py b/ctrack/caf/migrations/0016_auto_20200303_0825.py
new file mode 100644
index 0000000..49c6c4e
--- /dev/null
+++ b/ctrack/caf/migrations/0016_auto_20200303_0825.py
@@ -0,0 +1,36 @@
+# Generated by Django 2.2.9 on 2020-03-03 08:25
+
+from django.db import migrations, models
+import django.db.models.deletion
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organisations', '0005_auto_20200303_0727'),
+ ('caf', '0015_auto_20200303_0727'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='caf',
+ name='comments',
+ field=models.TextField(default='No comment', max_length=1000),
+ preserve_default=False,
+ ),
+ migrations.AddField(
+ model_name='caf',
+ name='triage_review_date',
+ field=models.DateField(blank=True, null=True),
+ ),
+ migrations.AddField(
+ model_name='caf',
+ name='triage_review_inspector',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='organisations.Person'),
+ ),
+ migrations.AddField(
+ model_name='caf',
+ name='version',
+ field=models.CharField(blank=True, max_length=10, null=True),
+ ),
+ ]
diff --git a/ctrack/caf/models.py b/ctrack/caf/models.py
index 59675e0..9f01739 100644
--- a/ctrack/caf/models.py
+++ b/ctrack/caf/models.py
@@ -1,6 +1,6 @@
from django.db import models
-from ctrack.organisations.models import Organisation
+from ctrack.organisations.models import Organisation, Person
class Grading(models.Model):
@@ -66,6 +66,10 @@ class CAF(models.Model):
confidence_grading = models.ForeignKey(Grading, on_delete=models.CASCADE, blank=True, null=True,
related_name="confidence_grading")
file = models.ForeignKey(DocumentFile, on_delete=models.CASCADE, blank=True, null=True)
+ version = models.CharField(max_length=10, blank=True, null=True)
+ triage_review_date = models.DateField(blank=True, null=True)
+ triage_review_inspector = models.ForeignKey(Person, on_delete=models.CASCADE, blank=True, null=True)
+ comments = models.TextField(max_length=1000)
class Meta:
verbose_name = "CAF"
diff --git a/ctrack/caf/tests/factories.py b/ctrack/caf/tests/factories.py
index 1492db4..2e5bd36 100644
--- a/ctrack/caf/tests/factories.py
+++ b/ctrack/caf/tests/factories.py
@@ -4,7 +4,7 @@ import factory
from factory import Faker
from ctrack.caf.models import EssentialService, Grading, DocumentFile, FileStore, CAF
-from ctrack.organisations.tests.factories import OrganisationFactory
+from ctrack.organisations.tests.factories import OrganisationFactory, PersonFactory
class CAFFactory(factory.DjangoModelFactory):
@@ -12,6 +12,11 @@ class CAFFactory(factory.DjangoModelFactory):
quality_grading = factory.SubFactory("ctrack.caf.tests.factories.GradingFactory")
confidence_grading = factory.SubFactory("ctrack.caf.tests.factories.GradingFactory")
file = None
+ version = Faker("bothify", text="??##", letters="ABCD")
+ triage_review_date = Faker("date_object")
+ triage_review_inspector = factory.SubFactory(PersonFactory)
+ comments = Faker("paragraph", nb_sentences=5, variable_nb_sentences=True, ext_word_list=None)
+
class Meta:
model = CAF
diff --git a/ctrack/organisations/management/commands/populate_db.py b/ctrack/organisations/management/commands/populate_db.py
index 8a2ad84..31e2447 100644
--- a/ctrack/organisations/management/commands/populate_db.py
+++ b/ctrack/organisations/management/commands/populate_db.py
@@ -139,7 +139,7 @@ class Command(BaseCommand):
etf1 = EngagementTypeFactory(descriptor="Information Notice")
etf2 = EngagementTypeFactory(descriptor="Designation Letter")
- etf3 = EngagementTypeFactory(descriptor="CAF Submission")
+ etf3 = EngagementTypeFactory(descriptor="CAF - Initial Submission")
ee1 = EngagementEventFactory.create(type=etf1, user=user, participants=[p1, p2])
ee2 = EngagementEventFactory.create(type=etf2, user=user, participants=[p3])
@@ -163,6 +163,8 @@ class Command(BaseCommand):
owner=random.choice(orgs),
quality_grading__descriptor=random.choice(q_descriptors),
confidence_grading__descriptor=random.choice(c_descriptors),
+ triage_review_date=None,
+ triage_review_inspector=None,
)
for _ in range(35)
]
diff --git a/ctrack/organisations/migrations/0005_auto_20200303_0727.py b/ctrack/organisations/migrations/0005_auto_20200303_0727.py
new file mode 100644
index 0000000..8db8302
--- /dev/null
+++ b/ctrack/organisations/migrations/0005_auto_20200303_0727.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.9 on 2020-03-03 07:27
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('organisations', '0004_auto_20200220_1634'),
+ ]
+
+ operations = [
+ migrations.AlterField(
+ model_name='organisation',
+ name='designation_type',
+ field=models.IntegerField(choices=[(1, 'Automatic'), (2, 'Reserve Power'), (3, 'NA')], default=1),
+ ),
+ ]