-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tracking pull request to merge release-1.20.0 to master - Sprint 30 (…
…Darwin) (#557)
- Loading branch information
1 parent
3013109
commit 3f5441c
Showing
91 changed files
with
33,565 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ db.sqlite3 | |
.coverage | ||
frontend/coverage/ | ||
backend/minio/ | ||
.sql.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
backend/api/fixtures/operational/0020_update_credit_classes.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from django.db import transaction | ||
|
||
from api.management.data_script import OperationalDataScript | ||
from api.models.credit_class import CreditClass | ||
|
||
|
||
class UpdateCreditClasses(OperationalDataScript): | ||
is_revertable = False | ||
comment = 'Updates the credit classes' | ||
|
||
def check_run_preconditions(self): | ||
return True | ||
|
||
@transaction.atomic | ||
def run(self): | ||
CreditClass.objects.get_or_create( | ||
credit_class='C', | ||
defaults={ | ||
'effective_date': "2018-01-01" | ||
} | ||
) | ||
|
||
|
||
script_class = UpdateCreditClasses |
37 changes: 37 additions & 0 deletions
37
backend/api/fixtures/operational/0021_update_model_year.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from django.db import transaction | ||
|
||
from api.management.data_script import OperationalDataScript | ||
from api.models.model_year import ModelYear | ||
|
||
|
||
class UpdateModelYear(OperationalDataScript): | ||
""" | ||
Add 2017-2018 model years | ||
""" | ||
is_revertable = False | ||
comment = 'Add 2017-2018 model years' | ||
|
||
def check_run_preconditions(self): | ||
to_check = ["2017,2018"] | ||
for year in to_check: | ||
if ModelYear.objects.filter(name=year).exists(): | ||
return False | ||
return True | ||
|
||
@transaction.atomic | ||
def run(self): | ||
ModelYear.objects.create( | ||
effective_date="2017-01-01", | ||
expiration_date="2017-12-31", | ||
name="2017" | ||
) | ||
|
||
ModelYear.objects.create( | ||
effective_date="2018-01-01", | ||
expiration_date="2018-12-31", | ||
name="2018" | ||
) | ||
|
||
|
||
|
||
script_class = UpdateModelYear |
85 changes: 85 additions & 0 deletions
85
...modelyearreport_modelyearreportconfirmation_modelyearreporthistory_modelyearreportmake.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Generated by Django 3.0.7 on 2021-02-10 20:45 | ||
|
||
import api.models.model_year_report_statuses | ||
import db_comments.model_mixins | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import enumfields.fields | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0089_auto_20210203_1044'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ModelYearReport', | ||
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)), | ||
('organization_name', models.CharField(max_length=500)), | ||
('supplier_class', models.CharField(max_length=1)), | ||
('validation_status', enumfields.fields.EnumField(default='DRAFT', enum=api.models.model_year_report_statuses.ModelYearReportStatuses, max_length=20)), | ||
('model_year', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.ModelYear')), | ||
], | ||
options={ | ||
'db_table': 'model_year_report', | ||
}, | ||
bases=(models.Model, db_comments.model_mixins.DBComments), | ||
), | ||
migrations.CreateModel( | ||
name='ModelYearReportMake', | ||
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)), | ||
('make', models.CharField(max_length=250)), | ||
('model_year_report', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='model_year_report_makes', to='api.ModelYearReport')), | ||
], | ||
options={ | ||
'db_table': 'model_year_report_make', | ||
}, | ||
bases=(models.Model, db_comments.model_mixins.DBComments), | ||
), | ||
migrations.CreateModel( | ||
name='ModelYearReportHistory', | ||
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)), | ||
('validation_status', enumfields.fields.EnumField(default='DRAFT', enum=api.models.model_year_report_statuses.ModelYearReportStatuses, max_length=20)), | ||
('model_year_report', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='model_year_report_history', to='api.ModelYearReport')), | ||
], | ||
options={ | ||
'db_table': 'model_year_report_history', | ||
}, | ||
bases=(models.Model, db_comments.model_mixins.DBComments), | ||
), | ||
migrations.CreateModel( | ||
name='ModelYearReportConfirmation', | ||
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)), | ||
('has_accepted', models.BooleanField()), | ||
('title', models.CharField(blank=True, max_length=100, null=True)), | ||
('model_year_report', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='model_year_report_confirmations', to='api.ModelYearReport')), | ||
('signing_authority_assertion', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='model_year_report_confirmations', to='api.SigningAuthorityAssertion')), | ||
], | ||
options={ | ||
'db_table': 'model_year_report_confirmation', | ||
}, | ||
bases=(models.Model, db_comments.model_mixins.DBComments), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Generated by Django 3.0.7 on 2021-02-10 23:12 | ||
|
||
import db_comments.model_mixins | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0090_modelyearreport_modelyearreportconfirmation_modelyearreporthistory_modelyearreportmake'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ModelYearReportAddress', | ||
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)), | ||
('representative_name', models.CharField(blank=True, max_length=100, null=True)), | ||
('address_line_1', models.CharField(blank=True, max_length=500, null=True)), | ||
('address_line_2', models.CharField(blank=True, max_length=100, null=True)), | ||
('address_line_3', models.CharField(blank=True, max_length=100, null=True)), | ||
('city', models.CharField(blank=True, max_length=100, null=True)), | ||
('postal_code', models.CharField(blank=True, max_length=10, null=True)), | ||
('state', models.CharField(blank=True, max_length=50, null=True)), | ||
('county', models.CharField(blank=True, max_length=50, null=True)), | ||
('country', models.CharField(blank=True, max_length=100, null=True)), | ||
('other', models.CharField(blank=True, max_length=100, null=True)), | ||
('address_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='api.AddressType')), | ||
('model_year_report', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='model_year_report_addresses', to='api.ModelYearReport')), | ||
], | ||
options={ | ||
'db_table': 'model_year_report_address', | ||
}, | ||
bases=(models.Model, db_comments.model_mixins.DBComments), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Generated by Django 3.0.7 on 2021-02-10 21:57 | ||
|
||
import db_comments.model_mixins | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0091_modelyearreportaddress'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='modelyearreport', | ||
name='ldv_sales', | ||
field=models.DecimalField(decimal_places=2, max_digits=20, null=True), | ||
), | ||
migrations.CreateModel( | ||
name='ModelYearReportVehicle', | ||
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)), | ||
('pending_sales', models.IntegerField()), | ||
('sales_issued', models.IntegerField()), | ||
('make', models.CharField(max_length=250)), | ||
('model', models.CharField(max_length=250)), | ||
('range', models.DecimalField(decimal_places=2, max_digits=20)), | ||
('model_year', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.ModelYear')), | ||
('zev_class', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.VehicleClass')), | ||
('zev_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.ZevType')), | ||
], | ||
options={ | ||
'db_table': 'model_year_report_vehicle', | ||
}, | ||
bases=(models.Model, db_comments.model_mixins.DBComments), | ||
), | ||
migrations.CreateModel( | ||
name='ModelYearReportPreviousSales', | ||
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)), | ||
('previous_sales', models.DecimalField(decimal_places=2, max_digits=20)), | ||
('model_year', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.ModelYear')), | ||
('model_year_report', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='api.ModelYearReport')), | ||
], | ||
options={ | ||
'db_table': 'model_year_report_previous_sales', | ||
}, | ||
bases=(models.Model, db_comments.model_mixins.DBComments), | ||
), | ||
] |
20 changes: 20 additions & 0 deletions
20
backend/api/migrations/0093_modelyearreport_organization.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Generated by Django 3.0.7 on 2021-02-16 21:29 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0092_auto_20210210_1357'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='modelyearreport', | ||
name='organization', | ||
field=models.ForeignKey(default=0, on_delete=django.db.models.deletion.PROTECT, to='api.Organization'), | ||
preserve_default=False, | ||
), | ||
] |
Oops, something went wrong.