diff --git a/backend/benefit/applications/api/v1/application_views.py b/backend/benefit/applications/api/v1/application_views.py index 6c5bc7d32c..44fb69e0a9 100755 --- a/backend/benefit/applications/api/v1/application_views.py +++ b/backend/benefit/applications/api/v1/application_views.py @@ -317,6 +317,9 @@ def _get_application_pks_with_instalments(self) -> List[int]: InstalmentStatus.ACCEPTED, InstalmentStatus.ERROR_IN_TALPA, InstalmentStatus.WAITING, + InstalmentStatus.REQUESTED, + InstalmentStatus.RESPONDED, + InstalmentStatus.PENDING, ], ) diff --git a/backend/benefit/calculator/api/v1/validators.py b/backend/benefit/calculator/api/v1/validators.py index a37afb0466..e33cd9d7c1 100644 --- a/backend/benefit/calculator/api/v1/validators.py +++ b/backend/benefit/calculator/api/v1/validators.py @@ -9,6 +9,9 @@ class InstalmentStatusValidator(StatusTransitionValidator): InstalmentStatus.WAITING: ( InstalmentStatus.ACCEPTED, InstalmentStatus.CANCELLED, + InstalmentStatus.REQUESTED, + InstalmentStatus.RESPONDED, + InstalmentStatus.PENDING, ), InstalmentStatus.ACCEPTED: ( InstalmentStatus.WAITING, @@ -25,4 +28,17 @@ class InstalmentStatusValidator(StatusTransitionValidator): InstalmentStatus.COMPLETED, ), InstalmentStatus.COMPLETED: (), + InstalmentStatus.REQUESTED: ( + InstalmentStatus.RESPONDED, + InstalmentStatus.CANCELLED, + ), + InstalmentStatus.RESPONDED: ( + InstalmentStatus.ACCEPTED, + InstalmentStatus.CANCELLED, + InstalmentStatus.PENDING, + ), + InstalmentStatus.PENDING: ( + InstalmentStatus.CANCELLED, + InstalmentStatus.ACCEPTED, + ), } diff --git a/backend/benefit/calculator/enums.py b/backend/benefit/calculator/enums.py index 2d35cb4490..780cc670d2 100644 --- a/backend/benefit/calculator/enums.py +++ b/backend/benefit/calculator/enums.py @@ -42,3 +42,6 @@ class InstalmentStatus(models.TextChoices): CANCELLED = "cancelled", _("Cancelled") ERROR_IN_TALPA = "error_in_talpa", _("Error in TALPA") COMPLETED = "completed", _("Completed") + REQUESTED = "requested", _("Requested") + RESPONDED = "responded", _("Responded") + PENDING = "pending", _("Pending") diff --git a/backend/benefit/calculator/migrations/0019_alter_instalment_status.py b/backend/benefit/calculator/migrations/0019_alter_instalment_status.py new file mode 100644 index 0000000000..f01c2cba32 --- /dev/null +++ b/backend/benefit/calculator/migrations/0019_alter_instalment_status.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.11 on 2026-02-18 10:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('calculator', '0018_instalment_amount_paid'), + ] + + operations = [ + migrations.AlterField( + model_name='instalment', + name='status', + field=models.CharField(blank=True, choices=[('waiting', 'Waiting'), ('accepted', 'Accepted'), ('paid', 'Paid'), ('cancelled', 'Cancelled'), ('error_in_talpa', 'Error in TALPA'), ('completed', 'Completed'), ('requested', 'Requested'), ('responded', 'Responded'), ('pending', 'Pending')], default='waiting', max_length=64, verbose_name='status'), + ), + ] diff --git a/frontend/benefit/handler/public/locales/en/common.json b/frontend/benefit/handler/public/locales/en/common.json index 3b73802e68..50fc0e00db 100644 --- a/frontend/benefit/handler/public/locales/en/common.json +++ b/frontend/benefit/handler/public/locales/en/common.json @@ -227,7 +227,10 @@ "waiting": "Odottaa", "completed": "Maksettu", "error_in_talpa": "Virhe maksussa", - "paid": "Merkitty maksetuksi manuaalisesti" + "paid": "Merkitty maksetuksi manuaalisesti", + "requested": "Pyydetty", + "responded": "Vastattu", + "pending": "Kesken" }, "calculationEndDate": "Viim. tukipäivä", "calculatedBenefitAmount": "Tukisumma", diff --git a/frontend/benefit/handler/public/locales/fi/common.json b/frontend/benefit/handler/public/locales/fi/common.json index 88e655752e..b8d335a973 100644 --- a/frontend/benefit/handler/public/locales/fi/common.json +++ b/frontend/benefit/handler/public/locales/fi/common.json @@ -227,7 +227,10 @@ "waiting": "Odottaa", "completed": "Maksettu", "error_in_talpa": "Virhe maksussa", - "paid": "Merkitty maksetuksi manuaalisesti" + "paid": "Merkitty maksetuksi manuaalisesti", + "requested": "Pyydetty", + "responded": "Vastattu", + "pending": "Kesken" }, "calculationEndDate": "Viim. tukipäivä", "calculatedBenefitAmount": "Tukisumma", diff --git a/frontend/benefit/handler/public/locales/sv/common.json b/frontend/benefit/handler/public/locales/sv/common.json index 7385c571c1..1edde91cde 100644 --- a/frontend/benefit/handler/public/locales/sv/common.json +++ b/frontend/benefit/handler/public/locales/sv/common.json @@ -227,7 +227,10 @@ "waiting": "Odottaa", "completed": "Maksettu", "error_in_talpa": "Virhe maksussa", - "paid": "Merkitty maksetuksi manuaalisesti" + "paid": "Merkitty maksetuksi manuaalisesti", + "requested": "Pyydetty", + "responded": "Vastattu", + "pending": "Kesken" }, "calculationEndDate": "Viim. tukipäivä", "calculatedBenefitAmount": "Tukisumma", diff --git a/frontend/benefit/handler/src/components/header/TemporaryAhjoModeSwitch.tsx b/frontend/benefit/handler/src/components/header/TemporaryAhjoModeSwitch.tsx index e849ca8cc6..40cf37a8b1 100644 --- a/frontend/benefit/handler/src/components/header/TemporaryAhjoModeSwitch.tsx +++ b/frontend/benefit/handler/src/components/header/TemporaryAhjoModeSwitch.tsx @@ -34,7 +34,7 @@ const TemporaryAhjoModeSwitch: React.FC = () => { variant="supplementary" size="small" > - Ahjo-kokeilu + Ahjo-integraatio
{isNewAhjoMode ? 'on päällä' : 'on pois päältä'} diff --git a/frontend/benefit/handler/src/utils/applications.ts b/frontend/benefit/handler/src/utils/applications.ts index 543224981c..3ff1615ff2 100644 --- a/frontend/benefit/handler/src/utils/applications.ts +++ b/frontend/benefit/handler/src/utils/applications.ts @@ -1,8 +1,4 @@ -import { - APPLICATION_STATUSES, - INSTALMENT_STATUSES, - TALPA_STATUSES, -} from 'benefit-shared/constants'; +import {APPLICATION_STATUSES, INSTALMENT_STATUSES, TALPA_STATUSES,} from 'benefit-shared/constants'; import theme from 'shared/styles/theme'; export const getTagStyleForStatus = ( @@ -88,6 +84,21 @@ export const getInstalmentTagStyleForStatus = ( text = theme.colors.white; break; + case INSTALMENT_STATUSES.REQUESTED: + background = theme.colors.info; + text = theme.colors.white; + break; + + case INSTALMENT_STATUSES.RESPONDED: + background = theme.colors.summerMediumLight; + text = theme.colors.black; + break; + + case INSTALMENT_STATUSES.PENDING: + background = theme.colors.suomenlinna; + text = theme.colors.white; + break; + default: background = theme.colors.black40; break; diff --git a/frontend/benefit/shared/src/constants.ts b/frontend/benefit/shared/src/constants.ts index aa4ebbd0fe..4aa6b2d568 100644 --- a/frontend/benefit/shared/src/constants.ts +++ b/frontend/benefit/shared/src/constants.ts @@ -246,4 +246,7 @@ export enum INSTALMENT_STATUSES { CANCELLED = 'cancelled', ERROR_IN_TALPA = 'error_in_talpa', COMPLETED = 'completed', + REQUESTED = 'requested', + RESPONDED = 'responded', + PENDING = 'pending' }