Skip to content

Commit f171c69

Browse files
committed
Migrate BASECAMP ERUTypes to OSH
1 parent 8489043 commit f171c69

File tree

3 files changed

+39
-24
lines changed

3 files changed

+39
-24
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 4.2.19 on 2025-11-14 13:39
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('deployments', '0091_erureadinesstype_alter_erureadiness_options_and_more'),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name='eru',
15+
name='type',
16+
field=models.IntegerField(choices=[(1, 'IT & Telecom'), (2, 'Logistics'), (3, 'RCRC Emergency Hospital'), (4, 'RCRC Emergency Clinic'), (5, 'Relief'), (6, 'WASH M15'), (7, 'WASH MSM20'), (8, 'WASH M40'), (9, 'Water Supply and rehabilitation'), (10, 'Household Water Treatment and safe storage'), (11, 'Cholera Case management at Community level'), (12, 'Safe and Dignified Burials'), (13, 'Community Based Surveillance'), (17, 'Outpatient Department (OPD) Module'), (18, 'MHPSS'), (19, 'Operations Support HUB')], default=0, help_text='<a target="_blank" href="/api/v2/erutype">Key/value pairs</a>', verbose_name='type'),
17+
),
18+
migrations.AlterField(
19+
model_name='erureadinesstype',
20+
name='type',
21+
field=models.IntegerField(choices=[(1, 'IT & Telecom'), (2, 'Logistics'), (3, 'RCRC Emergency Hospital'), (4, 'RCRC Emergency Clinic'), (5, 'Relief'), (6, 'WASH M15'), (7, 'WASH MSM20'), (8, 'WASH M40'), (9, 'Water Supply and rehabilitation'), (10, 'Household Water Treatment and safe storage'), (11, 'Cholera Case management at Community level'), (12, 'Safe and Dignified Burials'), (13, 'Community Based Surveillance'), (17, 'Outpatient Department (OPD) Module'), (18, 'MHPSS'), (19, 'Operations Support HUB')], verbose_name='ERU type'),
22+
),
23+
]

deployments/models.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727

2828
class ERUType(models.IntegerChoices):
29-
BASECAMP = 0, _("Basecamp")
29+
# BASECAMP = 0, _("Basecamp") # Deprecated, use OSH instead
3030
TELECOM = 1, _("IT & Telecom")
3131
LOGISTICS = 2, _("Logistics")
3232
EMERGENCY_HOSPITAL = 3, _("RCRC Emergency Hospital")
@@ -40,11 +40,12 @@ class ERUType(models.IntegerChoices):
4040
COLERA_MANAGEMENT = 11, _("Cholera Case management at Community level")
4141
BURIALS = 12, _("Safe and Dignified Burials")
4242
CBS = 13, _("Community Based Surveillance")
43-
BASECAMP_S = 14, _("Base Camp – S")
44-
BASECAMP_M = 15, _("Base Camp – M")
45-
BASECAMP_L = 16, _("Base Camp – L")
43+
# BASECAMP_S = 14, _("Base Camp – S") # Deprecated, use OSH instead
44+
# BASECAMP_M = 15, _("Base Camp – M") # Deprecated, use OSH instead
45+
# BASECAMP_L = 16, _("Base Camp – L") # Deprecated, use OSH instead
4646
OPD = 17, _("Outpatient Department (OPD) Module")
4747
MHPSS = 18, _("MHPSS")
48+
OSH = 19, _("Operations Support HUB")
4849

4950

5051
@reversion.register()

deployments/tests.py

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def test_eru_readiness_list(self):
494494
}
495495
eru_readiness_type_1, eru_readiness_type_2 = ERUReadinessTypeFactory.create_batch(
496496
2,
497-
type=ERUType.BASECAMP_L,
497+
type=ERUType.OSH,
498498
**eru_readiness_type_common,
499499
)
500500
eru_owner_1 = ERUOwnerFactory.create(
@@ -533,11 +533,11 @@ def test_eru_readiness_create(self):
533533
"funding_readiness": ERUReadinessType.ReadinessStatus.READY,
534534
}
535535
eru_readiness_type_1 = ERUReadinessTypeFactory.create(
536-
type=ERUType.BASECAMP_L,
536+
type=ERUType.OSH,
537537
**eru_readiness_type_common,
538538
)
539539
eru_readiness_type_2 = ERUReadinessTypeFactory.create(
540-
type=ERUType.BASECAMP_M,
540+
type=ERUType.CBS,
541541
**eru_readiness_type_common,
542542
)
543543

@@ -573,11 +573,11 @@ def test_eru_readiness_update(self):
573573
"funding_readiness": ERUReadinessType.ReadinessStatus.READY,
574574
}
575575
eru_readiness_type_1 = ERUReadinessTypeFactory.create(
576-
type=ERUType.BASECAMP_L,
576+
type=ERUType.OSH,
577577
**eru_readiness_type_common,
578578
)
579579
eru_readiness_type_2 = ERUReadinessTypeFactory.create(
580-
type=ERUType.BASECAMP_M,
580+
type=ERUType.CBS,
581581
**eru_readiness_type_common,
582582
)
583583
eru_owner = ERUOwnerFactory.create(
@@ -608,7 +608,7 @@ def test_eru_readiness_update(self):
608608
},
609609
# Add new ERU type
610610
{
611-
"type": ERUType.BASECAMP,
611+
"type": ERUType.MHPSS,
612612
"equipment_readiness": ERUReadinessType.ReadinessStatus.PARTIAL_CAPACITY,
613613
"people_readiness": ERUReadinessType.ReadinessStatus.PARTIAL_CAPACITY,
614614
"funding_readiness": ERUReadinessType.ReadinessStatus.PARTIAL_CAPACITY,
@@ -755,7 +755,7 @@ def setUp(self):
755755
"funding_readiness": ERUReadinessType.ReadinessStatus.READY,
756756
}
757757
eru_readiness_type_1 = ERUReadinessTypeFactory.create(
758-
type=ERUType.BASECAMP,
758+
type=ERUType.MHPSS,
759759
**eru_readiness_type_common1,
760760
comment="Test comment1",
761761
)
@@ -765,7 +765,7 @@ def setUp(self):
765765
comment="Test comment2",
766766
)
767767
eru_readiness_type_3 = ERUReadinessTypeFactory.create(
768-
type=ERUType.BASECAMP,
768+
type=ERUType.MHPSS,
769769
**eru_readiness_type_common2,
770770
comment="Test comment3",
771771
)
@@ -788,8 +788,8 @@ def test_export_response(self):
788788

789789
self.assertEqual(ws["A1"].value, "National Society")
790790
self.assertEqual(ws["B1"].value, "Updated Date")
791-
self.assertEqual(ws["C1"].value, "Basecamp")
792-
self.assertEqual(ws["G1"].value, "IT & Telecom")
791+
self.assertEqual(ws["C1"].value, "IT & Telecom")
792+
self.assertEqual(ws["G1"].value, "Logistics")
793793

794794
# Check sub-headers
795795
self.assertEqual(ws["C2"].value, "Equipment")
@@ -802,16 +802,7 @@ def test_export_response(self):
802802
self.assertEqual(row1[2].value, "Ready")
803803
self.assertEqual(row1[3].value, "No capacity")
804804
self.assertEqual(row1[4].value, "Ready")
805-
self.assertEqual(row1[5].value, "Test comment1")
806-
807-
self.assertEqual(row1[6].value, "Ready")
808-
self.assertEqual(row1[7].value, "No capacity")
809-
self.assertEqual(row1[8].value, "Ready")
810-
self.assertEqual(row1[9].value, "Test comment2")
805+
self.assertEqual(row1[5].value, "Test comment2")
811806

812807
row2 = list(ws.iter_rows(min_row=4))[0]
813808
self.assertEqual(row2[0].value, "India")
814-
self.assertEqual(row2[2].value, "No capacity")
815-
self.assertEqual(row2[3].value, "Ready")
816-
self.assertEqual(row2[4].value, "Ready")
817-
self.assertEqual(row2[5].value, "Test comment3")

0 commit comments

Comments
 (0)