Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
146 changes: 146 additions & 0 deletions spp_aggregation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
==========================
OpenSPP Aggregation Engine
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:9951d094574dd68b1d86ae2167e53c5ccea5240188acf11a2b7f619ede6c5b54
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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_aggregation
:alt: OpenSPP/OpenSPP2

|badge1| |badge2| |badge3|

Unified aggregation engine for computing statistics, breakdowns, and
fairness metrics over scoped registrant populations. Supports multiple
scope types (CEL expressions, areas, spatial queries, explicit IDs) with
access control, caching, and privacy enforcement.

Key Capabilities
~~~~~~~~~~~~~~~~

- Define reusable aggregation scopes: CEL expression, area, area tag,
spatial polygon/buffer, or explicit registrant IDs
- Resolve scopes to registrant sets with union and intersection
operations
- Compute statistics (count, Gini) with extensible statistic registry
supporting CEL variables
- Role-based access control with per-user scope type restrictions,
dimension limits, and area constraints
- Result caching with configurable TTL per scope type and automatic
cleanup
- Privacy enforcement via k-anonymity suppression on computed results
- Convenience methods for area-based, expression-based, fairness, and
distribution queries

Key Models
~~~~~~~~~~

+----------------------------+----------+----------------------------+
| Model | Type | Description |
+============================+==========+============================+
| ``spp.aggregation.scope`` | Concrete | Configurable aggregation |
| | | scope definitions |
+----------------------------+----------+----------------------------+
| ``spp | Concrete | Per-user/group access |
| .aggregation.access.rule`` | | control rules |
+----------------------------+----------+----------------------------+
| ``spp | Concrete | Persistent cache entries |
| .aggregation.cache.entry`` | | with TTL |
+----------------------------+----------+----------------------------+
| ``spp.ag | Abstract | Strategy-based scope |
| gregation.scope.resolver`` | | resolution service |
+----------------------------+----------+----------------------------+
| ``spp.aggregation.cache`` | Abstract | Cache service with TTL and |
| | | cleanup |
+----------------------------+----------+----------------------------+
| ``spp.aggreg | Abstract | Statistic computation |
| ation.statistic.registry`` | | registry (builtins + CEL) |
+----------------------------+----------+----------------------------+
| ` | Abstract | Main aggregation entry |
| `spp.aggregation.service`` | | point |
+----------------------------+----------+----------------------------+

Configuration
~~~~~~~~~~~~~

- Aggregation scopes: **Settings > Aggregation > Aggregation Scopes**
- Access rules: **Settings > Aggregation > Access Rules**
- Cache cleanup runs daily via scheduled action

Security
~~~~~~~~

+----------------------------------+----------------------------------+
| Group | Access |
+==================================+==================================+
| ``spp_aggr | Read-only access to scopes and |
| egation.group_aggregation_read`` | cache |
+----------------------------------+----------------------------------+
| ``spp_aggre | Read/write scopes and access |
| gation.group_aggregation_write`` | rules |
+----------------------------------+----------------------------------+
| ``spp_aggreg | Implied by write group |
| ation.group_aggregation_viewer`` | |
+----------------------------------+----------------------------------+
| ``spp_aggrega | Implied by viewer group |
| tion.group_aggregation_officer`` | |
+----------------------------------+----------------------------------+
| ``spp_aggrega | Full access, implied by admin |
| tion.group_aggregation_manager`` | |
+----------------------------------+----------------------------------+

Dependencies
~~~~~~~~~~~~

``base``, ``spp_cel_domain``, ``spp_area``, ``spp_registry``,
``spp_security``, ``spp_metrics_services``

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OpenSPP/OpenSPP2/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 <https://github.com/OpenSPP/OpenSPP2/issues/new?body=module:%20spp_aggregation%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Current maintainer:

|maintainer-jeremi|

This module is part of the `OpenSPP/OpenSPP2 <https://github.com/OpenSPP/OpenSPP2/tree/19.0/spp_aggregation>`_ project on GitHub.

You are welcome to contribute.
2 changes: 1 addition & 1 deletion spp_aggregation/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"author": "OpenSPP.org",
"website": "https://github.com/OpenSPP/OpenSPP2",
"license": "LGPL-3",
"development_status": "Alpha",
"development_status": "Beta",
"maintainers": ["jeremi"],
"depends": [
"base",
Expand Down
43 changes: 43 additions & 0 deletions spp_aggregation/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Unified aggregation engine for computing statistics, breakdowns, and fairness metrics over scoped registrant populations. Supports multiple scope types (CEL expressions, areas, spatial queries, explicit IDs) with access control, caching, and privacy enforcement.

### Key Capabilities

- Define reusable aggregation scopes: CEL expression, area, area tag, spatial polygon/buffer, or explicit registrant IDs
- Resolve scopes to registrant sets with union and intersection operations
- Compute statistics (count, Gini) with extensible statistic registry supporting CEL variables
- Role-based access control with per-user scope type restrictions, dimension limits, and area constraints
- Result caching with configurable TTL per scope type and automatic cleanup
- Privacy enforcement via k-anonymity suppression on computed results
- Convenience methods for area-based, expression-based, fairness, and distribution queries

### Key Models

| Model | Type | Description |
| ---------------------------------- | -------- | ------------------------------------------------- |
| `spp.aggregation.scope` | Concrete | Configurable aggregation scope definitions |
| `spp.aggregation.access.rule` | Concrete | Per-user/group access control rules |
| `spp.aggregation.cache.entry` | Concrete | Persistent cache entries with TTL |
| `spp.aggregation.scope.resolver` | Abstract | Strategy-based scope resolution service |
| `spp.aggregation.cache` | Abstract | Cache service with TTL and cleanup |
| `spp.aggregation.statistic.registry` | Abstract | Statistic computation registry (builtins + CEL) |
| `spp.aggregation.service` | Abstract | Main aggregation entry point |

### Configuration

- Aggregation scopes: **Settings > Aggregation > Aggregation Scopes**
- Access rules: **Settings > Aggregation > Access Rules**
- Cache cleanup runs daily via scheduled action

### Security

| Group | Access |
| --------------------------------------- | ----------------------------------------- |
| `spp_aggregation.group_aggregation_read` | Read-only access to scopes and cache |
| `spp_aggregation.group_aggregation_write` | Read/write scopes and access rules |
| `spp_aggregation.group_aggregation_viewer` | Implied by write group |
| `spp_aggregation.group_aggregation_officer` | Implied by viewer group |
| `spp_aggregation.group_aggregation_manager` | Full access, implied by admin |

### Dependencies

`base`, `spp_cel_domain`, `spp_area`, `spp_registry`, `spp_security`, `spp_metrics_services`
Binary file added spp_aggregation/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions spp_aggregation/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
from . import test_scope_builder
from . import test_scope_resolver
from . import test_statistic_registry
from . import test_coverage
Loading
Loading