Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions backend/benefit/applications/api/v1/application_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
)

Expand Down
16 changes: 16 additions & 0 deletions backend/benefit/calculator/api/v1/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class InstalmentStatusValidator(StatusTransitionValidator):
InstalmentStatus.WAITING: (
InstalmentStatus.ACCEPTED,
InstalmentStatus.CANCELLED,
InstalmentStatus.REQUESTED,
InstalmentStatus.RESPONDED,
InstalmentStatus.PENDING,
),
InstalmentStatus.ACCEPTED: (
InstalmentStatus.WAITING,
Expand All @@ -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,
),
}
3 changes: 3 additions & 0 deletions backend/benefit/calculator/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Original file line number Diff line number Diff line change
@@ -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'),
),
]
5 changes: 4 additions & 1 deletion frontend/benefit/handler/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion frontend/benefit/handler/public/locales/fi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion frontend/benefit/handler/public/locales/sv/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const TemporaryAhjoModeSwitch: React.FC = () => {
variant="supplementary"
size="small"
>
Ahjo-kokeilu
Ahjo-integraatio
<br />
{isNewAhjoMode ? 'on päällä' : 'on pois päältä'}
</Button>
Expand Down
21 changes: 16 additions & 5 deletions frontend/benefit/handler/src/utils/applications.ts
Original file line number Diff line number Diff line change
@@ -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 = (
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions frontend/benefit/shared/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,7 @@ export enum INSTALMENT_STATUSES {
CANCELLED = 'cancelled',
ERROR_IN_TALPA = 'error_in_talpa',
COMPLETED = 'completed',
REQUESTED = 'requested',
RESPONDED = 'responded',
PENDING = 'pending'
}
Loading