-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HL-897, HL-943, HL-942, HL-977: New terms application forms (#2286)
* feat: new benefit terms modifications (handler) * feat: new subsidy options * feat: continue new terms changes * feat: fix date inputs * fix: wrong i18n import and usage of static props errored in nextjs console * fix: koros id SSR / client mismatch; use correct bg color for footer * feat: add font weight and heading level prop to form section * feat: restructure application step 1 * docs: add some notes to .env example * fix: de_minimis_aid can be either False or None * feat!: restructure frontend of application step 2 * refactor!: only use one benefit type; pay_subsidy_granted as string pay_subsidy_granted can be "default", "aged" or "no"; only use salary_benefit; check apprenticeship_program validation on save * refactor: localization update per new translations * feat: use env to set TestCafe timeouts for local testing * refactor: browser tests are on par with step 1 and 2 changes * refactor: backend tests compatible with pay_subsidy_granted type change * feat: merge 943 and companysection * feat: first handler app with new terms * feat!: database migration to new terms * fix: correct translations * fix: linter * fix: remove employee phone_number test * fix: lint, ts, i18n * fix: skip flaking ahjo test * fix: merged feature backend tests * fix: bugs related to step 2 --------- Co-authored-by: Sampo Tawast <sampo.tawast@gmail.com> Co-authored-by: Janne Juhola <janne.juhola@varaani.com>
- Loading branch information
1 parent
557e823
commit de31e8a
Showing
67 changed files
with
1,961 additions
and
2,026 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
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
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
78 changes: 78 additions & 0 deletions
78
backend/benefit/applications/migrations/0040_pay_subsidy_types.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,78 @@ | ||
# Generated by Django 3.2.18 on 2023-09-21 10:39 | ||
|
||
from django.db import migrations, models | ||
from applications.enums import PaySubsidyGranted | ||
|
||
|
||
def migrate_pay_subsidy_types(apps, _): | ||
def _migrate_pay_subsidy_types(applications): | ||
for app in applications.objects.all(): | ||
app.pay_subsidy_granted = ( | ||
PaySubsidyGranted.GRANTED | ||
if app.pay_subsidy_granted_old | ||
else PaySubsidyGranted.NOT_GRANTED | ||
) | ||
app.save() | ||
|
||
application = apps.get_model("applications", "Application") | ||
hist_application = apps.get_model("applications", "HistoricalApplication") | ||
_migrate_pay_subsidy_types(application) | ||
_migrate_pay_subsidy_types(hist_application) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("applications", "0039_alter_paysubsidy_percentages"), | ||
] | ||
|
||
operations = [ | ||
migrations.RenameField( | ||
model_name="application", | ||
old_name="pay_subsidy_granted", | ||
new_name="pay_subsidy_granted_old", | ||
), | ||
migrations.RenameField( | ||
model_name="historicalapplication", | ||
old_name="pay_subsidy_granted", | ||
new_name="pay_subsidy_granted_old", | ||
), | ||
migrations.AddField( | ||
model_name="application", | ||
name="pay_subsidy_granted", | ||
field=models.CharField( | ||
blank=True, | ||
choices=[ | ||
("granted", "Pay subsidy granted (default)"), | ||
("granted_aged", "Pay subsidy granted (aged)"), | ||
("not_granted", "No granted pay subsidy"), | ||
], | ||
max_length=128, | ||
null=True, | ||
), | ||
), | ||
migrations.AddField( | ||
model_name="historicalapplication", | ||
name="pay_subsidy_granted", | ||
field=models.CharField( | ||
blank=True, | ||
choices=[ | ||
("granted", "Pay subsidy granted (default)"), | ||
("granted_aged", "Pay subsidy granted (aged)"), | ||
("not_granted", "No granted pay subsidy"), | ||
], | ||
max_length=128, | ||
null=True, | ||
), | ||
), | ||
migrations.RunPython( | ||
migrate_pay_subsidy_types, reverse_code=migrations.RunPython.noop | ||
), | ||
migrations.RemoveField( | ||
model_name="application", | ||
name="pay_subsidy_granted_old", | ||
), | ||
migrations.RemoveField( | ||
model_name="historicalapplication", | ||
name="pay_subsidy_granted_old", | ||
), | ||
] |
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
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
Oops, something went wrong.