Tech Context
1. Platform & Configurationsβ
- OS: Zoho Creator (SaaS)
- Language: Deluge Scripting
- Database: Zoho Internal DB (Relational)
Environment Settingsβ
- Fiscal Year Start: October 1st.
- Date Format:
dd-MMM-yyyy(e.g., 21-Jan-2026). - Time Zone: Europe/Rome (CET/CEST).
- Time Format: 24-hr.
- Data Import: CSV imports used for Invoices (from accounting systems of different countries).
- Integrations: External APIs (ECB for currency conversion).
2. Developer Workflowβ
Administrative procedures for environment sync.
Export Procedureβ
To obtain the latest Zoho Creator application export:
- Log in to Zoho Creator IDE.
- Open the application in the IDE.
- Click the Export button to download the
.dsfile. - Save/overwrite the file in the
zoho_exports/directory asbudget_contracts.ds. - GIT will handle versioning of changes.
Import Procedureβ
- Log in to Zoho Creator.
- Navigate to the Applications section.
- Click "Import Application".
- Upload the
budget_contracts.dsfile fromzoho_exports/. - Follow the on-screen prompts (select options for data, users, etc. as needed).
- Verify the imported application and test functionality.
[!TIP] Procedural guardrails and technical patterns are delegated to the Zoho Architect Skill.
3. Automated Testing Frameworkβ
To ensure logical correctness of Deluge scripts without slow UI cycles.
Componentsβ
- Test Specification:
docs/tests.md(Gherkin format). - Extraction Script:
tests/extract_tests.py- Convertstests.mdinto.featurefiles. - Logic Engine:
zoho_simulationscript (../.agent/skills/zoho_simulation/scripts/logic_engine.py) - Python implementation of the Deluge algorithms (FY Allocation, Budget Recalculations). - Test Runner:
behave- Executes scenarios via step definitions.
Setup and Executionβ
- Environment: Python 3.x virtual environment in
.venv. - Installation:
pip install behave. - Execution:
source .venv/bin/activate
python3 tests/extract_tests.py
behave tests/features
[!TIP] For detailed simulation logic and FIFO erosion scenarios, see the Zoho Simulation Skill.
4. Entity Relationship Model (ERM)β
Dettaglio dei Legamiβ
| Legame | Tipo | Descrizione |
|---|---|---|
| Bucket -> Versioni | Lookup | Collega ogni snapshot (Rolling Forecast) al suo Bucket. La chiave logica Γ¨ Bucket + FY + Expense_Type. |
| Bucket -> Contratti | Lookup | Il legame fondamentale. Ogni contratto (Proposed o Approved) eredita lo stream e deve matchare il Tipo della versione. |
| Fiscal Year -> Versioni | Lookup | Definisce a quale anno fiscale appartiene la versione. |
| Contratti -> Subforms | Subform | Un contratto multi-anno "esplode" in righe di Contract_FY_Allocation, ognuna collegata a un Fiscal_Year. |
| Invoices -> Subforms | Subform | Permette di allocare il costo reale di una fattura su uno o piΓΉ anni fiscali (Invoice_FY_Allocation) per competenza. |
| Fiscal Year -> Allocations | Lookup | (Condiviso) Permette di filtrare sia l' Impegnato che lo Speso per anno fiscale nelle versioni di budget. |
| Contratti -> Invoices | Lookup | Collega le fatture reali all'impegno contrattuale. Il matching avviene tramite imported_id (Job/Contract Code). |
Flusso di Propagazioneβ
- Contratto: Quando viene salvato, crea/aggiorna le righe in
Contract_FY_Allocation. - Fattura: Quando viene salvata/riconciliata, crea/aggiorna le righe in
Invoice_FY_Allocationbasandosi sulla competenza. - Bucket: Funge da "ponte" per trovare tutte le allocazioni (impegnate e spese) che devono concorrere al budget.
- Versione: Il workflow
Update_Budget_Totalscerca tutti i contratti e le fatture del Bucket, segue il legame con le rispettive Allocazioni (Contract_FY_Allocation,Invoice_FY_Allocation) filtrando per ilFiscal_Yeardella versione, e aggiorna i totali (Impegnato,Totale Contratti,Speso).