Skip to content

Commit 5b7ee80

Browse files
committed
Merge pull request #2605 from IFRCGo/feature/add-new-field-full-eap
EAP: Add new fields on EAPs Model
2 parents 5b69d2b + 1a24178 commit 5b7ee80

7 files changed

Lines changed: 971 additions & 163 deletions

File tree

eap/admin.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class FullEAPAdmin(admin.ModelAdmin):
141141
"activation_process_relevant_files",
142142
"meal_relevant_files",
143143
"capacity_relevant_files",
144+
"forecast_table_file",
144145
)
145146

146147
def get_queryset(self, request):

eap/factories.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
from datetime import datetime
2+
13
import factory
4+
import pytz
25
from factory import fuzzy
36

47
from eap.models import (
@@ -105,7 +108,6 @@ class Meta:
105108
approach = fuzzy.FuzzyChoice(EnableApproach.Approach)
106109
budget_per_approach = fuzzy.FuzzyInteger(1000, 1000000)
107110
ap_code = fuzzy.FuzzyInteger(100, 999)
108-
indicator_target = fuzzy.FuzzyInteger(10, 1000)
109111

110112
@factory.post_generation
111113
def readiness_activities(self, create, extracted, **kwargs):
@@ -184,6 +186,8 @@ class Meta:
184186
model = FullEAP
185187

186188
seap_timeframe = fuzzy.FuzzyInteger(5)
189+
expected_submission_time = fuzzy.FuzzyDateTime(datetime(2025, 1, 1, tzinfo=pytz.utc))
190+
lead_time = fuzzy.FuzzyInteger(1, 100)
187191
total_budget = fuzzy.FuzzyInteger(1000, 1000000)
188192
readiness_budget = fuzzy.FuzzyInteger(1000, 1000000)
189193
pre_positioning_budget = fuzzy.FuzzyInteger(1000, 1000000)
Lines changed: 298 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,298 @@
1+
# Generated by Django 4.2.26 on 2025-12-10 08:52
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
import django.utils.timezone
6+
7+
8+
class Migration(migrations.Migration):
9+
dependencies = [
10+
("eap", "0009_sourceinformation_and_more"),
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name="EAPAction",
16+
fields=[
17+
(
18+
"id",
19+
models.AutoField(
20+
auto_created=True,
21+
primary_key=True,
22+
serialize=False,
23+
verbose_name="ID",
24+
),
25+
),
26+
(
27+
"action",
28+
models.CharField(max_length=255, verbose_name="Early Action"),
29+
),
30+
],
31+
options={
32+
"verbose_name": "Early Action",
33+
"verbose_name_plural": "Early Actions",
34+
},
35+
),
36+
migrations.CreateModel(
37+
name="EAPImpact",
38+
fields=[
39+
(
40+
"id",
41+
models.AutoField(
42+
auto_created=True,
43+
primary_key=True,
44+
serialize=False,
45+
verbose_name="ID",
46+
),
47+
),
48+
("impact", models.CharField(max_length=255, verbose_name="Impact")),
49+
],
50+
options={
51+
"verbose_name": " Impact",
52+
"verbose_name_plural": "Expected Impacts",
53+
},
54+
),
55+
migrations.CreateModel(
56+
name="Indicator",
57+
fields=[
58+
(
59+
"id",
60+
models.AutoField(
61+
auto_created=True,
62+
primary_key=True,
63+
serialize=False,
64+
verbose_name="ID",
65+
),
66+
),
67+
(
68+
"title",
69+
models.CharField(max_length=255, verbose_name="Indicator Title"),
70+
),
71+
("target", models.IntegerField(verbose_name="Indicator Target")),
72+
],
73+
options={
74+
"verbose_name": "Indicator",
75+
"verbose_name_plural": "Indicators",
76+
},
77+
),
78+
migrations.RemoveField(
79+
model_name="eapregistration",
80+
name="pfa_signed_at",
81+
),
82+
migrations.RemoveField(
83+
model_name="enableapproach",
84+
name="indicator_target",
85+
),
86+
migrations.AddField(
87+
model_name="eapregistration",
88+
name="latest_full_eap",
89+
field=models.ForeignKey(
90+
blank=True,
91+
null=True,
92+
on_delete=django.db.models.deletion.SET_NULL,
93+
related_name="+",
94+
to="eap.fulleap",
95+
verbose_name="Latest Full EAP",
96+
),
97+
),
98+
migrations.AddField(
99+
model_name="eapregistration",
100+
name="latest_simplified_eap",
101+
field=models.ForeignKey(
102+
blank=True,
103+
null=True,
104+
on_delete=django.db.models.deletion.SET_NULL,
105+
related_name="+",
106+
to="eap.simplifiedeap",
107+
verbose_name="Latest Simplified EAP",
108+
),
109+
),
110+
migrations.AddField(
111+
model_name="eapregistration",
112+
name="pending_pfa_at",
113+
field=models.DateTimeField(
114+
blank=True,
115+
help_text="Timestamp when the EAP was marked as pending PFA.",
116+
null=True,
117+
verbose_name="pending pfa at",
118+
),
119+
),
120+
migrations.AddField(
121+
model_name="fulleap",
122+
name="expected_submission_time",
123+
field=models.DateField(
124+
default=django.utils.timezone.now,
125+
help_text="Include the propose time of submission, accounting for the time it will take to deliver the application.",
126+
verbose_name="Expected submission time",
127+
),
128+
preserve_default=False,
129+
),
130+
migrations.AddField(
131+
model_name="fulleap",
132+
name="forecast_table_file",
133+
field=models.ForeignKey(
134+
blank=True,
135+
null=True,
136+
on_delete=django.db.models.deletion.SET_NULL,
137+
related_name="forecast_table_file",
138+
to="eap.eapfile",
139+
verbose_name="Forecast Table File",
140+
),
141+
),
142+
migrations.AddField(
143+
model_name="fulleap",
144+
name="lead_time",
145+
field=models.IntegerField(default=1, verbose_name="Lead Time"),
146+
preserve_default=False,
147+
),
148+
migrations.AddField(
149+
model_name="fulleap",
150+
name="objective",
151+
field=models.TextField(
152+
default="default",
153+
help_text="Provide an objective statement that describe the main goal of intervention.",
154+
verbose_name="Overall Objective of the EAP.",
155+
),
156+
preserve_default=False,
157+
),
158+
migrations.AlterField(
159+
model_name="eapregistration",
160+
name="status",
161+
field=models.IntegerField(
162+
choices=[
163+
(10, "Under Development"),
164+
(20, "Under Review"),
165+
(30, "NS Addressing Comments"),
166+
(40, "Technically Validated"),
167+
(50, "Pending PFA"),
168+
(60, "Approved"),
169+
(70, "Activated"),
170+
],
171+
default=10,
172+
help_text="Select the current status of the EAP development process.",
173+
verbose_name="EAP Status",
174+
),
175+
),
176+
migrations.AlterField(
177+
model_name="fulleap",
178+
name="trigger_statement_source_of_information",
179+
field=models.ManyToManyField(
180+
blank=True,
181+
related_name="trigger_statement_source_of_information",
182+
to="eap.sourceinformation",
183+
verbose_name="Trigger Statement Source of Forecast",
184+
),
185+
),
186+
migrations.AlterField(
187+
model_name="simplifiedeap",
188+
name="assisted_through_operation",
189+
field=models.TextField(verbose_name="Assisted through the operation"),
190+
),
191+
migrations.AlterField(
192+
model_name="simplifiedeap",
193+
name="early_action_capability",
194+
field=models.TextField(
195+
help_text="Assumptions or minimum conditions needed to deliver the early actions.",
196+
verbose_name="Experience or Capacity to implement Early Action.",
197+
),
198+
),
199+
migrations.AlterField(
200+
model_name="simplifiedeap",
201+
name="overall_objective_intervention",
202+
field=models.TextField(
203+
help_text="Provide an objective statement that describe the main of the intervention.",
204+
verbose_name="Overall objective of the intervention",
205+
),
206+
),
207+
migrations.AlterField(
208+
model_name="simplifiedeap",
209+
name="potential_geographical_high_risk_areas",
210+
field=models.TextField(
211+
verbose_name="Potential geographical high-risk areas"
212+
),
213+
),
214+
migrations.AlterField(
215+
model_name="simplifiedeap",
216+
name="prioritized_hazard_and_impact",
217+
field=models.TextField(
218+
verbose_name="Prioritized Hazard and its historical impact."
219+
),
220+
),
221+
migrations.AlterField(
222+
model_name="simplifiedeap",
223+
name="rcrc_movement_involvement",
224+
field=models.TextField(
225+
help_text="RCRC Movement partners, Governmental/other agencies consulted/involved.",
226+
verbose_name="RCRC Movement Involvement.",
227+
),
228+
),
229+
migrations.AlterField(
230+
model_name="simplifiedeap",
231+
name="risks_selected_protocols",
232+
field=models.TextField(verbose_name="Risk selected for the protocols."),
233+
),
234+
migrations.AlterField(
235+
model_name="simplifiedeap",
236+
name="selected_early_actions",
237+
field=models.TextField(verbose_name="Selected Early Actions"),
238+
),
239+
migrations.AlterField(
240+
model_name="simplifiedeap",
241+
name="trigger_threshold_justification",
242+
field=models.TextField(
243+
help_text="Explain how the trigger were set and provide information",
244+
verbose_name="Trigger Threshold Justification",
245+
),
246+
),
247+
migrations.AddConstraint(
248+
model_name="fulleap",
249+
constraint=models.UniqueConstraint(
250+
fields=("eap_registration", "version"), name="unique_full_eap_version"
251+
),
252+
),
253+
migrations.AddConstraint(
254+
model_name="simplifiedeap",
255+
constraint=models.UniqueConstraint(
256+
fields=("eap_registration", "version"),
257+
name="unique_simplified_eap_version",
258+
),
259+
),
260+
migrations.AddField(
261+
model_name="enableapproach",
262+
name="indicators",
263+
field=models.ManyToManyField(
264+
blank=True,
265+
related_name="enable_approach_indicators",
266+
to="eap.indicator",
267+
verbose_name="Enable Approach Indicators",
268+
),
269+
),
270+
migrations.AddField(
271+
model_name="fulleap",
272+
name="early_actions",
273+
field=models.ManyToManyField(
274+
related_name="full_eap_early_actions",
275+
to="eap.eapaction",
276+
verbose_name="Early Actions",
277+
),
278+
),
279+
migrations.AddField(
280+
model_name="fulleap",
281+
name="prioritized_impacts",
282+
field=models.ManyToManyField(
283+
related_name="full_eap_prioritized_impacts",
284+
to="eap.eapimpact",
285+
verbose_name="Prioritized impacts",
286+
),
287+
),
288+
migrations.AddField(
289+
model_name="plannedoperation",
290+
name="indicators",
291+
field=models.ManyToManyField(
292+
blank=True,
293+
related_name="planned_operation_indicators",
294+
to="eap.indicator",
295+
verbose_name="Operation Indicators",
296+
),
297+
),
298+
]

0 commit comments

Comments
 (0)