Skip to content

Commit 4934463

Browse files
committed
feat(dref-final):Add new field total operational timeframe
1 parent cb84ec9 commit 4934463

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 4.2.19 on 2025-07-22 10:05
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("dref", "0082_dreffinalreport_indirect_cost_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name="dreffinalreport",
15+
name="total_operation_timeframe_imminent",
16+
field=models.IntegerField(blank=True, null=True, verbose_name="total operation timeframe for imminent type"),
17+
),
18+
]

dref/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1315,6 +1315,10 @@ class DrefFinalReport(models.Model):
13151315
total_dref_allocation = models.IntegerField(verbose_name=_("Total dref allocation"), null=True, blank=True)
13161316
date_of_publication = models.DateField(verbose_name=_("Date of publication"), blank=True, null=True)
13171317
total_operation_timeframe = models.IntegerField(verbose_name=_("Total Operation Timeframe"), null=True, blank=True)
1318+
# NOTE: Total operation Timeframe for Imminent Type: Days
1319+
total_operation_timeframe_imminent = models.IntegerField(
1320+
verbose_name=_("total operation timeframe for imminent type"), null=True, blank=True
1321+
)
13181322
operation_start_date = models.DateField(verbose_name=_("Operation Start Date"), null=True, blank=True)
13191323
appeal_code = models.CharField(verbose_name=_("appeal code"), max_length=255, null=True, blank=True)
13201324
glide_code = models.CharField(verbose_name=_("glide number"), max_length=255, null=True, blank=True)

dref/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,7 @@ def create(self, validated_data):
13951395
validated_data["total_dref_allocation"] = dref.total_cost
13961396
# NOTE:These field should be blank for final report
13971397
validated_data["total_operation_timeframe"] = None
1398-
validated_data["operation_end_date"] = None
1398+
validated_data["total_operation_timeframe_imminent"] = dref.operation_timeframe_imminent
13991399
validated_data["glide_code"] = dref.glide_code
14001400
validated_data["ifrc_appeal_manager_name"] = dref.ifrc_appeal_manager_name
14011401
validated_data["ifrc_appeal_manager_email"] = dref.ifrc_appeal_manager_email

0 commit comments

Comments
 (0)