diff --git a/django/api/migrations/0002_goelectricrebateapplication_application_type_and_more.py b/django/api/migrations/0002_goelectricrebateapplication_application_type_and_more.py
new file mode 100644
index 00000000..e9421f52
--- /dev/null
+++ b/django/api/migrations/0002_goelectricrebateapplication_application_type_and_more.py
@@ -0,0 +1,49 @@
+# Generated by Django 4.0.1 on 2022-04-12 22:18
+
+from django.db import migrations, models
+import django.db.models.deletion
+import encrypted_fields.fields
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('api', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='goelectricrebateapplication',
+ name='application_type',
+ field=models.CharField(default='individual', max_length=25),
+ preserve_default=False,
+ ),
+ migrations.AddField(
+ model_name='goelectricrebateapplication',
+ name='spouse_email',
+ field=models.EmailField(blank=True, max_length=250, null=True),
+ ),
+ migrations.CreateModel(
+ name='HouseholdMember',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('create_timestamp', models.DateTimeField(auto_now_add=True, null=True)),
+ ('create_user', models.CharField(default='SYSTEM', max_length=130)),
+ ('update_timestamp', models.DateTimeField(auto_now=True, null=True)),
+ ('update_user', models.CharField(max_length=130, null=True)),
+ ('sin', encrypted_fields.fields.EncryptedCharField(max_length=9)),
+ ('last_name', models.CharField(max_length=250)),
+ ('first_name', models.CharField(max_length=250)),
+ ('middle_names', models.CharField(blank=True, max_length=250, null=True)),
+ ('email', models.EmailField(max_length=250)),
+ ('date_of_birth', models.DateField()),
+ ('doc1', models.ImageField(upload_to='docs')),
+ ('doc2', models.ImageField(upload_to='docs')),
+ ('verified', models.BooleanField()),
+ ('application', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.goelectricrebateapplication')),
+ ],
+ options={
+ 'db_table': 'household_member',
+ },
+ ),
+ ]
diff --git a/django/api/models/__init__.py b/django/api/models/__init__.py
index 0a3deb04..e2527445 100644
--- a/django/api/models/__init__.py
+++ b/django/api/models/__init__.py
@@ -2,3 +2,4 @@
Model Initializer
"""
from . import go_electric_rebate_application
+from . import household_member
\ No newline at end of file
diff --git a/django/api/models/go_electric_rebate_application.py b/django/api/models/go_electric_rebate_application.py
index 6a61584b..8ec5afbf 100644
--- a/django/api/models/go_electric_rebate_application.py
+++ b/django/api/models/go_electric_rebate_application.py
@@ -77,6 +77,18 @@ def doc2_tag(self):
verified = BooleanField()
+ spouse_email = EmailField(
+ max_length=250,
+ unique=False,
+ null=True,
+ blank=True
+ )
+
+ application_type = CharField(
+ max_length=25,
+ unique=False,
+ )
+
def __str__(self):
return self.last_name + ', ' + self.first_name
diff --git a/django/api/models/household_member.py b/django/api/models/household_member.py
new file mode 100644
index 00000000..a8bdfc54
--- /dev/null
+++ b/django/api/models/household_member.py
@@ -0,0 +1,66 @@
+import uuid
+from django.db.models import CharField, IntegerField, ImageField, \
+ DateField, EmailField, BooleanField, UUIDField, PROTECT, ForeignKey
+from encrypted_fields.fields import EncryptedCharField
+from auditable.models import Auditable
+from django.utils.html import mark_safe
+from django.core.files.storage import get_storage_class
+
+media_storage = get_storage_class()()
+
+
+class HouseholdMember(Auditable):
+ application = ForeignKey(
+ 'GoElectricRebateApplication',
+ on_delete=PROTECT,
+ )
+ sin = EncryptedCharField(
+ max_length=9,
+ unique=False
+ )
+ last_name = CharField(
+ max_length=250,
+ unique=False
+ )
+ first_name = CharField(
+ max_length=250,
+ unique=False
+ )
+ middle_names = CharField(
+ max_length=250,
+ unique=False,
+ blank=True,
+ null=True
+ )
+ email = EmailField(
+ max_length=250,
+ unique=False
+ )
+ date_of_birth = DateField()
+ doc1 = ImageField(upload_to='docs')
+
+ def doc1_tag(self):
+ return mark_safe(
+ ''
+ % (media_storage.url(name=self.doc1.file.name))
+ )
+
+ doc1_tag.short_description = 'First Uploaded Document'
+
+ doc2 = ImageField(upload_to='docs')
+
+ def doc2_tag(self):
+ return mark_safe(
+ ''
+ % (media_storage.url(name=self.doc2.file.name))
+ )
+
+ doc2_tag.short_description = 'Second Uploaded Document'
+
+ verified = BooleanField()
+
+ def __str__(self):
+ return self.last_name + ', ' + self.first_name
+
+ class Meta:
+ db_table = 'household_member'
diff --git a/django/api/models/income_verification2.py b/django/api/models/income_verification2.py
deleted file mode 100644
index 0ed6350e..00000000
--- a/django/api/models/income_verification2.py
+++ /dev/null
@@ -1,17 +0,0 @@
-from django.db.models import CharField, IntegerField, BooleanField
-from auditable.models import Auditable
-
-
-class IncomeVerification2(Auditable):
- household = BooleanField(
- default=False
- )
-
- # TBD: Maybe just add email address if that's all we need.
- spouse_id = IntegerField(
- blank=True,
- null=True
- )
-
- class Meta:
- db_table = 'income_verification'
diff --git a/django/api/serializers/application_form.py b/django/api/serializers/application_form.py
index 9c1275cb..6f8b7f58 100644
--- a/django/api/serializers/application_form.py
+++ b/django/api/serializers/application_form.py
@@ -26,6 +26,8 @@ def create(self, validated_data):
doc2=validated_data['doc2'],
tax_year=2021,
verified=False,
+ application_type=validated_data['application_type'],
+ spouse_email=validated_data['spouse_email']
)
return obj