Skip to content

Commit df98dea

Browse files
committed
fix(spp_demo,spp_mis_demo_v2): convert farmer stories to households, locale-aware names
- Convert maria_santos, juan_dela_cruz, ibrahim_hassan, ahmed_said from individual/farmer to household type with proper head/spouse/children members, fixing enrollment in group-targeting programs - Replace all non-Filipino default names with Filipino names so the default locale (fil_PH) is culturally consistent; si_LK and fr_TG locale overrides continue to work via LOCALE_NAMES - Remove all farm references (farm_size, farm_type, Input Subsidy, Livestock Improvement) from story definitions and MIS demo - Update USE_CASES.md to match actual programs and stories - Fix david_sofia_martinez enrollment key mismatch - Update event_types.xml: farm_condition_score -> household_condition_score
1 parent e7a23dd commit df98dea

9 files changed

Lines changed: 647 additions & 553 deletions

File tree

spp_demo/models/demo_stories.py

Lines changed: 235 additions & 191 deletions
Large diffs are not rendered by default.

spp_mis_demo_v2/data/demo_personas.xml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
<field name="name">Maria Santos</field>
2828
<field
2929
name="description"
30-
>SUCCESS STORY: 42-year-old rice farmer and mother of two from rural Laguna province. Started with 2.5 hectares and struggled with seasonal income. After 5 months in the Cash Transfer Program, she saved enough to buy better seeds and tools. Recently graduated from the program - demonstrating the pathway from poverty to self-sufficiency. Now mentors other farmers in her community.</field>
30+
>SUCCESS STORY: 42-year-old mother of two from rural Laguna province. Struggled with seasonal income and lived below the poverty line. After 5 months in the Cash Transfer Program, she saved enough to improve her household livelihood. Recently graduated from the program - demonstrating the pathway from poverty to self-sufficiency. Now mentors other beneficiaries in her community.</field>
3131
<field name="category">eligible</field>
3232
<field name="is_global" eval="True" />
3333
<field name="sequence">10</field>
3434
<field
3535
name="values"
36-
>{"name": "Maria Santos", "age": 42, "is_registrant": true, "is_group": false, "active": true, "farm_size_hectares": 2.5, "income": 8000, "occupation": "rice_farmer", "region": "rural"}</field>
36+
>{"name": "Maria Santos", "age": 42, "is_registrant": true, "is_group": false, "active": true, "income": 8000, "region": "rural"}</field>
3737
</record>
3838

3939
<!-- Rosa Garcia - Multi-Program Elderly Beneficiary -->
@@ -64,18 +64,18 @@
6464
>{"name": "Carlos Morales Household", "is_registrant": true, "is_group": true, "active": true, "hh_size": 5, "child_count": 3, "income": 4000, "head_occupation": "tricycle_driver", "spouse_occupation": "laundry_worker"}</field>
6565
</record>
6666

67-
<!-- Ibrahim Hassan - Emergency Relief Displaced Person -->
67+
<!-- Ramon Gutierrez - Emergency Relief Displaced Person -->
6868
<record id="persona_ibrahim_hassan" model="spp.studio.test.persona">
69-
<field name="name">Ibrahim Hassan</field>
69+
<field name="name">Ramon Gutierrez</field>
7070
<field
7171
name="description"
72-
>EMERGENCY RESPONSE: 50-year-old farmer displaced by recent flooding in his coastal village. Lost his home, crops, and livelihood. Currently staying in an evacuation center with vulnerability score of 85 (high). Receives Tier 2 emergency payments ($400) based on tiered vulnerability assessment - demonstrating crisis response targeting and ternary CEL expressions for benefit calculation.</field>
72+
>EMERGENCY RESPONSE: 50-year-old person displaced by recent flooding in his coastal village. Lost his home and livelihood. Currently staying in an evacuation center with vulnerability score of 85 (high). Receives Tier 2 emergency payments ($400) based on tiered vulnerability assessment - demonstrating crisis response targeting and ternary CEL expressions for benefit calculation.</field>
7373
<field name="category">eligible</field>
7474
<field name="is_global" eval="True" />
7575
<field name="sequence">40</field>
7676
<field
7777
name="values"
78-
>{"name": "Ibrahim Hassan", "age": 50, "is_registrant": true, "is_group": false, "active": true, "displacement_status": "displaced", "vulnerability_score": 85, "shelter_type": "evacuation_center", "previous_occupation": "farmer"}</field>
78+
>{"name": "Ramon Gutierrez", "age": 50, "is_registrant": true, "is_group": false, "active": true, "displacement_status": "displaced", "vulnerability_score": 85, "shelter_type": "evacuation_center"}</field>
7979
</record>
8080

8181
<!-- David &amp; Sofia Martinez Household - Disability Support -->
@@ -106,9 +106,9 @@
106106
>{"name": "Juan Dela Cruz", "age": 45, "is_registrant": true, "is_group": true, "active": true, "hh_size": 4, "income": 3500, "displacement_status": "displaced", "displacement_reason": "house_fire", "has_grm_ticket": true, "has_case": true}</field>
107107
</record>
108108

109-
<!-- Ahmed Said - Multiple Program Beneficiary with Active GRM -->
109+
<!-- Roberto Castillo - Multiple Program Beneficiary with Active GRM -->
110110
<record id="persona_ahmed_said" model="spp.studio.test.persona">
111-
<field name="name">Ahmed Said</field>
111+
<field name="name">Roberto Castillo</field>
112112
<field
113113
name="description"
114114
>MULTI-TICKET GRM: 38-year-old construction worker and father of 4 enrolled in Cash Transfer Program. Has filed multiple GRM tickets over time - payment delay (resolved), bank account update (resolved), and general inquiry about next payment. Demonstrates how the system tracks beneficiary interaction history and ticket patterns.</field>
@@ -117,12 +117,12 @@
117117
<field name="sequence">58</field>
118118
<field
119119
name="values"
120-
>{"name": "Ahmed Said", "age": 38, "is_registrant": true, "is_group": false, "active": true, "income": 5000, "occupation": "construction_worker", "child_count": 4, "grm_ticket_count": 3}</field>
120+
>{"name": "Roberto Castillo", "age": 38, "is_registrant": true, "is_group": false, "active": true, "income": 5000, "occupation": "construction_worker", "child_count": 4, "grm_ticket_count": 3}</field>
121121
</record>
122122

123-
<!-- Fatima Al-Rahman - Information Seeker -->
123+
<!-- Teresa Villanueva - Information Seeker -->
124124
<record id="persona_fatima_al_rahman" model="spp.studio.test.persona">
125-
<field name="name">Fatima Al-Rahman</field>
125+
<field name="name">Teresa Villanueva</field>
126126
<field
127127
name="description"
128128
>INFORMATION REQUEST: 32-year-old mother of 2 who filed a GRM ticket asking about program eligibility requirements. Her ticket was quickly resolved with information provided. Demonstrates the system's ability to handle inquiries efficiently. She is now being assessed for Universal Child Grant enrollment.</field>
@@ -131,16 +131,16 @@
131131
<field name="sequence">60</field>
132132
<field
133133
name="values"
134-
>{"name": "Fatima Al-Rahman", "age": 32, "is_registrant": true, "is_group": false, "active": true, "income": 4500, "child_count": 2, "marital_status": "married", "assessment_status": "pending"}</field>
134+
>{"name": "Teresa Villanueva", "age": 32, "is_registrant": true, "is_group": false, "active": true, "income": 4500, "child_count": 2, "marital_status": "married", "assessment_status": "pending"}</field>
135135
</record>
136136

137137
<!-- ═══════════════════════════════════════════════════════════════════════
138138
INELIGIBLE PERSONAS - Rejection Demonstrations
139139
═══════════════════════════════════════════════════════════════════════ -->
140140

141-
<!-- Mary Johnson - Age Rejection (Below Retirement Age) -->
141+
<!-- Lorna Pascual - Age Rejection (Below Retirement Age) -->
142142
<record id="persona_mary_johnson" model="spp.studio.test.persona">
143-
<field name="name">Mary Johnson</field>
143+
<field name="name">Lorna Pascual</field>
144144
<field
145145
name="description"
146146
>REJECTION CASE - AGE: 55-year-old woman who applied for Elderly Social Pension. Although she has no formal pension and low income, she was REJECTED because she doesn't meet the age requirement (retirement_age = 65). Her application demonstrates how the system properly enforces age-based eligibility rules. She should reapply in 10 years when she turns 65.</field>
@@ -149,7 +149,7 @@
149149
<field name="sequence">100</field>
150150
<field
151151
name="values"
152-
>{"name": "Mary Johnson", "age": 55, "is_registrant": true, "is_group": false, "active": true, "income": 3000, "has_formal_pension": false, "rejection_reason": "below_retirement_age"}</field>
152+
>{"name": "Lorna Pascual", "age": 55, "is_registrant": true, "is_group": false, "active": true, "income": 3000, "has_formal_pension": false, "rejection_reason": "below_retirement_age"}</field>
153153
</record>
154154

155155
<!-- Childless Household - No Child Benefit -->

spp_mis_demo_v2/data/event_types.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<field name="code">training</field>
4040
<field
4141
name="description"
42-
>Training sessions for beneficiaries including agricultural practices, financial literacy, and program orientation.</field>
42+
>Training sessions for beneficiaries including financial literacy, life skills, and program orientation.</field>
4343
<field name="category">visit</field>
4444
<field name="target_type">both</field>
4545
<field name="source_type">internal</field>
@@ -52,7 +52,7 @@
5252
<field name="code">extension_visit</field>
5353
<field
5454
name="description"
55-
>Field extension visits by agricultural officers to provide technical assistance and monitor progress.</field>
55+
>Field extension visits by social welfare officers to provide technical assistance and monitor progress.</field>
5656
<field name="category">visit</field>
5757
<field name="target_type">both</field>
5858
<field name="source_type">internal</field>
@@ -222,18 +222,18 @@
222222
-->
223223

224224
<!-- CEL Expression: Calculate visit quality score
225-
Based on: completeness of data, farm conditions, recommendations made -->
225+
Based on: completeness of data, household conditions, recommendations made -->
226226
<record id="mapping_extension_quality" model="spp.event.type.mapping">
227227
<field name="event_type_id" ref="event_type_extension_visit" />
228228
<field name="sequence">10</field>
229229
<field
230230
name="external_field"
231-
>data_completeness,farm_condition_score,recommendations_count</field>
231+
>data_completeness,household_condition_score,recommendations_count</field>
232232
<field name="internal_field">visit_quality_score</field>
233233
<field name="transform">expression</field>
234234
<field
235235
name="transform_expression"
236-
>(int(data_completeness) * 0.4) + (int(farm_condition_score) * 0.4) + (int(recommendations_count) * 2.0)</field>
236+
>(int(data_completeness) * 0.4) + (int(household_condition_score) * 0.4) + (int(recommendations_count) * 2.0)</field>
237237
</record>
238238

239239
<!-- CEL Expression: Determine if follow-up visit needed
@@ -243,12 +243,12 @@
243243
<field name="sequence">20</field>
244244
<field
245245
name="external_field"
246-
>farm_condition_score,issues_identified,recommendations_count</field>
246+
>household_condition_score,issues_identified,recommendations_count</field>
247247
<field name="internal_field">needs_followup</field>
248248
<field name="transform">expression</field>
249249
<field
250250
name="transform_expression"
251-
>int(farm_condition_score) &lt; 50 || int(issues_identified) > 3 || int(recommendations_count) > 5</field>
251+
>int(household_condition_score) &lt; 50 || int(issues_identified) > 3 || int(recommendations_count) > 5</field>
252252
</record>
253253

254254
<!--

0 commit comments

Comments
 (0)