Skip to content

Commit

Permalink
fix: modify batches to better support TALPA and handler's work (HL-10…
Browse files Browse the repository at this point in the history
…53) (#2615)

* feat: separate inspection and completion phase

* feat: reorganize to better support new tab structure

* fix: use completed status when rejected applications are sent to archive
  • Loading branch information
sirtawast authored Jan 4, 2024
1 parent da21477 commit 8c58eb0
Show file tree
Hide file tree
Showing 17 changed files with 403 additions and 314 deletions.
11 changes: 6 additions & 5 deletions backend/benefit/applications/api/v1/application_batch_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,25 +310,24 @@ def status(self, request, pk=None):
ApplicationBatchStatus.DECIDED_ACCEPTED,
ApplicationBatchStatus.DECIDED_REJECTED,
ApplicationBatchStatus.SENT_TO_TALPA,
ApplicationBatchStatus.COMPLETED,
]:
return Response(status=status.HTTP_400_BAD_REQUEST)

# Patch all required fields after batch inspection
if new_status in [
ApplicationBatchStatus.DECIDED_ACCEPTED,
ApplicationBatchStatus.DECIDED_REJECTED,
]:
# Patch all required fields after batch inspection
for key in request.data:
setattr(batch, key, request.data.get(key))

# Archive all applications if this batch will be completed
if new_status in [
ApplicationBatchStatus.SENT_TO_TALPA,
ApplicationBatchStatus.DECIDED_REJECTED,
ApplicationBatchStatus.COMPLETED,
]:
# Archive all applications if this batch will be completed
Application.objects.filter(batch=batch).update(archived=True)

previous_status = batch.status
batch.status = new_status

try:
Expand All @@ -353,6 +352,8 @@ def status(self, request, pk=None):
status=status.HTTP_400_BAD_REQUEST,
)

previous_status = batch.status

return Response(
{
"id": batch.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def test_deassign_applications_from_batch_all(handler_api_client, application_ba
@pytest.mark.parametrize(
"batch_status,status_code,changed_status",
[
(ApplicationBatchStatus.COMPLETED, 400, None),
(ApplicationBatchStatus.COMPLETED, 200, None),
(ApplicationBatchStatus.SENT_TO_TALPA, 200, None),
(ApplicationBatchStatus.RETURNED, 400, None),
(ApplicationBatchStatus.DECIDED_ACCEPTED, 200, None),
Expand Down
9 changes: 6 additions & 3 deletions frontend/benefit/handler/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1057,15 +1057,18 @@
"multiple": "Koonnit",
"tabs": {
"pending": "Odottaa Ahjoon vientiä",
"toPaymentAndArchive": "Odottaa maksuun tai arkistoon vientiä"
"inspection": "Odottaa maksuun vientiä",
"completion": "Lähetetty maksuun"
},
"list": {
"columns": {
"createdAt": "Luotu",
"status": "Tila",
"statuses": {
"accepted": "Myönteiset",
"rejected": "Kielteiset"
"rejected": "Kielteiset",
"inPayment": "Maksussa",
"waitingForPayment": "Menossa maksuun"
},
"handler": "Käsittelijä"
},
Expand All @@ -1090,7 +1093,7 @@
"statusChange": {
"awaiting_ahjo_decision": "Koonti merkitty Ahjoon viedyksi",
"exported_ahjo_report": "Ahjo-valmistelu aloitettu, koonti lukittu",
"sent_to_talpa": "Koonti käsitelty ja arkistoitu",
"completed": "Koonti käsitelty ja arkistoitu",
"draft": "Koonti palautettu takaisin odottamaan päätösvalmistelua",
"accepted": "Tarkastustiedot tallennettu",
"rejected": "Koonti arkistoitu"
Expand Down
11 changes: 7 additions & 4 deletions frontend/benefit/handler/public/locales/fi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1057,15 +1057,18 @@
"multiple": "Koonnit",
"tabs": {
"pending": "Odottaa Ahjoon vientiä",
"toPaymentAndArchive": "Odottaa maksuun tai arkistoon vientiä"
"inspection": "Odottaa maksuun vientiä",
"completion": "Lähetetty maksuun"
},
"list": {
"columns": {
"createdAt": "Luotu",
"createdAt": "Luotu ",
"status": "Tila",
"statuses": {
"accepted": "Myönteiset",
"rejected": "Kielteiset"
"rejected": "Kielteiset",
"inPayment": "Maksussa",
"waitingForPayment": "Menossa maksuun"
},
"handler": "Käsittelijä"
},
Expand All @@ -1090,7 +1093,7 @@
"statusChange": {
"awaiting_ahjo_decision": "Koonti merkitty Ahjoon viedyksi",
"exported_ahjo_report": "Ahjo-valmistelu aloitettu, koonti lukittu",
"sent_to_talpa": "Koonti käsitelty ja arkistoitu",
"completed": "Koonti käsitelty ja arkistoitu",
"draft": "Koonti palautettu takaisin odottamaan päätösvalmistelua",
"accepted": "Tarkastustiedot tallennettu",
"rejected": "Koonti arkistoitu"
Expand Down
9 changes: 6 additions & 3 deletions frontend/benefit/handler/public/locales/sv/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -1057,15 +1057,18 @@
"multiple": "Koonnit",
"tabs": {
"pending": "Odottaa Ahjoon vientiä",
"toPaymentAndArchive": "Odottaa maksuun tai arkistoon vientiä"
"inspection": "Odottaa maksuun vientiä",
"completion": "Lähetetty maksuun"
},
"list": {
"columns": {
"createdAt": "Luotu",
"status": "Tila",
"statuses": {
"accepted": "Myönteiset",
"rejected": "Kielteiset"
"rejected": "Kielteiset",
"inPayment": "Maksussa",
"waitingForPayment": "Menossa maksuun"
},
"handler": "Käsittelijä"
},
Expand All @@ -1090,7 +1093,7 @@
"statusChange": {
"awaiting_ahjo_decision": "Koonti merkitty Ahjoon viedyksi",
"exported_ahjo_report": "Ahjo-valmistelu aloitettu, koonti lukittu",
"sent_to_talpa": "Koonti käsitelty ja arkistoitu",
"completed": "Koonti käsitelty ja arkistoitu",
"draft": "Koonti palautettu takaisin odottamaan päätösvalmistelua",
"accepted": "Tarkastustiedot tallennettu",
"rejected": "Koonti arkistoitu"
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8c58eb0

Please sign in to comment.