Skip to content

Commit 6b3fbcf

Browse files
committed
feat(spp_mis_demo_v2): add locale-aware demographic data to demo generator
Add address, email, phone, birth_place, civil_status, ID documents, and bank accounts to all demo registrants. Data is locale-aware across Philippines, Togo, and Sri Lanka, and fully deterministic (seeded RNG). Groups get: street address, city, zip, country, email, phone (char + spp.phone.number with country), bank account (res.partner.bank), household registration ID (spp.registry.id). Individuals get: birth_place, civil_status (age-appropriate), email, phone (char + spp.phone.number with country), national ID for adults (age >= 15), birth certificate for children (age < 15). - New DemographicEnricher utility class with batch and single-record modes - Extend locale providers (fil_PH, fr_TG, si_LK) with cities, streets, phone formats, email domains, birth places, banks, ID format templates - Integrate into SeededVolumeGenerator (Phase 5+6 after existing phases) - Integrate into story registrant creation (enriches all story registrants) - Add spp_banking dependency to manifest
1 parent aa6da89 commit 6b3fbcf

7 files changed

Lines changed: 938 additions & 0 deletions

File tree

spp_demo/locale_providers/fil_PH/__init__.py

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,92 @@
44
class Provider(PersonProvider):
55
formats = ["{{first_name}} {{last_name}}"]
66

7+
# ISO country code for res.country lookup
8+
country_code = "PH"
9+
10+
# Address data: (city, province/region, zip_code)
11+
cities = [
12+
("Quezon City", "Metro Manila", "1100"),
13+
("Manila", "Metro Manila", "1000"),
14+
("Makati", "Metro Manila", "1200"),
15+
("Taguig", "Metro Manila", "1630"),
16+
("Pasig", "Metro Manila", "1600"),
17+
("Caloocan", "Metro Manila", "1400"),
18+
("Cebu City", "Cebu", "6000"),
19+
("Davao City", "Davao del Sur", "8000"),
20+
("Iloilo City", "Iloilo", "5000"),
21+
("Zamboanga City", "Zamboanga del Sur", "7000"),
22+
("Cagayan de Oro", "Misamis Oriental", "9000"),
23+
("Bacolod", "Negros Occidental", "6100"),
24+
("General Santos", "South Cotabato", "9500"),
25+
("Batangas City", "Batangas", "4200"),
26+
("Cabanatuan", "Nueva Ecija", "3100"),
27+
("San Fernando", "Pampanga", "2000"),
28+
("Lipa", "Batangas", "4217"),
29+
("Lucena", "Quezon", "4301"),
30+
("Dagupan", "Pangasinan", "2400"),
31+
("Baguio", "Benguet", "2600"),
32+
]
33+
34+
street_names = [
35+
"Rizal Street",
36+
"Mabini Avenue",
37+
"Bonifacio Drive",
38+
"Quezon Boulevard",
39+
"Aguinaldo Highway",
40+
"Roxas Boulevard",
41+
"Osmeña Street",
42+
"Magsaysay Avenue",
43+
"Laurel Street",
44+
"Del Pilar Street",
45+
"Luna Street",
46+
"Jacinto Street",
47+
"Silang Drive",
48+
"Katipunan Avenue",
49+
"Sampaguita Street",
50+
"Narra Street",
51+
"Acacia Lane",
52+
"Mahogany Drive",
53+
"Camia Street",
54+
"Ilang-Ilang Street",
55+
]
56+
57+
# Phone format: {dN} means N random digits
58+
mobile_format = "+639{d2}{d3}{d4}"
59+
email_domains = ["gmail.com", "yahoo.com.ph", "outlook.com"]
60+
61+
birth_places = [
62+
"Quezon City",
63+
"Manila",
64+
"Cebu City",
65+
"Davao City",
66+
"Makati",
67+
"Iloilo City",
68+
"Bacolod",
69+
"Zamboanga City",
70+
"Cagayan de Oro",
71+
"General Santos",
72+
"Batangas City",
73+
"Cabanatuan",
74+
"San Fernando",
75+
"Baguio",
76+
"Dagupan",
77+
]
78+
79+
# Banks: (full_name, bic_code)
80+
banks = [
81+
("BDO Unibank", "BNORPHMM"),
82+
("Bank of the Philippine Islands", "BOPIPHMM"),
83+
("Metropolitan Bank and Trust", "MABORSMX"),
84+
("Land Bank of the Philippines", "TLBPPHMM"),
85+
("Philippine National Bank", "PNBMPHMM"),
86+
]
87+
88+
# National ID format template
89+
national_id_format = "PSN-{d4}-{d4}-{d4}"
90+
# Household registration format
91+
household_id_format = "HH-{d4}-{d6}"
92+
793
first_names_male = [
894
"Juan",
995
"Jose",

spp_demo/locale_providers/fr_TG/__init__.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,73 @@
44
class Provider(PersonProvider):
55
formats = ["{{first_name}} {{last_name}}"]
66

7+
# ISO country code
8+
country_code = "TG"
9+
10+
# Address data: (city, region, zip_code)
11+
cities = [
12+
("Lomé", "Maritime", "01 BP"),
13+
("Kara", "Kara", "04 BP"),
14+
("Sokodé", "Centrale", "03 BP"),
15+
("Atakpamé", "Plateaux", "02 BP"),
16+
("Kpalimé", "Plateaux", "02 BP"),
17+
("Dapaong", "Savanes", "05 BP"),
18+
("Tsévié", "Maritime", "01 BP"),
19+
("Aného", "Maritime", "01 BP"),
20+
("Bassar", "Kara", "04 BP"),
21+
("Notsé", "Plateaux", "02 BP"),
22+
("Tabligbo", "Maritime", "01 BP"),
23+
("Badou", "Plateaux", "02 BP"),
24+
("Vogan", "Maritime", "01 BP"),
25+
("Niamtougou", "Kara", "04 BP"),
26+
("Mango", "Savanes", "05 BP"),
27+
]
28+
29+
street_names = [
30+
"Boulevard de la Paix",
31+
"Rue du Commerce",
32+
"Avenue de la Libération",
33+
"Rue de la Gare",
34+
"Boulevard du Mono",
35+
"Avenue de la Nouvelle Marche",
36+
"Rue des Nimes",
37+
"Boulevard Circulaire",
38+
"Avenue du 24 Janvier",
39+
"Rue de l'Hôpital",
40+
"Avenue de Sarakawa",
41+
"Rue du Grand Marché",
42+
"Boulevard de la République",
43+
"Avenue de la Chance",
44+
"Rue de l'Indépendance",
45+
]
46+
47+
mobile_format = "+228 9{d1} {d2} {d2} {d2}"
48+
email_domains = ["gmail.com", "yahoo.fr", "hotmail.com"]
49+
50+
birth_places = [
51+
"Lomé",
52+
"Kara",
53+
"Sokodé",
54+
"Atakpamé",
55+
"Kpalimé",
56+
"Dapaong",
57+
"Tsévié",
58+
"Aného",
59+
"Bassar",
60+
"Notsé",
61+
]
62+
63+
banks = [
64+
("Ecobank Togo", "ABORSMXX"),
65+
("Union Togolaise de Banque", "UTBKTGTG"),
66+
("BTCI", "BTCITGTG"),
67+
("Banque Populaire pour l'Épargne et le Crédit", "BPECTGTG"),
68+
("Orabank Togo", "ORANTGTG"),
69+
]
70+
71+
national_id_format = "TG-{d4}-{d4}-{d2}"
72+
household_id_format = "MEN-{d4}-{d6}"
73+
774
first_names_male = [
875
"Koffi",
976
"Kodjo",

spp_demo/locale_providers/si_LK/__init__.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,73 @@
44
class Provider(PersonProvider):
55
formats = ["{{first_name}} {{last_name}}"]
66

7+
# ISO country code
8+
country_code = "LK"
9+
10+
# Address data: (city, province, zip_code)
11+
cities = [
12+
("Colombo", "Western Province", "00100"),
13+
("Kandy", "Central Province", "20000"),
14+
("Galle", "Southern Province", "80000"),
15+
("Jaffna", "Northern Province", "40000"),
16+
("Negombo", "Western Province", "11500"),
17+
("Batticaloa", "Eastern Province", "30000"),
18+
("Trincomalee", "Eastern Province", "31000"),
19+
("Matara", "Southern Province", "81000"),
20+
("Anuradhapura", "North Central Province", "50000"),
21+
("Kurunegala", "North Western Province", "60000"),
22+
("Ratnapura", "Sabaragamuwa Province", "70000"),
23+
("Badulla", "Uva Province", "90000"),
24+
("Gampaha", "Western Province", "11000"),
25+
("Kalutara", "Western Province", "12000"),
26+
("Nuwara Eliya", "Central Province", "22200"),
27+
]
28+
29+
street_names = [
30+
"Galle Road",
31+
"Kandy Road",
32+
"Duplication Road",
33+
"Havelock Road",
34+
"Baseline Road",
35+
"High Level Road",
36+
"Bauddhaloka Mawatha",
37+
"Wijerama Mawatha",
38+
"Dharmapala Mawatha",
39+
"Peradeniya Road",
40+
"Temple Street",
41+
"Lotus Road",
42+
"Chatham Street",
43+
"York Street",
44+
"Dam Street",
45+
]
46+
47+
mobile_format = "+947{d1}{d3}{d4}"
48+
email_domains = ["gmail.com", "yahoo.com", "outlook.com"]
49+
50+
birth_places = [
51+
"Colombo",
52+
"Kandy",
53+
"Galle",
54+
"Jaffna",
55+
"Negombo",
56+
"Matara",
57+
"Kurunegala",
58+
"Batticaloa",
59+
"Anuradhapura",
60+
"Ratnapura",
61+
]
62+
63+
banks = [
64+
("Bank of Ceylon", "BABORLKLXXX"),
65+
("People's Bank", "PABORLKLXXX"),
66+
("Commercial Bank of Ceylon", "CABORLKLXXX"),
67+
("Hatton National Bank", "HABORLKLXXX"),
68+
("Sampath Bank", "SABORLKLXXX"),
69+
]
70+
71+
national_id_format = "{d9}V"
72+
household_id_format = "HH-{d4}-{d6}"
73+
774
first_names_male = [
875
"Aruna",
976
"Chamara",

spp_mis_demo_v2/__manifest__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
"spp_api_v2_gis",
3131
# QR Credentials (Claim 169)
3232
"spp_claim_169",
33+
# Banking (for bank account demo data)
34+
"spp_banking",
3335
# Demo-specific extensions
3436
],
3537
"external_dependencies": {"python": ["requests"]},

0 commit comments

Comments
 (0)