From 70fc37917077ba535077322d13233ffe1e92da4f Mon Sep 17 00:00:00 2001 From: emjay0921 Date: Mon, 23 Mar 2026 12:56:46 +0800 Subject: [PATCH 1/5] 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 --- .../readme/DESCRIPTION.md | 57 +++++++++++++++++++ spp_mis_demo_v2/readme/DESCRIPTION.md | 34 +++++++---- 2 files changed, 79 insertions(+), 12 deletions(-) create mode 100644 spp_farmer_registry_demo/readme/DESCRIPTION.md diff --git a/spp_farmer_registry_demo/readme/DESCRIPTION.md b/spp_farmer_registry_demo/readme/DESCRIPTION.md new file mode 100644 index 00000000..60acf17b --- /dev/null +++ b/spp_farmer_registry_demo/readme/DESCRIPTION.md @@ -0,0 +1,57 @@ +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. + +### Key Capabilities + +- **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) +- **~730 Volume Farms** generated deterministically from 21 blueprints via `SeededFarmGenerator` with `random.Random(seed=42)` — same seed always produces identical farms, members, and activities +- **5 Demo Programs** with CEL-based eligibility and benefit formulas (Input Subsidy, Equipment Grant, Livestock Support, Climate Resilience, Aquaculture Support) +- **2 Farm Cooperatives** demonstrating group-of-groups hierarchy (Nueva Ecija Rice Cooperative, BARMM Farmers Federation) +- **3 Edge Case Personas** for testing eligibility boundaries (AgriCorp Holdings, Idle Land Farm, New Farmer) +- Install Logic Packs from `spp_studio` for eligibility rules +- Create program cycles with entitlements and payments +- Create change requests at various workflow stages +- Geographic distribution across 8 Philippine provinces with GPS coordinates and land parcel polygons + +### Key Models + +| Model | Description | +| ------------------------------ | --------------------------------------------------- | +| `spp.farmer.demo.generator` | Core demo generator wizard with all generation logic | + +### Configuration + +After installing: + +1. Navigate to **Settings > Demo Data > Load Farmer Demo** +2. Click "Load Demo Data" to generate + +### Demo Programs + +All programs use CEL expressions with activated registry variables: + +- **Input Subsidy Program**: Per-hectare scaling for smallholders with productive land +- **Equipment Grant Program**: Experience-based grant for farmers with 2+ years +- **Livestock Support Program**: Per-head scaling for livestock owners +- **Climate Resilience Program**: Targets farms with idle land +- **Aquaculture Support Program**: Activity-specific support for aquaculture farmers + +### Seeded Volume Generation + +The `SeededFarmGenerator` uses `random.Random(seed=42)` for all structural choices: + +- Farm names from Filipino last name pools +- Member names (given + family) from locale-specific pools +- Farm sizes, experience years, GPS coordinates +- Activity quantities (crop areas, livestock counts, aquaculture) + +Running the generator twice with the same seed produces identical output. + +### Security + +| Group | Access | +| ------------------------------ | --------- | +| `spp_security.group_spp_admin` | Full CRUD | + +### Dependencies + +`spp_starter_farmer_registry`, `spp_demo`, `spp_farmer_registry_cr`, `spp_studio`, `spp_registry_group_hierarchy`, `spp_area`, `spp_programs` diff --git a/spp_mis_demo_v2/readme/DESCRIPTION.md b/spp_mis_demo_v2/readme/DESCRIPTION.md index d09ab8aa..370e6863 100644 --- a/spp_mis_demo_v2/readme/DESCRIPTION.md +++ b/spp_mis_demo_v2/readme/DESCRIPTION.md @@ -1,14 +1,18 @@ -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. +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. ### Key Capabilities -- Generate 6 programs (Child Grant, Elderly Pension, Emergency Relief, Cash Transfer, Disability Support, Food Assistance) with CEL expressions +- Generate 7 programs (Universal Child Grant, Conditional Child Grant, Elderly Pension, Emergency Relief, Cash Transfer, Disability Support, Food Assistance) with CEL expressions - Enroll 8 demo personas with predefined stories and payment histories covering all demo scenarios +- Generate ~730 deterministic households with ~2555 members from 28 blueprints via `SeededVolumeGenerator` with `random.Random(seed=42)` — same seed always produces identical output - Install Logic Packs from `spp_studio` for eligibility rules (child_benefit, social_pension, vulnerability_assessment, cash_transfer_basic, disability_assistance) - Activate registry variables (age, child_count, hh_total_income, dependency_ratio, etc.) via post_init_hook -- Generate volume data with configurable random enrollments for dashboard testing +- 4 demo modes (Sales, Training, Testing, Complete) with automatic field defaults +- Multi-locale support for name generation (fil_PH, si_LK, fr_TG) +- Geographic data loading for Philippines, Sri Lanka, and Togo - Create change requests at various workflow stages (draft, pending, approved, rejected) -- Cross-module integration: automatically creates GRM tickets and case records when those modules are installed +- Cross-module integration: automatically creates GRM tickets, case records, and Claim 169 QR credentials when those modules are installed +- Fairness analysis demo data and PRISM API client creation ### Key Models @@ -25,17 +29,11 @@ After installing: 2. The wizard opens with options for demo mode (Sales, Training, Testing, Complete) 3. Click "Load Demo Data" to generate -For automatic generation on install: - -```bash -ODOO_INIT_MODULES=spp_mis_demo_v2 docker compose --profile ui up -d -``` - For programmatic generation: ```python -generator = env['spp.mis.demo.wizard'].create({'name': 'Demo'}) -generator.action_generate_demo_data() +wizard = env['spp.mis.demo.wizard'].create({}) +wizard.action_generate_demo_data() ``` ### Demo Programs @@ -43,12 +41,24 @@ generator.action_generate_demo_data() All programs use CEL expressions with activated registry variables: - **Universal Child Grant**: `r.is_group == true and child_count > 0` (member aggregation) +- **Conditional Child Grant**: First 1,000 days targeting for young children - **Elderly Social Pension**: `r.is_group == false and age >= retirement_age` (age computation) - **Emergency Relief Fund**: `dependency_ratio >= 1.5 or (is_female_headed and elderly_count > 0)` (compound conditions) - **Cash Transfer Program**: `hh_total_income < poverty_line and hh_size >= 2` (income-based targeting) - **Disability Support Grant**: `r.is_group == true and has_disabled_member` (member existence check) - **Food Assistance**: `r.is_registrant == true and r.active == true` (simple field comparison) +### Seeded Volume Generation + +The `SeededVolumeGenerator` uses `random.Random(seed=42)` for all structural choices: + +- Ages, incomes, genders, and names from locale-specific pools +- Birthdates, registration dates, GPS coordinates +- Household structure from 28 deterministic blueprints across 5 categories (young families, middle-age, elderly, working-age, extended/vulnerable) +- Membership realism applied post-generation (83% enrolled, 10% exited, 5% paused, 2% not eligible) + +Running the generator twice with the same seed produces identical output. + ### UI Location - **Menu**: Settings > Demo Data > Load MIS Demo From ae5a7540f7ff19b13aa289e8ef01ca81c2cd4668 Mon Sep 17 00:00:00 2001 From: emjay0921 Date: Mon, 23 Mar 2026 13:08:59 +0800 Subject: [PATCH 2/5] docs(spp_farmer_registry_demo,spp_mis_demo_v2): add generated READMEs Include auto-generated README.rst and index.html from oca-gen-addon-readme (Python 3.11) to match CI expectations. --- spp_farmer_registry_demo/README.rst | 161 ++++++ .../static/description/index.html | 524 ++++++++++++++++++ spp_mis_demo_v2/README.rst | 69 ++- spp_mis_demo_v2/static/description/index.html | 94 ++-- 4 files changed, 793 insertions(+), 55 deletions(-) create mode 100644 spp_farmer_registry_demo/README.rst create mode 100644 spp_farmer_registry_demo/static/description/index.html diff --git a/spp_farmer_registry_demo/README.rst b/spp_farmer_registry_demo/README.rst new file mode 100644 index 00000000..9fab12c3 --- /dev/null +++ b/spp_farmer_registry_demo/README.rst @@ -0,0 +1,161 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +============================ +OpenSPP Farmer Registry Demo +============================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:dfca553e48db1d9dfc3054a44bbbd863e95bc030a1dc4d389285d1b660f043c1 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OpenSPP%2FOpenSPP2-lightgray.png?logo=github + :target: https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_farmer_registry_demo + :alt: OpenSPP/OpenSPP2 + +|badge1| |badge2| |badge3| + +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. + +Key Capabilities +~~~~~~~~~~~~~~~~ + +- **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) +- **~730 Volume Farms** generated deterministically from 21 blueprints + via ``SeededFarmGenerator`` with ``random.Random(seed=42)`` — same + seed always produces identical farms, members, and activities +- **5 Demo Programs** with CEL-based eligibility and benefit formulas + (Input Subsidy, Equipment Grant, Livestock Support, Climate + Resilience, Aquaculture Support) +- **2 Farm Cooperatives** demonstrating group-of-groups hierarchy (Nueva + Ecija Rice Cooperative, BARMM Farmers Federation) +- **3 Edge Case Personas** for testing eligibility boundaries (AgriCorp + Holdings, Idle Land Farm, New Farmer) +- Install Logic Packs from ``spp_studio`` for eligibility rules +- Create program cycles with entitlements and payments +- Create change requests at various workflow stages +- Geographic distribution across 8 Philippine provinces with GPS + coordinates and land parcel polygons + +Key Models +~~~~~~~~~~ + ++-------------------------------+-------------------------------------+ +| Model | Description | ++===============================+=====================================+ +| ``spp.farmer.demo.generator`` | Core demo generator wizard with all | +| | generation logic | ++-------------------------------+-------------------------------------+ + +Configuration +~~~~~~~~~~~~~ + +After installing: + +1. Navigate to **Settings > Demo Data > Load Farmer Demo** +2. Click "Load Demo Data" to generate + +Demo Programs +~~~~~~~~~~~~~ + +All programs use CEL expressions with activated registry variables: + +- **Input Subsidy Program**: Per-hectare scaling for smallholders with + productive land +- **Equipment Grant Program**: Experience-based grant for farmers with + 2+ years +- **Livestock Support Program**: Per-head scaling for livestock owners +- **Climate Resilience Program**: Targets farms with idle land +- **Aquaculture Support Program**: Activity-specific support for + aquaculture farmers + +Seeded Volume Generation +~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``SeededFarmGenerator`` uses ``random.Random(seed=42)`` for all +structural choices: + +- Farm names from Filipino last name pools +- Member names (given + family) from locale-specific pools +- Farm sizes, experience years, GPS coordinates +- Activity quantities (crop areas, livestock counts, aquaculture) + +Running the generator twice with the same seed produces identical +output. + +Security +~~~~~~~~ + +================================ ========= +Group Access +================================ ========= +``spp_security.group_spp_admin`` Full CRUD +================================ ========= + +Dependencies +~~~~~~~~~~~~ + +``spp_starter_farmer_registry``, ``spp_demo``, +``spp_farmer_registry_cr``, ``spp_studio``, +``spp_registry_group_hierarchy``, ``spp_area``, ``spp_programs`` + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* OpenSPP.org + +Maintainers +----------- + +.. |maintainer-jeremi| image:: https://github.com/jeremi.png?size=40px + :target: https://github.com/jeremi + :alt: jeremi +.. |maintainer-gonzalesedwin1123| image:: https://github.com/gonzalesedwin1123.png?size=40px + :target: https://github.com/gonzalesedwin1123 + :alt: gonzalesedwin1123 +.. |maintainer-emjay0921| image:: https://github.com/emjay0921.png?size=40px + :target: https://github.com/emjay0921 + :alt: emjay0921 + +Current maintainers: + +|maintainer-jeremi| |maintainer-gonzalesedwin1123| |maintainer-emjay0921| + +This module is part of the `OpenSPP/OpenSPP2 `_ project on GitHub. + +You are welcome to contribute. diff --git a/spp_farmer_registry_demo/static/description/index.html b/spp_farmer_registry_demo/static/description/index.html new file mode 100644 index 00000000..b18de244 --- /dev/null +++ b/spp_farmer_registry_demo/static/description/index.html @@ -0,0 +1,524 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

OpenSPP Farmer Registry Demo

+ +

Production/Stable License: LGPL-3 OpenSPP/OpenSPP2

+

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.

+
+

Key Capabilities

+
    +
  • 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)
  • +
  • ~730 Volume Farms generated deterministically from 21 blueprints +via SeededFarmGenerator with random.Random(seed=42) — same +seed always produces identical farms, members, and activities
  • +
  • 5 Demo Programs with CEL-based eligibility and benefit formulas +(Input Subsidy, Equipment Grant, Livestock Support, Climate +Resilience, Aquaculture Support)
  • +
  • 2 Farm Cooperatives demonstrating group-of-groups hierarchy (Nueva +Ecija Rice Cooperative, BARMM Farmers Federation)
  • +
  • 3 Edge Case Personas for testing eligibility boundaries (AgriCorp +Holdings, Idle Land Farm, New Farmer)
  • +
  • Install Logic Packs from spp_studio for eligibility rules
  • +
  • Create program cycles with entitlements and payments
  • +
  • Create change requests at various workflow stages
  • +
  • Geographic distribution across 8 Philippine provinces with GPS +coordinates and land parcel polygons
  • +
+
+
+

Key Models

+ ++++ + + + + + + + + + + +
ModelDescription
spp.farmer.demo.generatorCore demo generator wizard with all +generation logic
+
+
+

Configuration

+

After installing:

+
    +
  1. Navigate to Settings > Demo Data > Load Farmer Demo
  2. +
  3. Click “Load Demo Data” to generate
  4. +
+
+
+

Demo Programs

+

All programs use CEL expressions with activated registry variables:

+
    +
  • Input Subsidy Program: Per-hectare scaling for smallholders with +productive land
  • +
  • Equipment Grant Program: Experience-based grant for farmers with +2+ years
  • +
  • Livestock Support Program: Per-head scaling for livestock owners
  • +
  • Climate Resilience Program: Targets farms with idle land
  • +
  • Aquaculture Support Program: Activity-specific support for +aquaculture farmers
  • +
+
+
+

Seeded Volume Generation

+

The SeededFarmGenerator uses random.Random(seed=42) for all +structural choices:

+
    +
  • Farm names from Filipino last name pools
  • +
  • Member names (given + family) from locale-specific pools
  • +
  • Farm sizes, experience years, GPS coordinates
  • +
  • Activity quantities (crop areas, livestock counts, aquaculture)
  • +
+

Running the generator twice with the same seed produces identical +output.

+
+
+

Security

+ ++++ + + + + + + + + + + +
GroupAccess
spp_security.group_spp_adminFull CRUD
+
+
+

Dependencies

+

spp_starter_farmer_registry, spp_demo, +spp_farmer_registry_cr, spp_studio, +spp_registry_group_hierarchy, spp_area, spp_programs

+

Table of contents

+ +
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • OpenSPP.org
  • +
+
+
+

Maintainers

+

Current maintainers:

+

jeremi gonzalesedwin1123 emjay0921

+

This module is part of the OpenSPP/OpenSPP2 project on GitHub.

+

You are welcome to contribute.

+
+
+
+
+
+ + diff --git a/spp_mis_demo_v2/README.rst b/spp_mis_demo_v2/README.rst index ca00c761..0c5170d2 100644 --- a/spp_mis_demo_v2/README.rst +++ b/spp_mis_demo_v2/README.rst @@ -1,13 +1,17 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + =================== OpenSPP MIS Demo V2 =================== -.. +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:a4d9ec16bde9c632db1b47053b880917cea1b1ae6bdd11a1203c2d22eae165b0 + !! source digest: sha256:fcd63f6ccdf525854e66ec8ffc304bd77b19da8056e6c5257bbfa4bc9c27c3ab !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png @@ -22,31 +26,39 @@ OpenSPP MIS Demo V2 |badge1| |badge2| |badge3| -Demo data generator for SP-MIS programs. Creates 6 social protection +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 volume data for testing. -Activates registry variables from ``spp_studio`` and installs Logic -Packs for eligibility rules. +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. Key Capabilities ~~~~~~~~~~~~~~~~ -- Generate 6 programs (Child Grant, Elderly Pension, Emergency Relief, - Cash Transfer, Disability Support, Food Assistance) with CEL - expressions +- Generate 7 programs (Universal Child Grant, Conditional Child Grant, + Elderly Pension, Emergency Relief, Cash Transfer, Disability Support, + Food Assistance) with CEL expressions - Enroll 8 demo personas with predefined stories and payment histories covering all demo scenarios +- Generate ~730 deterministic households with ~2555 members from 28 + blueprints via ``SeededVolumeGenerator`` with + ``random.Random(seed=42)`` — same seed always produces identical + output - Install Logic Packs from ``spp_studio`` for eligibility rules (child_benefit, social_pension, vulnerability_assessment, cash_transfer_basic, disability_assistance) - Activate registry variables (age, child_count, hh_total_income, dependency_ratio, etc.) via post_init_hook -- Generate volume data with configurable random enrollments for - dashboard testing +- 4 demo modes (Sales, Training, Testing, Complete) with automatic field + defaults +- Multi-locale support for name generation (fil_PH, si_LK, fr_TG) +- Geographic data loading for Philippines, Sri Lanka, and Togo - Create change requests at various workflow stages (draft, pending, approved, rejected) -- Cross-module integration: automatically creates GRM tickets and case - records when those modules are installed +- Cross-module integration: automatically creates GRM tickets, case + records, and Claim 169 QR credentials when those modules are installed +- Fairness analysis demo data and PRISM API client creation Key Models ~~~~~~~~~~ @@ -68,18 +80,12 @@ After installing: Testing, Complete) 3. Click "Load Demo Data" to generate -For automatic generation on install: - -.. code:: bash - - ODOO_INIT_MODULES=spp_mis_demo_v2 docker compose --profile ui up -d - For programmatic generation: .. code:: python - generator = env['spp.mis.demo.wizard'].create({'name': 'Demo'}) - generator.action_generate_demo_data() + wizard = env['spp.mis.demo.wizard'].create({}) + wizard.action_generate_demo_data() Demo Programs ~~~~~~~~~~~~~ @@ -88,6 +94,8 @@ All programs use CEL expressions with activated registry variables: - **Universal Child Grant**: ``r.is_group == true and child_count > 0`` (member aggregation) +- **Conditional Child Grant**: First 1,000 days targeting for young + children - **Elderly Social Pension**: ``r.is_group == false and age >= retirement_age`` (age computation) - **Emergency Relief Fund**: @@ -102,6 +110,23 @@ All programs use CEL expressions with activated registry variables: - **Food Assistance**: ``r.is_registrant == true and r.active == true`` (simple field comparison) +Seeded Volume Generation +~~~~~~~~~~~~~~~~~~~~~~~~ + +The ``SeededVolumeGenerator`` uses ``random.Random(seed=42)`` for all +structural choices: + +- Ages, incomes, genders, and names from locale-specific pools +- Birthdates, registration dates, GPS coordinates +- Household structure from 28 deterministic blueprints across 5 + categories (young families, middle-age, elderly, working-age, + extended/vulnerable) +- Membership realism applied post-generation (83% enrolled, 10% exited, + 5% paused, 2% not eligible) + +Running the generator twice with the same seed produces identical +output. + UI Location ~~~~~~~~~~~ @@ -171,4 +196,4 @@ Current maintainers: This module is part of the `OpenSPP/OpenSPP2 `_ project on GitHub. -You are welcome to contribute. \ No newline at end of file +You are welcome to contribute. diff --git a/spp_mis_demo_v2/static/description/index.html b/spp_mis_demo_v2/static/description/index.html index 45765f60..8162396f 100644 --- a/spp_mis_demo_v2/static/description/index.html +++ b/spp_mis_demo_v2/static/description/index.html @@ -3,7 +3,7 @@ -OpenSPP MIS Demo V2 +README.rst -
-

OpenSPP MIS Demo V2

+
+ + +Odoo Community Association + +
+

OpenSPP MIS Demo V2

Production/Stable License: LGPL-3 OpenSPP/OpenSPP2

-

Demo data generator for SP-MIS programs. Creates 6 social protection +

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 volume data for testing. -Activates registry variables from spp_studio and installs Logic -Packs for eligibility rules.

+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.

-

Key Capabilities

+

Key Capabilities

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

Key Models

+

Key Models

@@ -419,7 +432,7 @@

Key Models

-

Configuration

+

Configuration

After installing:

  1. Navigate to Settings > Demo Data > Load MIS Demo
  2. @@ -427,22 +440,20 @@

    Configuration

    Testing, Complete)
  3. Click “Load Demo Data” to generate
-

For automatic generation on install:

-
-ODOO_INIT_MODULES=spp_mis_demo_v2 docker compose --profile ui up -d
-

For programmatic generation:

-generator = env['spp.mis.demo.wizard'].create({'name': 'Demo'})
-generator.action_generate_demo_data()
+wizard = env['spp.mis.demo.wizard'].create({})
+wizard.action_generate_demo_data()
 
-

Demo Programs

+

Demo Programs

All programs use CEL expressions with activated registry variables:

  • Universal Child Grant: r.is_group == true and child_count > 0 (member aggregation)
  • +
  • Conditional Child Grant: First 1,000 days targeting for young +children
  • Elderly Social Pension: r.is_group == false and age >= retirement_age (age computation)
  • Emergency Relief Fund: @@ -458,8 +469,24 @@

    Demo Programs

    (simple field comparison)
+
+

Seeded Volume Generation

+

The SeededVolumeGenerator uses random.Random(seed=42) for all +structural choices:

+
    +
  • Ages, incomes, genders, and names from locale-specific pools
  • +
  • Birthdates, registration dates, GPS coordinates
  • +
  • Household structure from 28 deterministic blueprints across 5 +categories (young families, middle-age, elderly, working-age, +extended/vulnerable)
  • +
  • Membership realism applied post-generation (83% enrolled, 10% exited, +5% paused, 2% not eligible)
  • +
+

Running the generator twice with the same seed produces identical +output.

+
-

UI Location

+

UI Location

  • Menu: Settings > Demo Data > Load MIS Demo
  • Form: Wizard with generation options (demo mode, Logic Pack @@ -467,7 +494,7 @@

    UI Location

-

Security

+

Security

@@ -486,7 +513,7 @@

Security

-

Extension Points

+

Extension Points

  • Override _create_demo_programs() to customize program definitions
  • Override _enroll_demo_stories() to modify enrollment logic
  • @@ -495,7 +522,7 @@

    Extension Points

-

Dependencies

+

Dependencies

spp_starter_sp_mis, spp_cr_types_advanced, spp_demo, spp_gis_report, spp_claim_169

Table of contents

@@ -510,7 +537,7 @@

Dependencies

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -518,15 +545,15 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • OpenSPP.org
-

Maintainers

+

Maintainers

Current maintainers:

jeremi gonzalesedwin1123

This module is part of the OpenSPP/OpenSPP2 project on GitHub.

@@ -535,5 +562,6 @@

Maintainers

+
From f2baecc76753e7d7be4e3bd83d6f3915c89c2ea7 Mon Sep 17 00:00:00 2001 From: emjay0921 Date: Mon, 23 Mar 2026 14:11:54 +0800 Subject: [PATCH 3/5] docs(spp_case_demo,spp_grm_demo): sync descriptions with code - spp_case_demo: mention 3 background cases, clarify non-deterministic generation - spp_grm_demo: list all 8 personas, add missing dependencies (spp_grm_registry, spp_grm_programs), clarify non-deterministic generation --- spp_case_demo/readme/DESCRIPTION.md | 6 +++--- spp_grm_demo/readme/DESCRIPTION.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spp_case_demo/readme/DESCRIPTION.md b/spp_case_demo/readme/DESCRIPTION.md index 457abdb4..9199bee7 100644 --- a/spp_case_demo/readme/DESCRIPTION.md +++ b/spp_case_demo/readme/DESCRIPTION.md @@ -1,9 +1,9 @@ -Demo data generator for Case Management system. Creates realistic cases with intervention plans, home visits, progress notes, and service referrals. Includes 9 fixed demo stories for training and sales demos, plus configurable random case generation for volume testing. +Demo data generator for Case Management system. Creates realistic cases with intervention plans, home visits, progress notes, and service referrals. Includes 9 fixed demo stories plus 3 background cases for training and sales demos, and configurable volume case generation using Faker for locale-aware random data (non-deterministic — each run produces different results). ### Key Capabilities -- Generate 9 fixed demo stories with predictable personas and case progressions for consistent training scenarios -- Create random volume cases with configurable distribution percentages for plans, visits, notes, and closures +- Generate 9 fixed demo stories with predictable personas and case progressions for consistent training scenarios, plus 3 background cases (Fernandez Intake Pending, Johnson Assessment, Kim Case Closed) for variety +- Create random volume cases using Faker (non-seeded) with configurable distribution percentages for plans, visits, notes, and closures - Link generated cases to existing registrants or create standalone cases - Backdate case records and related activities to simulate realistic timelines over configurable day ranges - Create intervention plans with multiple interventions across case lifecycle stages diff --git a/spp_grm_demo/readme/DESCRIPTION.md b/spp_grm_demo/readme/DESCRIPTION.md index 5e108752..017c859f 100644 --- a/spp_grm_demo/readme/DESCRIPTION.md +++ b/spp_grm_demo/readme/DESCRIPTION.md @@ -1,4 +1,4 @@ -Demo data generator for the Grievance Redress Mechanism. Creates both story-based tickets linked to specific personas (Juan Dela Cruz, Ibrahim Hassan, Fatima Al-Rahman) and volume tickets using scenario templates. Simulates realistic ticket workflows including resolution paths, escalations, and timeline distribution. +Demo data generator for the Grievance Redress Mechanism. Creates both story-based tickets linked to specific personas (Juan Dela Cruz, Ibrahim Hassan, Fatima Al-Rahman, Ahmed Said, David Martinez, Maria Santos, Rosa Garcia, Carlos Morales) and volume tickets using scenario templates. Simulates realistic ticket workflows including resolution paths, escalations, and timeline distribution. Uses Faker for locale-aware random data (non-deterministic — each run produces different volume tickets). ### Key Capabilities @@ -50,4 +50,4 @@ Story personas align with `spp_mis_demo_v2` and `spp_case_demo` for cross-module ### Dependencies -`spp_demo`, `spp_grm`, `spp_security` +`spp_demo`, `spp_grm`, `spp_grm_registry`, `spp_grm_programs`, `spp_security`, `faker` (Python) From 911d085274690525488d5dd70497551c51203ad6 Mon Sep 17 00:00:00 2001 From: emjay0921 Date: Mon, 23 Mar 2026 14:28:54 +0800 Subject: [PATCH 4/5] docs(spp_case_demo,spp_grm_demo): add generated READMEs Include auto-generated README.rst and index.html from oca-gen-addon-readme (Python 3.11) to match CI expectations. --- spp_case_demo/README.rst | 42 +++++++++------- spp_case_demo/static/description/index.html | 54 ++++++++++++--------- spp_grm_demo/README.rst | 38 +++++++++------ spp_grm_demo/static/description/index.html | 48 ++++++++++-------- 4 files changed, 109 insertions(+), 73 deletions(-) diff --git a/spp_case_demo/README.rst b/spp_case_demo/README.rst index af487498..186023e2 100644 --- a/spp_case_demo/README.rst +++ b/spp_case_demo/README.rst @@ -1,13 +1,17 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ================================= OpenSPP Case Management Demo Data ================================= -.. +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:83c38ef565ee03dd1e3a2d245f7e6fd1be8908369371180c89a39e3f7948ae36 + !! source digest: sha256:291fcbc81ab3ed04474dce0f58442d85243a386f198970d0993de7e77d96f6f8 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png @@ -24,16 +28,20 @@ OpenSPP Case Management Demo Data Demo data generator for Case Management system. Creates realistic cases with intervention plans, home visits, progress notes, and service -referrals. Includes 9 fixed demo stories for training and sales demos, -plus configurable random case generation for volume testing. +referrals. Includes 9 fixed demo stories plus 3 background cases for +training and sales demos, and configurable volume case generation using +Faker for locale-aware random data (non-deterministic — each run +produces different results). Key Capabilities ~~~~~~~~~~~~~~~~ - Generate 9 fixed demo stories with predictable personas and case - progressions for consistent training scenarios -- Create random volume cases with configurable distribution percentages - for plans, visits, notes, and closures + progressions for consistent training scenarios, plus 3 background + cases (Fernandez Intake Pending, Johnson Assessment, Kim Case Closed) + for variety +- Create random volume cases using Faker (non-seeded) with configurable + distribution percentages for plans, visits, notes, and closures - Link generated cases to existing registrants or create standalone cases - Backdate case records and related activities to simulate realistic @@ -50,15 +58,15 @@ Key Capabilities Key Models ~~~~~~~~~~ -+-----------------------------+----------------------------------------+ -| Model | Description | -+=============================+========================================+ -| ``spp.case.demo.generator`` | Core logic for configuring and | -| | generating demo data | -+-----------------------------+----------------------------------------+ -| ``spp.case.demo.wizard`` | Wizard interface for demo data | -| | generation (inherits generator) | -+-----------------------------+----------------------------------------+ ++-----------------------------+---------------------------------------+ +| Model | Description | ++=============================+=======================================+ +| ``spp.case.demo.generator`` | Core logic for configuring and | +| | generating demo data | ++-----------------------------+---------------------------------------+ +| ``spp.case.demo.wizard`` | Wizard interface for demo data | +| | generation (inherits generator) | ++-----------------------------+---------------------------------------+ Configuration ~~~~~~~~~~~~~ @@ -165,4 +173,4 @@ Current maintainers: This module is part of the `OpenSPP/OpenSPP2 `_ project on GitHub. -You are welcome to contribute. \ No newline at end of file +You are welcome to contribute. diff --git a/spp_case_demo/static/description/index.html b/spp_case_demo/static/description/index.html index b2131a12..6f62d13f 100644 --- a/spp_case_demo/static/description/index.html +++ b/spp_case_demo/static/description/index.html @@ -3,7 +3,7 @@ -OpenSPP Case Management Demo Data +README.rst -
-

OpenSPP Case Management Demo Data

+
+ + +Odoo Community Association + +
+

OpenSPP Case Management Demo Data

Production/Stable License: LGPL-3 OpenSPP/OpenSPP2

Demo data generator for Case Management system. Creates realistic cases with intervention plans, home visits, progress notes, and service -referrals. Includes 9 fixed demo stories for training and sales demos, -plus configurable random case generation for volume testing.

+referrals. Includes 9 fixed demo stories plus 3 background cases for +training and sales demos, and configurable volume case generation using +Faker for locale-aware random data (non-deterministic — each run +produces different results).

-

Key Capabilities

+

Key Capabilities

  • Generate 9 fixed demo stories with predictable personas and case -progressions for consistent training scenarios
  • -
  • Create random volume cases with configurable distribution percentages -for plans, visits, notes, and closures
  • +progressions for consistent training scenarios, plus 3 background +cases (Fernandez Intake Pending, Johnson Assessment, Kim Case Closed) +for variety +
  • Create random volume cases using Faker (non-seeded) with configurable +distribution percentages for plans, visits, notes, and closures
  • Link generated cases to existing registrants or create standalone cases
  • Backdate case records and related activities to simulate realistic @@ -396,11 +405,11 @@

    Key Capabilities

-

Key Models

+

Key Models

--++ @@ -420,7 +429,7 @@

Key Models

Model
-

Configuration

+

Configuration

After installing:

  1. Navigate to Case Management > Configuration > Generate Demo Data
  2. @@ -440,14 +449,14 @@

    Configuration

-

UI Location

+

UI Location

  • Menu: Case Management > Configuration > Generate Demo Data
  • Generated Cases: View results in Case Management > Cases
-

Security

+

Security

@@ -466,7 +475,7 @@

Security

-

Demo Stories

+

Demo Stories

When “Include Demo Stories” is enabled, generates 9 fixed personas:

  • Santos Family Support: Complete case lifecycle from intake to @@ -489,7 +498,7 @@

    Demo Stories

-

Dependencies

+

Dependencies

spp_demo, spp_case_base, spp_security, faker (Python)

Table of contents

@@ -503,7 +512,7 @@

Dependencies

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -511,15 +520,15 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • OpenSPP.org
-

Maintainers

+

Maintainers

Current maintainers:

jeremi gonzalesedwin1123 emjay0921

This module is part of the OpenSPP/OpenSPP2 project on GitHub.

@@ -528,5 +537,6 @@

Maintainers

+
diff --git a/spp_grm_demo/README.rst b/spp_grm_demo/README.rst index be88bc6d..65587095 100644 --- a/spp_grm_demo/README.rst +++ b/spp_grm_demo/README.rst @@ -1,13 +1,17 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + ===================== OpenSPP GRM Demo Data ===================== -.. +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:e06d51d82fd6af706b02cdfeac83514a24586b5176e2052f2fbc269ff30eccda + !! source digest: sha256:560fca6409656fbc2b15774ed63a79238305378a5033cbd83d147fa4026e29b2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png @@ -24,9 +28,12 @@ OpenSPP GRM Demo Data Demo data generator for the Grievance Redress Mechanism. Creates both story-based tickets linked to specific personas (Juan Dela Cruz, Ibrahim -Hassan, Fatima Al-Rahman) and volume tickets using scenario templates. +Hassan, Fatima Al-Rahman, Ahmed Said, David Martinez, Maria Santos, Rosa +Garcia, Carlos Morales) and volume tickets using scenario templates. Simulates realistic ticket workflows including resolution paths, -escalations, and timeline distribution. +escalations, and timeline distribution. Uses Faker for locale-aware +random data (non-deterministic — each run produces different volume +tickets). Key Capabilities ~~~~~~~~~~~~~~~~ @@ -47,15 +54,15 @@ Key Capabilities Key Models ~~~~~~~~~~ -+----------------------------+-----------------------------------------+ -| Model | Description | -+============================+=========================================+ -| ``spp.grm.demo.generator`` | Transient model containing generation | -| | logic and workflow simulation | -+----------------------------+-----------------------------------------+ -| ``spp.grm.demo.wizard`` | Transient model inheriting from | -| | generator for wizard UI configuration | -+----------------------------+-----------------------------------------+ ++----------------------------+----------------------------------------+ +| Model | Description | ++============================+========================================+ +| ``spp.grm.demo.generator`` | Transient model containing generation | +| | logic and workflow simulation | ++----------------------------+----------------------------------------+ +| ``spp.grm.demo.wizard`` | Transient model inheriting from | +| | generator for wizard UI configuration | ++----------------------------+----------------------------------------+ Configuration ~~~~~~~~~~~~~ @@ -109,7 +116,8 @@ workflow demonstrations. Dependencies ~~~~~~~~~~~~ -``spp_demo``, ``spp_grm``, ``spp_security`` +``spp_demo``, ``spp_grm``, ``spp_grm_registry``, ``spp_grm_programs``, +``spp_security``, ``faker`` (Python) **Table of contents** @@ -153,4 +161,4 @@ Current maintainers: This module is part of the `OpenSPP/OpenSPP2 `_ project on GitHub. -You are welcome to contribute. \ No newline at end of file +You are welcome to contribute. diff --git a/spp_grm_demo/static/description/index.html b/spp_grm_demo/static/description/index.html index 859035eb..d549984f 100644 --- a/spp_grm_demo/static/description/index.html +++ b/spp_grm_demo/static/description/index.html @@ -3,7 +3,7 @@ -OpenSPP GRM Demo Data +README.rst -
-

OpenSPP GRM Demo Data

+
+ + +Odoo Community Association + +
+

OpenSPP GRM Demo Data

Production/Stable License: LGPL-3 OpenSPP/OpenSPP2

Demo data generator for the Grievance Redress Mechanism. Creates both story-based tickets linked to specific personas (Juan Dela Cruz, Ibrahim -Hassan, Fatima Al-Rahman) and volume tickets using scenario templates. +Hassan, Fatima Al-Rahman, Ahmed Said, David Martinez, Maria Santos, Rosa +Garcia, Carlos Morales) and volume tickets using scenario templates. Simulates realistic ticket workflows including resolution paths, -escalations, and timeline distribution.

+escalations, and timeline distribution. Uses Faker for locale-aware +random data (non-deterministic — each run produces different volume +tickets).

-

Key Capabilities

+

Key Capabilities

  • Generate story tickets for specific demo personas that align with spp_mis_demo_v2 and spp_case_demo
  • @@ -393,7 +401,7 @@

    Key Capabilities

-

Key Models

+

Key Models

@@ -417,7 +425,7 @@

Key Models

-

Configuration

+

Configuration

After installing:

  1. Ensure registrants exist (run spp_demo story generation first)
  2. @@ -427,7 +435,7 @@

    Configuration

-

UI Location

+

UI Location

  • Menu: Helpdesk > Configuration > Generate Demo Data
  • Wizard: Configure story vs. volume generation, ticket count, time @@ -435,7 +443,7 @@

    UI Location

-

Security

+

Security

@@ -454,7 +462,7 @@

Security

-

Data Generated

+

Data Generated

The generator creates spp.grm.ticket records with:

  • Story tickets: 8 predefined personas with specific scenarios (payment @@ -469,15 +477,16 @@

    Data Generated

-

Integration

+

Integration

Story personas align with spp_mis_demo_v2 and spp_case_demo for cross-module demos. Tickets can reference programs and beneficiaries, and story tickets include escalate_to_case flags for GRM-to-case workflow demonstrations.

-

Dependencies

-

spp_demo, spp_grm, spp_security

+

Dependencies

+

spp_demo, spp_grm, spp_grm_registry, spp_grm_programs, +spp_security, faker (Python)

Table of contents

    @@ -490,7 +499,7 @@

    Dependencies

-

Bug Tracker

+

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us to smash it by providing a detailed and welcomed @@ -498,15 +507,15 @@

Bug Tracker

Do not contact contributors directly about support or help with technical issues.

-

Credits

+

Credits

-

Authors

+

Authors

  • OpenSPP.org
-

Maintainers

+

Maintainers

Current maintainers:

jeremi gonzalesedwin1123 emjay0921

This module is part of the OpenSPP/OpenSPP2 project on GitHub.

@@ -515,5 +524,6 @@

Maintainers

+
From e7a23dda2c8880a1247ec1fa8ef572d8173087ff Mon Sep 17 00:00:00 2001 From: emjay0921 Date: Mon, 23 Mar 2026 16:49:58 +0800 Subject: [PATCH 5/5] docs(spp_mis_demo_v2): remove stale README.md, fix USE_CASES.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Delete README.md — its content is covered by readme/DESCRIPTION.md (module description) and docs/USE_CASES.md (developer guide). Fix "6 programs" -> "7 programs" in USE_CASES.md overview. --- spp_mis_demo_v2/README.md | 346 ------------------------------ spp_mis_demo_v2/docs/USE_CASES.md | 2 +- 2 files changed, 1 insertion(+), 347 deletions(-) delete mode 100644 spp_mis_demo_v2/README.md diff --git a/spp_mis_demo_v2/README.md b/spp_mis_demo_v2/README.md deleted file mode 100644 index 2076eaad..00000000 --- a/spp_mis_demo_v2/README.md +++ /dev/null @@ -1,346 +0,0 @@ -# OpenSPP MIS Demo V2 - -## Overview - -This module provides Demo Generator V2 for SP-MIS programs, following the simplified -"Fixed Stories + Volume" architecture. It creates predictable demo data that integrates -with the demo stories from `spp_demo` and showcases CEL expressions with Logic Packs -from `spp_studio`. - -## Features - -- **Demo Programs**: 6 programs with CEL eligibility expressions -- **Logic Pack Integration**: Programs link to reusable Logic Packs -- **CEL Expression Showcase**: Demonstrates member queries, metrics, and constants -- **Story Enrollments**: 9 demo personas with memorable names -- **Change Requests**: All 11 CR types with approval workflows -- **Multi-Mode Wizard**: Sales, Training, Testing, and Complete modes - -## Demo Programs - -The 6 demo programs showcase different CEL expression patterns using **activated -registry variables**: - -| Program | Target | CEL Pattern | Logic Pack | -| ------------------------ | ---------- | --------------------------------------------- | ------------------------ | -| Universal Child Grant | Group | `child_count > 0` (variable) | child_benefit | -| Elderly Social Pension | Individual | `age >= retirement_age` (computed + constant) | social_pension | -| Emergency Relief Fund | Group | `dependency_ratio >= 1.5` (computed variable) | vulnerability_assessment | -| Cash Transfer Program | Group | `hh_total_income < poverty_line` (aggregate) | cash_transfer_basic | -| Disability Support Grant | Group | `has_disabled_member` (computed variable) | disability_assistance | -| Food Assistance | Individual | `r.active == true` (simple field) | None (inline CEL) | - -## Demo Stories (12 Personas) - -### Primary Stories - Eligible - -| Persona | MIS Program | GRM Ticket | Case Story | -| ---------------- | ------------------------ | ------------------------- | ------------------------ | -| Maria Santos | Cash Transfer Program | Graduation inquiry | Santos Family Support | -| Juan Dela Cruz | Cash Transfer Program | Payment not received | Dela Cruz Emergency | -| Rosa Garcia | Elderly Pension + Food | Delivery schedule inquiry | Garcia Elder Care | -| Carlos Morales | Universal Child Grant | Adding new child | Morales Household Crisis | -| Ibrahim Hassan | Emergency Relief Fund | Resettlement support | Hassan Resettlement | -| David Martinez | Disability Support Grant | Grant application status | Martinez Disability | -| Fatima Al-Rahman | Universal Child Grant | Eligibility inquiry | Al-Rahman Assessment | -| Ahmed Said | Cash Transfer Program | Multiple tickets (3) | Said Family Support | - -### Rejection Demonstrations - Ineligible - -| Persona | Program Applied For | Rejection Reason | -| --------------------- | ---------------------- | ------------------------- | -| Mary Johnson | Elderly Social Pension | Below retirement age (55) | -| Childless Household | Universal Child Grant | No children under 18 | -| High Income Household | Cash Transfer Program | Income above poverty line | - -## CEL Expression Examples - -These expressions use **activated registry variables** for cleaner, more maintainable -eligibility rules. - -### Universal Child Grant - -```cel -r.is_group == true and child_count > 0 -``` - -Uses the `child_count` aggregate variable (automatically counts members under 18). - -### Elderly Social Pension - -```cel -r.is_group == false and age >= retirement_age -``` - -Uses the `age` computed variable and `retirement_age` constant (default: 60). - -### Emergency Relief Fund - -```cel -r.is_group == true and (dependency_ratio >= 1.5 or (is_female_headed and elderly_count > 0)) -``` - -Uses `dependency_ratio`, `is_female_headed`, and `elderly_count` variables for -vulnerability targeting. - -### Cash Transfer Program - -```cel -r.is_group == true and hh_total_income < poverty_line and hh_size >= 2 -``` - -Uses `hh_total_income` aggregate, `poverty_line` constant, and `hh_size` aggregate. - -### Disability Support Grant - -```cel -r.is_group == true and has_disabled_member -``` - -Uses the `has_disabled_member` computed variable (checks `is_person_with_disability` on -members). - -## Cross-Module Integration - -### Integrated Demo Ecosystem - -MIS Demo V2 is designed to work seamlessly with GRM and Case Management demos: - -``` -┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ -│ spp_mis_demo_v2│ │ spp_grm_demo │ │ spp_case_demo │ -│ │ │ │ │ │ -│ • Programs │────▶│ • Tickets │────▶│ • Cases │ -│ • Enrollments │ │ • Escalations │ │ • Interventions│ -│ • Payments │ │ • Resolutions │ │ • Plans │ -└─────────────────┘ └─────────────────┘ └─────────────────┘ - │ │ │ - └───────────────────────┴───────────────────────┘ - Shared Personas (8 beneficiaries) -``` - -### Automatic Cross-Module Generation - -The MIS Demo wizard can automatically generate GRM tickets and Cases when those modules -are installed. Simply enable the options in the wizard: - -- **Generate GRM Demo**: Creates story-based tickets + volume tickets (requires - `spp_grm_demo`) -- **Generate Case Demo**: Creates story-based cases + volume cases (requires - `spp_case_demo`) - -This eliminates the need to run separate wizards for each module. - -### Manual Demo Order (Alternative) - -If you prefer to run demos separately: - -1. **spp_demo** - Creates base registrants with persona names -2. **spp_mis_demo_v2** - Creates programs and enrolls personas -3. **spp_grm_demo** - Creates tickets referencing program issues -4. **spp_case_demo** - Creates cases escalated from GRM - -### Demo Scenario: Juan Dela Cruz Journey - -1. **MIS**: Enrolled in Cash Transfer Program, receiving $150/month -2. **GRM**: Files ticket "Payment not received after house fire" -3. **GRM**: Ticket escalated due to emergency situation -4. **Case**: Emergency case opened with shelter and cash assistance interventions -5. **Case**: Family stabilized, case moves to monitoring phase - -### Demo Scenario: David Martinez Journey - -1. **MIS**: Applies for Disability Support Grant for son Miguel -2. **GRM**: Files ticket asking about application status -3. **GRM**: Referred to case management for comprehensive support -4. **Case**: Case opened for equipment assistance and education enrollment -5. **MIS**: Grant approved - $175/month (base $100 + $75 per disabled member) - -## Dependencies - -- `spp_demo` - Demo story infrastructure -- `spp_programs` - Program management -- `spp_registry` - Registry module -- `spp_cel_domain` - CEL variable system (ADR-008, ADR-017) -- `spp_studio` - Logic Packs and expressions -- `spp_change_request_v2` - Change request workflows -- Optional: `spp_grm_demo` - For cross-module GRM integration -- Optional: `spp_case_demo` - For cross-module case integration - -## Installation - -1. Install the module through Odoo Apps menu -2. Ensure `spp_demo` is installed with stories generated - -## Usage - -### Using the Wizard - -1. Navigate to **Programs > Generate MIS Demo Data** -2. Select **Demo Mode**: - - **Sales Demo**: Fixed stories, minimal data, fast - - **Partner Training**: Full programs, Logic Packs, comprehensive - - **Developer Testing**: Volume data, random generation, scale testing - - **Complete Demo**: All features enabled -3. Configure additional options as needed -4. Click **Generate Demo Data** - -### Demo Mode Presets - -| Mode | Stories | Programs | Logic Packs | Volume | Personas | -| -------- | ------- | -------- | ----------- | ------- | -------- | -| Sales | Yes | Yes | No | No | No | -| Training | Yes | Yes | Yes | Minimal | Yes | -| Testing | Yes | Yes | No | High | No | -| Complete | Yes | Yes | Yes | Yes | Yes | - -### Programmatic Usage - -```python -# Create and run the generator with training mode -generator = env['spp.mis.demo.wizard'].create({ - 'name': 'Training Demo', - 'demo_mode': 'training', - 'install_logic_packs': True, - 'include_test_personas': True, - 'create_demo_programs': True, - 'enroll_demo_stories': True, -}) -generator.action_generate_demo_data() -``` - -## Change Request Integration - -The demo creates change requests covering all 11 CR types: - -### CR Types Demonstrated - -| Type | Description | Demo State | -| ----------------- | ------------------------- | ------------------ | -| edit_individual | Basic data update | Approved | -| update_id | ID document update | Approved | -| exit_registrant | Registry exit | Approved + Applied | -| add_member | Add household member | Approved | -| remove_member | Remove member | Pending | -| transfer_member | Inter-household transfer | Pending | -| change_hoh | Head of household change | Approved | -| create_group | Create new group | Draft | -| split_household | Split into two households | Draft | -| merge_registrants | Merge duplicates | Rejected | - -### Workflow States Demonstrated - -- **Draft**: New CRs not yet submitted -- **Pending**: Awaiting approval -- **Approved**: Approved (may or may not be applied) -- **Rejected**: Rejected with reason documented -- **Revision**: Sent back for correction - -## Logic Pack Integration - -Programs link to pre-built Logic Packs from `spp_studio`: - -```python -DEMO_LOGIC_PACKS = [ - "child_benefit", # Universal Child Grant - "social_pension", # Elderly Social Pension - "vulnerability_assessment", # Emergency Relief - "cash_transfer_basic", # Cash Transfer Program - "disability_assistance", # Disability Support Grant -] -``` - -### Installing Logic Packs - -```python -from odoo.addons.spp_mis_demo_v2.models.demo_variables import install_demo_packs -installed = install_demo_packs(env) -``` - -## Registry Variables - -On module installation, registry variables are **automatically activated** and ready for -use in Logic Studio and program expressions. This includes both standard variables from -`spp_studio` and demo-specific variables. - -### Standard Variables (from spp_studio) - -| Category | Variables | -| ----------------------------- | --------------------------------------------------------------------------------------------------------- | -| **Demographics** | `age` | -| **Household Composition** | `hh_size`, `child_count`, `elderly_count`, `working_age_count` | -| **Household Characteristics** | `is_female_headed`, `is_elderly_headed`, `has_disabled_member`, `has_pregnant_member`, `dependency_ratio` | -| **Economic** | `per_capita_income`, `hh_total_income`, `hh_avg_income` | -| **Constants** | `poverty_line`, `retirement_age`, `child_age_limit`, `per_child_benefit`, `base_benefit` | - -### Demo-Specific Variables - -| Variable | Type | Default | Description | -| ----------------------------- | --------- | ------- | --------------------------- | -| `vulnerability_threshold` | constant | 70 | Emergency eligibility score | -| `base_child_grant` | constant | 50 | Per-child benefit amount | -| `disability_grant_base` | constant | 100 | Base disability amount | -| `disability_grant_per_member` | constant | 75 | Per disabled member bonus | -| `emergency_tier_1` | constant | 500 | Tier 1 emergency amount | -| `emergency_tier_2` | constant | 400 | Tier 2 emergency amount | -| `emergency_tier_3` | constant | 300 | Tier 3 emergency amount | -| `elderly_pension_amount` | constant | 100 | Fixed pension amount | -| `cash_transfer_amount` | constant | 150 | Fixed transfer amount | -| `disabled_count` | aggregate | - | Count of disabled members | - -### Variable Activation - -Variables are activated during module installation via `post_init_hook`. The activation: - -1. Finds variables by XML ID (e.g., `spp_studio.var_age`) -2. Activates any in `draft` state -3. Skips already active variables -4. Logs results for troubleshooting - -``` -[spp.mis.demo] Standard variables: 18 activated, 0 already active, 0 errors -[spp.mis.demo] Demo variables: 10 activated, 0 already active, 0 errors -[spp.mis.demo] Registry variables ready: 28 activated, 0 skipped, 0 errors -``` - -## Technical Details - -### Models - -- `spp.mis.demo.generator` - Core generator with all logic -- `spp.mis.demo.wizard` - Wizard interface (inherits generator) - -### Key Methods - -- `action_generate()` - Main entry point -- `_create_demo_programs()` - Creates 6 programs with CEL -- `_enroll_demo_stories()` - Enrolls personas -- `_install_logic_packs()` - Installs required Logic Packs -- `_create_test_personas()` - Creates test personas for Studio -- `_create_change_requests()` - Creates CR demos - -### Data Files - -- `data/demo_constants.xml` - CEL variable definitions -- `data/demo_personas.xml` - Test personas for Logic Studio -- `data/demo_programs.xml` - Program configurations - -## V3 Architecture Alignment - -This module follows the V3 Architecture principles: - -- **CEL Integration** - All eligibility uses CEL expressions -- **Logic Packs** - Reusable expression bundles -- **Fixed Stories + Volume** - Predictable personas plus random data -- **Multi-Mode** - Different presets for different use cases -- **Change Requests** - Full CR workflow coverage - -## License - -LGPL-3 - -## Credits - -**Authors**: OpenSPP.org - -**Maintainers**: jeremi, gonzalesedwin1123 diff --git a/spp_mis_demo_v2/docs/USE_CASES.md b/spp_mis_demo_v2/docs/USE_CASES.md index 49fbeaea..4323d52a 100644 --- a/spp_mis_demo_v2/docs/USE_CASES.md +++ b/spp_mis_demo_v2/docs/USE_CASES.md @@ -26,7 +26,7 @@ Seeded RNG** architecture: - **Fixed Stories**: 8 named personas with predefined program journeys (unchanged) - **Deterministic Volume**: ~730 households with ~2,500 members from 28 blueprint templates -- **Demo Programs**: 6 programs covering different social protection scenarios +- **Demo Programs**: 7 programs covering different social protection scenarios - **100% Reproducible**: Same country selection = identical output every run - **Country-aware Names**: Names change by locale (Philippines, Sri Lanka, Togo)