Skip to content

Commit 03e1d35

Browse files
jeremigonzalesedwin1123
authored andcommitted
refactor: rename Python files and classes to match new module names
Rename files, classes, and view strings to eliminate stale "aggregation" and "statistic" naming from the Python layer. spp_analytics: - aggregation_access.py -> analytics_access.py (AggregationAccessRule -> AnalyticsAccessRule) - aggregation_scope.py -> analytics_scope.py (AggregationScope -> AnalyticsScope) - statistic_registry.py -> indicator_registry.py (StatisticRegistry -> IndicatorRegistry) - AggregationService -> AnalyticsService, AggregationCacheService -> AnalyticsCacheService - AggregationTestCase -> AnalyticsTestCase - View XML files renamed accordingly spp_indicator: - statistic.py -> indicator.py, statistic_context.py -> indicator_context.py - statistic_categories.xml -> indicator_categories.xml - View strings: "Statistic(s)" -> "Indicator(s)" - Field label: string="Statistic" -> string="Indicator" spp_indicator_studio: - statistic_views.xml -> indicator_views.xml - statistic_category_views.xml -> indicator_category_views.xml spp_api_v2_simulation: - aggregation_api_service.py -> analytics_api_service.py - schemas/aggregation.py -> schemas/analytics.py - routers/aggregation.py -> routers/analytics.py - AggregationApiService -> AnalyticsApiService - AggregationScopeRequest -> AnalyticsScopeRequest - AggregationResponse -> AnalyticsResponse spp_api_v2_gis: - StatisticInfo -> IndicatorInfo - StatisticCategoryInfo -> IndicatorCategoryInfo - StatisticsListResponse -> IndicatorsListResponse
1 parent 2571b7d commit 03e1d35

40 files changed

+120
-120
lines changed

spp_analytics/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
# Data
2626
"data/cron_cache_cleanup.xml",
2727
# Views
28-
"views/aggregation_scope_views.xml",
29-
"views/aggregation_access_views.xml",
28+
"views/analytics_scope_views.xml",
29+
"views/analytics_access_views.xml",
3030
"views/menu.xml",
3131
],
3232
"assets": {},

spp_analytics/models/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Part of OpenSPP. See LICENSE file for full copyright and licensing details.
22

3-
from . import aggregation_scope
4-
from . import aggregation_access
3+
from . import analytics_scope
4+
from . import analytics_access
55
from . import service_scope_resolver
66
from . import service_cache
7-
from . import statistic_registry
7+
from . import indicator_registry
88
from . import service_aggregation

spp_analytics/models/aggregation_access.py renamed to spp_analytics/models/analytics_access.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
_logger = logging.getLogger(__name__)
88

99

10-
class AggregationAccessRule(models.Model):
10+
class AnalyticsAccessRule(models.Model):
1111
"""
1212
Access control rules for aggregation queries.
1313
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
_logger = logging.getLogger(__name__)
99

1010

11-
class AggregationScope(models.Model):
11+
class AnalyticsScope(models.Model):
1212
"""
1313
Unified targeting scope for aggregation queries.
1414

spp_analytics/models/statistic_registry.py renamed to spp_analytics/models/indicator_registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
_logger = logging.getLogger(__name__)
77

88

9-
class StatisticRegistry(models.AbstractModel):
9+
class IndicatorRegistry(models.AbstractModel):
1010
"""Registry that maps statistic names to computation strategies.
1111
1212
Replaces the fallback chain in compute_single_statistic with

spp_analytics/models/service_aggregation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
_logger = logging.getLogger(__name__)
99

1010

11-
class AggregationService(models.AbstractModel):
11+
class AnalyticsService(models.AbstractModel):
1212
"""
1313
Main aggregation service for unified statistics computation.
1414
@@ -36,7 +36,7 @@ def compute_aggregation(
3636
"""
3737
Compute aggregation for a scope with optional breakdown.
3838
39-
Access level is determined from user permissions (AggregationAccessRule),
39+
Access level is determined from user permissions (AnalyticsAccessRule),
4040
NOT passed as a parameter. This prevents callers bypassing restrictions.
4141
4242
:param scope: spp.analytics.scope record, ID, or inline dict definition

spp_analytics/models/service_cache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
_logger = logging.getLogger(__name__)
1010

1111

12-
class AggregationCacheService(models.AbstractModel):
12+
class AnalyticsCacheService(models.AbstractModel):
1313
"""
1414
Cache service for aggregation results.
1515
@@ -369,7 +369,7 @@ def _resolve_scope(self, scope):
369369
return scope
370370

371371

372-
class AggregationCacheEntry(models.Model):
372+
class AnalyticsCacheEntry(models.Model):
373373
"""
374374
Cache entry for aggregation results.
375375

spp_analytics/tests/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
from . import common
44
from . import test_access_rule_area_restrictions
5-
from . import test_aggregation_scope
6-
from . import test_aggregation_service
5+
from . import test_analytics_scope
6+
from . import test_analytics_service
77
from . import test_cache_service
88
from . import test_distribution_service
99
from . import test_fairness_service
1010
from . import test_integration_demo
1111
from . import test_privacy_enforcement
1212
from . import test_scope_builder
1313
from . import test_scope_resolver
14-
from . import test_statistic_registry
14+
from . import test_indicator_registry
1515
from . import test_coverage

spp_analytics/tests/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from odoo.tests.common import TransactionCase
33

44

5-
class AggregationTestCase(TransactionCase):
5+
class AnalyticsTestCase(TransactionCase):
66
"""Base test case for aggregation module tests."""
77

88
@classmethod

spp_analytics/tests/test_aggregation_scope.py renamed to spp_analytics/tests/test_analytics_scope.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Part of OpenSPP. See LICENSE file for full copyright and licensing details.
22
from odoo.exceptions import ValidationError
33

4-
from .common import AggregationTestCase
4+
from .common import AnalyticsTestCase
55

66

7-
class TestAggregationScope(AggregationTestCase):
7+
class TestAnalyticsScope(AnalyticsTestCase):
88
"""Tests for spp.analytics.scope model."""
99

1010
def test_create_cel_scope(self):

0 commit comments

Comments
 (0)