diff --git a/django/api/constants.py b/django/api/constants.py index 1e4de116..f613d2bf 100644 --- a/django/api/constants.py +++ b/django/api/constants.py @@ -367,30 +367,40 @@ class ScrapItColumnMapping(Enum): class GoElectricRebatesColumns(Enum): APPROVALS = "Approvals" DATE = "Date" - FLEET = "Fleet/Individuals" APPLICANT_NAME = "Applicant Name" MAX_INCENTIVE_AMOUNT_REQUESTED = "Max Incentive Amount Requested" CATEGORY = "Category" + APPLICANT_TYPE = "Fleet/Individuals" INCENTIVE_PAID = "Incentive Paid" TOTAL_PURCHASE_PRICE_PRE_TAX = "Total Purchase Price (pre-tax)" MANUFACTURER = "Manufacturer" MODEL = "Model" - GER_CLASS = "Class" + CITY = "City" + POSTAL_CODE = "Postal Code" + PHONE = "Phone" + EMAIL = "Email" + VIN = "VIN" + VEHICLE_CLASS = "Class" class GoElectricRebatesColumnMapping(Enum): approvals = "Approvals" date = "Date" - fleet = "Fleet/Individuals" applicant_name = "Applicant Name" max_incentive_amount_requested = "Max Incentive Amount Requested" category = "Category" - applicant_type = "Applicant Type" + applicant_type = "Fleet/Individuals" incentive_paid = "Incentive Paid" total_purchase_price = "Total Purchase Price (pre-tax)" manufacturer = "Manufacturer" model = "Model" - ger_class = "Class" + city = "City" + postal_code = "Postal Code" + phone = "Phone" + email = "Email" + vin = "VIN" + vehicle_class = "Class" + FIELD_TYPES = { @@ -552,7 +562,6 @@ class GoElectricRebatesColumnMapping(Enum): "Go Electric Rebates Program": { "approvals": str, "date": datetime.date, - "fleet": str, "applicant_name": str, "max_incentive_amount_requested": int, "category": str, @@ -561,8 +570,14 @@ class GoElectricRebatesColumnMapping(Enum): "total_purchase_price": int, "manufacturer": str, "model": str, - "ger_class": str + "city": str, + "postal_code": str, + "phone": str, + "email": str, + "vin": str, + "vehicle_class": str, }, + } DATASET_CONFIG = { diff --git a/django/api/migrations/0024_auto_20240516_2114.py b/django/api/migrations/0024_auto_20240516_2114.py new file mode 100644 index 00000000..3915815b --- /dev/null +++ b/django/api/migrations/0024_auto_20240516_2114.py @@ -0,0 +1,100 @@ +# Generated by Django 3.2.25 on 2024-05-16 21:14 + +from django.db import migrations, models +import django.utils.timezone + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0023_auto_20240514_1721'), + ] + + operations = [ + migrations.RenameField( + model_name='goelectricrebates', + old_name='ger_class', + new_name='vehicle_class', + ), + migrations.AddField( + model_name='goelectricrebates', + name='city', + field=models.CharField(default=django.utils.timezone.now, max_length=250), + preserve_default=False, + ), + migrations.AddField( + model_name='goelectricrebates', + name='email', + field=models.CharField(default='a', max_length=50), + preserve_default=False, + ), + migrations.AddField( + model_name='goelectricrebates', + name='flagged', + field=models.CharField(blank=True, max_length=50, null=True), + ), + migrations.AddField( + model_name='goelectricrebates', + name='phone', + field=models.CharField(default='123', max_length=20), + preserve_default=False, + ), + migrations.AddField( + model_name='goelectricrebates', + name='postal_code', + field=models.CharField(blank=True, max_length=250, null=True), + ), + migrations.AddField( + model_name='goelectricrebates', + name='vin', + field=models.CharField(blank=True, max_length=100, null=True), + ), + migrations.AlterField( + model_name='goelectricrebates', + name='applicant_name', + field=models.CharField(default='a', max_length=250), + preserve_default=False, + ), + migrations.AlterField( + model_name='goelectricrebates', + name='approvals', + field=models.CharField(default='a', max_length=20), + preserve_default=False, + ), + migrations.AlterField( + model_name='goelectricrebates', + name='category', + field=models.CharField(default='a', max_length=250), + preserve_default=False, + ), + migrations.AlterField( + model_name='goelectricrebates', + name='date', + field=models.DateField(default=django.utils.timezone.now, max_length=20), + preserve_default=False, + ), + migrations.AlterField( + model_name='goelectricrebates', + name='incentive_paid', + field=models.IntegerField(default=1), + preserve_default=False, + ), + migrations.AlterField( + model_name='goelectricrebates', + name='manufacturer', + field=models.CharField(default='a', max_length=250), + preserve_default=False, + ), + migrations.AlterField( + model_name='goelectricrebates', + name='model', + field=models.CharField(default='a', max_length=250), + preserve_default=False, + ), + migrations.AlterField( + model_name='goelectricrebates', + name='total_purchase_price', + field=models.IntegerField(default=1), + preserve_default=False, + ), + ] diff --git a/django/api/migrations/0025_auto_20240516_2248.py b/django/api/migrations/0025_auto_20240516_2248.py new file mode 100644 index 00000000..e10058bd --- /dev/null +++ b/django/api/migrations/0025_auto_20240516_2248.py @@ -0,0 +1,21 @@ +# Generated by Django 3.2.25 on 2024-05-16 22:48 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0024_auto_20240516_2114'), + ] + + operations = [ + migrations.RemoveField( + model_name='goelectricrebates', + name='flagged', + ), + migrations.RemoveField( + model_name='goelectricrebates', + name='fleet', + ), + ] diff --git a/django/api/models/go_electric_rebates.py b/django/api/models/go_electric_rebates.py index af672482..b266e11d 100644 --- a/django/api/models/go_electric_rebates.py +++ b/django/api/models/go_electric_rebates.py @@ -4,27 +4,31 @@ class GoElectricRebates(Auditable): - approvals = models.CharField(blank=True, null=True, max_length=20) - date = models.DateField(max_length=20, null=True, blank=True) - fleet = models.CharField(max_length=20) - applicant_name = models.CharField(blank=True, null=True, max_length=250) + approvals = models.CharField(blank=False, null=False, max_length=20) + date = models.DateField(max_length=20, null=False, blank=False) + applicant_name = models.CharField(blank=False, null=False, max_length=250) max_incentive_amount_requested = models.IntegerField( null=True, blank=True, ) - category = models.CharField(blank=True, max_length=250, null=True) + category = models.CharField(blank=False, max_length=250, null=False) applicant_type = models.CharField(blank=True, max_length=50, null=True) incentive_paid = models.IntegerField( - null=True, - blank=True, + null=False, + blank=False, ) total_purchase_price = models.IntegerField( - null=True, - blank=True, + null=False, + blank=False, ) - manufacturer = models.CharField(blank=True, max_length=250, null=True) - model = models.CharField(blank=True, max_length=250, null=True) - ger_class = models.CharField(blank=True, null=True, max_length=50) + manufacturer = models.CharField(blank=False, max_length=250, null=False) + model = models.CharField(blank=False, max_length=250, null=False) + city = models.CharField(blank=False, max_length=250, null=False) + postal_code = models.CharField(blank=True, max_length=250, null=True) + phone = models.CharField(blank=False, max_length=20, null=False) + email = models.CharField(blank=False, max_length=50, null=False) + vin = models.CharField(blank=True, max_length=100, null=True) + vehicle_class = models.CharField(blank=True, null=True, max_length=50) class Meta: db_table = "go_electric_rebates"