{"id":23293534,"url":"https://github.com/cristofima/farmasi-web-simulation","last_synced_at":"2026-05-01T02:34:02.778Z","repository":{"id":275320311,"uuid":"684724036","full_name":"cristofima/Farmasi-Web-Simulation","owner":"cristofima","description":"Angular application that simulates Farmasi MLM (Multi-Level Marketing) bonus calculations. It models team hierarchies, calculates group volumes, and computes various bonus types based on Farmasi's official compensation plan.","archived":false,"fork":false,"pushed_at":"2025-12-01T13:48:25.000Z","size":304,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-03T10:15:36.415Z","etag":null,"topics":["angular","primeng"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cristofima.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-29T18:12:40.000Z","updated_at":"2025-12-01T13:48:29.000Z","dependencies_parsed_at":"2025-02-01T17:29:44.689Z","dependency_job_id":"2d2bc7a5-1121-41bc-9440-b8c15cf82b89","html_url":"https://github.com/cristofima/Farmasi-Web-Simulation","commit_stats":null,"previous_names":["cristofima/farmasi-web-simulation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cristofima/Farmasi-Web-Simulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristofima%2FFarmasi-Web-Simulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristofima%2FFarmasi-Web-Simulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristofima%2FFarmasi-Web-Simulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristofima%2FFarmasi-Web-Simulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cristofima","download_url":"https://codeload.github.com/cristofima/Farmasi-Web-Simulation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cristofima%2FFarmasi-Web-Simulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32483406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","primeng"],"created_at":"2024-12-20T06:16:07.494Z","updated_at":"2026-05-01T02:34:02.771Z","avatar_url":"https://github.com/cristofima.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Farmasi Web Simulation\n\nAngular 17 application that simulates **Farmasi MLM (Multi-Level Marketing)** bonus calculations. It models team hierarchies, calculates group volumes, and computes various bonus types based on Farmasi's official compensation plan.\n\n## Features\n\n- 📊 **Organization Chart** - Visual tree hierarchy of your team\n- 💰 **Bonus Calculator** - Accurate monthly bonus projections\n- 📁 **CSV Import** - Import team data from Farmasi exports\n- 💾 **Simulations** - Save and compare different scenarios\n- 🎯 **Title Tracking** - Track progress toward next title\n\n---\n\n## Bonus Calculations\n\n### 1. Personal Bonus\nEarned on your own purchases.\n\n```\nPersonal Bonus = Personal Volume (PV) × Bonus Level %\n```\n\n### 2. Group Bonus\nEarned on the volume difference between you and your direct frontline.\n\n```\nGroup Bonus = Σ (Child GV × (Your Bonus% - Child Bonus%))\n```\n\n### 3. Leadership Bonus\nEarned when you reach **Manager/Director** level (GV ≥ 5,000 and SP ≥ 1,500).\n\nThe Leadership Bonus is calculated using **Leadership Group Volume (LGV)**, which is the total GV from FIs at **18%, 22%, and 25%** bonus levels combined.\n\n**Generation Counting:**\n- **Gen 1** = Your direct frontline (children of you)\n- **Gen 2** = Children of Gen 1 FIs\n- **Gen 3** = Children of Gen 2 FIs\n- And so on...\n\nSince each FI's GV already includes all their downline volume, the LGV at each generation is naturally cumulative (Gen 1 LGV ≥ Gen 2 LGV ≥ Gen 3 LGV...).\n\n**Formula (Differential):**\n```\nGeneration N Bonus = (LGV_GenN - LGV_GenN+1) × Percentage%\n```\n\n**Leadership Percentages by Title:**\n\n| Title | Gen 1 | Gen 2 | Gen 3 | Gen 4 | Gen 5 | Gen 6 | Gen 7 |\n|-------|-------|-------|-------|-------|-------|-------|-------|\n| Manager/Director | 4.00% | 3.00% | 2.00% | 1.50% | 0% | 0% | 0% |\n| Bronze | 4.50% | 3.25% | 2.25% | 1.75% | 0% | 0% | 0% |\n| Golden | 5.00% | 3.50% | 2.50% | 2.00% | 0% | 0% | 0% |\n| Platinum | 5.50% | 4.00% | 2.75% | 2.20% | 0% | 0% | 0% |\n| Emerald | 6.00% | 4.50% | 3.00% | 2.50% | 0% | 0% | 0% |\n| Diamond | 6.50% | 5.00% | 3.25% | 2.75% | 1.50% | 0% | 0% |\n| Vice President | 7.00% | 5.50% | 3.50% | 3.00% | 1.75% | 0% | 0% |\n| President | 7.50% | 6.00% | 3.75% | 3.25% | 2.00% | 0.75% | 0% |\n| Boss | 8.00% | 6.50% | 4.00% | 3.50% | 2.25% | 1.00% | 0% |\n| Executive Boss | 8.50% | 7.00% | 4.25% | 3.75% | 2.50% | 1.25% | 0.50% |\n\n### 4. Car Bonus\nMonthly allowance for qualifying titles.\n\n| Title | Monthly Bonus |\n|-------|---------------|\n| Golden Director | $350 |\n| Platinum Director | $400 |\n| Emerald Director | $450 |\n| Diamond Director | $500 |\n| Vice President | $550 |\n| President | $600 |\n| Boss Director | $650 |\n| Executive Boss | $700 |\n\n---\n\n## Title Qualifications\n\n| Title | GV | Side Points | Legs (25%) | Title Points |\n|-------|-----|-------------|------------|-------------|\n| Virtual Manager | 5,000 | - | - | - |\n| Director | 5,000 | 1,500 | - | - |\n| Bronze Director | 5,000 | 1,500 | 1 | - |\n| Golden Director | 10,000 | 2,500 | 2 | - |\n| Platinum Director | 20,000 | 2,500 | 4 | - |\n| Emerald Director | 40,000 | 5,000 | 8 | - |\n| Diamond Director | 60,000 | 5,000 | 12 | 15 |\n| Vice President | 80,000 | 10,000 | 16 | 30 |\n| President | 100,000 | 10,000 | 20 | 60 |\n| Boss Director | 150,000 | 10,000 | 30 | 120 |\n| Executive Boss | 200,000 | 10,000 | 30 | 240 |\n\n### Key Definitions\n\n- **Group Volume (GV)**: Sum of PV from you and your entire downline\n- **Side Points (SP)**: Your GV minus the GV of all 25% FIs and minus the highest GV FI from 22%/18% levels\n- **Legs**: Number of frontline FIs at 25% bonus level\n- **Title Points**: Points earned from frontline titles (see Title Points table)\n\n### Title Points from Frontline\n\n| Title | Points |\n|-------|--------|\n| Virtual Manager | 0.25 |\n| Manager/Director | 1 |\n| Bronze | 1.5 |\n| Golden | 2.5 |\n| Platinum | 4 |\n| Emerald | 8 |\n| Diamond | 12 |\n| Vice President | 20 |\n| President | 35 |\n| Boss | 60 |\n| Executive Boss | 100 |\n\n---\n\n## Development\n\n### Prerequisites\n- Node.js 18+\n- Angular CLI 17+\n\n### Commands\n\n```bash\n# Install dependencies\nnpm install\n\n# Development server (http://localhost:4200)\nnpm start\n\n# Production build\nnpm run build:prod\n\n# Run tests with coverage\nnpm run test:prod\n```\n\n### Project Structure\n\n```\nsrc/app/\n├── components/          # UI Components\n│   ├── home/           # Dashboard\n│   ├── organization-chart/  # Team tree visualization\n│   ├── monthly-bonuses/     # Bonus display\n│   ├── settings/       # User settings\n│   ├── simulations/    # Saved scenarios\n│   └── csv-import/     # CSV import dialog\n├── constants/          # Business rules\n│   ├── bonus-level-range.constant.ts\n│   └── farmasi.constant.ts\n├── enums/\n│   └── title.enum.ts   # Title definitions\n├── models/             # TypeScript interfaces\n├── services/           # Data services (localStorage)\n└── utils/              # Calculation logic\n    ├── bonus-calculator.util.ts  # All bonus formulas\n    └── team-member.util.ts       # GV, SP, Title calculations\n\nscripts/\n└── xlsx_to_csv.py      # Excel to CSV conversion utility\n```\n\n### Tech Stack\n\n- **Angular 17** - Framework\n- **PrimeNG** - UI Components\n- **PrimeFlex** - CSS Utilities\n- **localStorage** - Data persistence\n\n---\n\n## CSV Import\n\nImport your team data from Farmasi exports. Required columns:\n\n- `Consultant No` - Unique identifier\n- `First Name` / `Last Name` - Name\n- `Personal Points This Month` - PV\n- `Sponsor Code` - Parent reference\n- `Generation` - Hierarchy level (0 = root)\n\nThe import automatically detects the root FI (Generation = 0 or missing sponsor).\n\n### Getting the Activity Report\n\n1. Log in to your **Farmasi Back Office** account\n2. Go to the **Activity Report** tab\n3. Select the desired **month** for the report\n4. Click the **Send to Email** button\n5. Download the Excel file from your email\n6. Use the conversion script below to convert it to CSV\n\n### Excel to CSV Conversion Script\n\nA Python utility script is provided in the `scripts/` folder to convert the Excel Activity Report to CSV format.\n\n**Requirements:**\n- Python 3.10+\n- pandas library (`pip install pandas openpyxl`)\n\n**Usage:**\n\n```bash\n# Convert first sheet (default)\npython scripts/xlsx_to_csv.py activity_report.xlsx\n\n# Convert with custom output name\npython scripts/xlsx_to_csv.py activity_report.xlsx output.csv\n\n# Convert all sheets to separate CSV files\npython scripts/xlsx_to_csv.py activity_report.xlsx --all\n```\n\n---\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\nThis project is for educational and simulation purposes only. Not affiliated with Farmasi.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristofima%2Ffarmasi-web-simulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcristofima%2Ffarmasi-web-simulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcristofima%2Ffarmasi-web-simulation/lists"}