Skip to content

Commit 70fc379

Browse files
committed
docs(spp_farmer_registry_demo,spp_mis_demo_v2): sync descriptions with code
- Create DESCRIPTION.md for spp_farmer_registry_demo (was missing) - Fix spp_mis_demo_v2: 6 programs -> 7, document seeded generation, add Conditional Child Grant, multi-locale, geographic data loading
1 parent 45d9e69 commit 70fc379

2 files changed

Lines changed: 79 additions & 12 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Demo data generator for the OpenSPP Farmer Registry. Creates 8 named farmer personas with complete Philippine farm profiles, 5 agricultural subsidy programs with CEL eligibility expressions, and optionally generates ~730 volume farms from deterministic blueprints using a seeded random generator (`seed=42`) for reproducible output.
2+
3+
### Key Capabilities
4+
5+
- **8 Fixed Story Farms** with hardcoded profiles (Maria Santos, Juan Dela Cruz, Rosa Garcia, Amir Mangudadatu, Sofia Martinez, Ramon dela Cruz, Sittie Pangandaman, Danilo Villanueva)
6+
- **~730 Volume Farms** generated deterministically from 21 blueprints via `SeededFarmGenerator` with `random.Random(seed=42)` — same seed always produces identical farms, members, and activities
7+
- **5 Demo Programs** with CEL-based eligibility and benefit formulas (Input Subsidy, Equipment Grant, Livestock Support, Climate Resilience, Aquaculture Support)
8+
- **2 Farm Cooperatives** demonstrating group-of-groups hierarchy (Nueva Ecija Rice Cooperative, BARMM Farmers Federation)
9+
- **3 Edge Case Personas** for testing eligibility boundaries (AgriCorp Holdings, Idle Land Farm, New Farmer)
10+
- Install Logic Packs from `spp_studio` for eligibility rules
11+
- Create program cycles with entitlements and payments
12+
- Create change requests at various workflow stages
13+
- Geographic distribution across 8 Philippine provinces with GPS coordinates and land parcel polygons
14+
15+
### Key Models
16+
17+
| Model | Description |
18+
| ------------------------------ | --------------------------------------------------- |
19+
| `spp.farmer.demo.generator` | Core demo generator wizard with all generation logic |
20+
21+
### Configuration
22+
23+
After installing:
24+
25+
1. Navigate to **Settings > Demo Data > Load Farmer Demo**
26+
2. Click "Load Demo Data" to generate
27+
28+
### Demo Programs
29+
30+
All programs use CEL expressions with activated registry variables:
31+
32+
- **Input Subsidy Program**: Per-hectare scaling for smallholders with productive land
33+
- **Equipment Grant Program**: Experience-based grant for farmers with 2+ years
34+
- **Livestock Support Program**: Per-head scaling for livestock owners
35+
- **Climate Resilience Program**: Targets farms with idle land
36+
- **Aquaculture Support Program**: Activity-specific support for aquaculture farmers
37+
38+
### Seeded Volume Generation
39+
40+
The `SeededFarmGenerator` uses `random.Random(seed=42)` for all structural choices:
41+
42+
- Farm names from Filipino last name pools
43+
- Member names (given + family) from locale-specific pools
44+
- Farm sizes, experience years, GPS coordinates
45+
- Activity quantities (crop areas, livestock counts, aquaculture)
46+
47+
Running the generator twice with the same seed produces identical output.
48+
49+
### Security
50+
51+
| Group | Access |
52+
| ------------------------------ | --------- |
53+
| `spp_security.group_spp_admin` | Full CRUD |
54+
55+
### Dependencies
56+
57+
`spp_starter_farmer_registry`, `spp_demo`, `spp_farmer_registry_cr`, `spp_studio`, `spp_registry_group_hierarchy`, `spp_area`, `spp_programs`

spp_mis_demo_v2/readme/DESCRIPTION.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
Demo data generator for SP-MIS programs. Creates 6 social protection programs with CEL eligibility expressions, enrolls 8 demo personas with payment histories, and optionally generates volume data for testing. Activates registry variables from `spp_studio` and installs Logic Packs for eligibility rules.
1+
Demo data generator for SP-MIS programs. Creates 7 social protection programs with CEL eligibility expressions, enrolls 8 demo personas with payment histories, and optionally generates ~730 deterministic households from seeded blueprints (`seed=42`) for reproducible volume data. Activates registry variables from `spp_studio` and installs Logic Packs for eligibility rules.
22

33
### Key Capabilities
44

5-
- Generate 6 programs (Child Grant, Elderly Pension, Emergency Relief, Cash Transfer, Disability Support, Food Assistance) with CEL expressions
5+
- Generate 7 programs (Universal Child Grant, Conditional Child Grant, Elderly Pension, Emergency Relief, Cash Transfer, Disability Support, Food Assistance) with CEL expressions
66
- Enroll 8 demo personas with predefined stories and payment histories covering all demo scenarios
7+
- Generate ~730 deterministic households with ~2555 members from 28 blueprints via `SeededVolumeGenerator` with `random.Random(seed=42)` — same seed always produces identical output
78
- Install Logic Packs from `spp_studio` for eligibility rules (child_benefit, social_pension, vulnerability_assessment, cash_transfer_basic, disability_assistance)
89
- Activate registry variables (age, child_count, hh_total_income, dependency_ratio, etc.) via post_init_hook
9-
- Generate volume data with configurable random enrollments for dashboard testing
10+
- 4 demo modes (Sales, Training, Testing, Complete) with automatic field defaults
11+
- Multi-locale support for name generation (fil_PH, si_LK, fr_TG)
12+
- Geographic data loading for Philippines, Sri Lanka, and Togo
1013
- Create change requests at various workflow stages (draft, pending, approved, rejected)
11-
- Cross-module integration: automatically creates GRM tickets and case records when those modules are installed
14+
- Cross-module integration: automatically creates GRM tickets, case records, and Claim 169 QR credentials when those modules are installed
15+
- Fairness analysis demo data and PRISM API client creation
1216

1317
### Key Models
1418

@@ -25,30 +29,36 @@ After installing:
2529
2. The wizard opens with options for demo mode (Sales, Training, Testing, Complete)
2630
3. Click "Load Demo Data" to generate
2731

28-
For automatic generation on install:
29-
30-
```bash
31-
ODOO_INIT_MODULES=spp_mis_demo_v2 docker compose --profile ui up -d
32-
```
33-
3432
For programmatic generation:
3533

3634
```python
37-
generator = env['spp.mis.demo.wizard'].create({'name': 'Demo'})
38-
generator.action_generate_demo_data()
35+
wizard = env['spp.mis.demo.wizard'].create({})
36+
wizard.action_generate_demo_data()
3937
```
4038

4139
### Demo Programs
4240

4341
All programs use CEL expressions with activated registry variables:
4442

4543
- **Universal Child Grant**: `r.is_group == true and child_count > 0` (member aggregation)
44+
- **Conditional Child Grant**: First 1,000 days targeting for young children
4645
- **Elderly Social Pension**: `r.is_group == false and age >= retirement_age` (age computation)
4746
- **Emergency Relief Fund**: `dependency_ratio >= 1.5 or (is_female_headed and elderly_count > 0)` (compound conditions)
4847
- **Cash Transfer Program**: `hh_total_income < poverty_line and hh_size >= 2` (income-based targeting)
4948
- **Disability Support Grant**: `r.is_group == true and has_disabled_member` (member existence check)
5049
- **Food Assistance**: `r.is_registrant == true and r.active == true` (simple field comparison)
5150

51+
### Seeded Volume Generation
52+
53+
The `SeededVolumeGenerator` uses `random.Random(seed=42)` for all structural choices:
54+
55+
- Ages, incomes, genders, and names from locale-specific pools
56+
- Birthdates, registration dates, GPS coordinates
57+
- Household structure from 28 deterministic blueprints across 5 categories (young families, middle-age, elderly, working-age, extended/vulnerable)
58+
- Membership realism applied post-generation (83% enrolled, 10% exited, 5% paused, 2% not eligible)
59+
60+
Running the generator twice with the same seed produces identical output.
61+
5262
### UI Location
5363

5464
- **Menu**: Settings > Demo Data > Load MIS Demo

0 commit comments

Comments
 (0)