refactor(reporting): reuse exact principal projection contract
Release v0.1.22. Coordinated integrity review: GovOPlaN/govoplan-core#298.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@govoplan/reporting-webui",
|
"name": "@govoplan/reporting-webui",
|
||||||
"version": "0.1.21",
|
"version": "0.1.22",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "webui/src/index.ts",
|
"main": "webui/src/index.ts",
|
||||||
|
|||||||
+2
-2
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
|
|||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "govoplan-reporting"
|
name = "govoplan-reporting"
|
||||||
version = "0.1.21"
|
version = "0.1.22"
|
||||||
description = "GovOPlaN governed reporting and semantic BI module."
|
description = "GovOPlaN governed reporting and semantic BI module."
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.12"
|
requires-python = ">=3.12"
|
||||||
license = { text = "AGPL-3.0-or-later" }
|
license = { text = "AGPL-3.0-or-later" }
|
||||||
authors = [{ name = "GovOPlaN" }]
|
authors = [{ name = "GovOPlaN" }]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"govoplan-core>=0.1.45",
|
"govoplan-core>=0.1.46",
|
||||||
"govoplan-access>=0.1.18",
|
"govoplan-access>=0.1.18",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
"""GovOPlaN Reporting module."""
|
"""GovOPlaN Reporting module."""
|
||||||
|
|
||||||
__version__ = "0.1.21"
|
__version__ = "0.1.22"
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import uuid
|
|||||||
from sqlalchemy import and_, exists, func, or_
|
from sqlalchemy import and_, exists, func, or_
|
||||||
from sqlalchemy.orm import Query, Session
|
from sqlalchemy.orm import Query, Session
|
||||||
|
|
||||||
|
from govoplan_core.core.principal_helpers import principal_actor_ids as _actor_ids
|
||||||
from govoplan_core.core.events import (
|
from govoplan_core.core.events import (
|
||||||
EventActorRef,
|
EventActorRef,
|
||||||
EventObjectRef,
|
EventObjectRef,
|
||||||
@@ -884,22 +885,6 @@ def _actor(principal: object) -> str | None:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def _actor_ids(principal: object) -> tuple[str, ...]:
|
|
||||||
user = getattr(principal, "user", None)
|
|
||||||
return tuple(
|
|
||||||
dict.fromkeys(
|
|
||||||
str(value)
|
|
||||||
for value in (
|
|
||||||
getattr(principal, "account_id", None),
|
|
||||||
getattr(principal, "identity_id", None),
|
|
||||||
getattr(principal, "membership_id", None),
|
|
||||||
getattr(user, "id", None),
|
|
||||||
)
|
|
||||||
if str(value or "").strip()
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def _principal_tenant(principal: object) -> str:
|
def _principal_tenant(principal: object) -> str:
|
||||||
tenant_id = str(getattr(principal, "tenant_id", "") or "").strip()
|
tenant_id = str(getattr(principal, "tenant_id", "") or "").strip()
|
||||||
if not tenant_id:
|
if not tenant_id:
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ from govoplan_reporting.backend.search_source import create_reporting_search_sou
|
|||||||
|
|
||||||
MODULE_ID = "reporting"
|
MODULE_ID = "reporting"
|
||||||
MODULE_NAME = "Reporting"
|
MODULE_NAME = "Reporting"
|
||||||
MODULE_VERSION = "0.1.21"
|
MODULE_VERSION = "0.1.22"
|
||||||
|
|
||||||
|
|
||||||
def _permission(scope: str, label: str, description: str) -> PermissionDefinition:
|
def _permission(scope: str, label: str, description: str) -> PermissionDefinition:
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class _Provider:
|
|||||||
del session
|
del session
|
||||||
return ReportProviderResult(
|
return ReportProviderResult(
|
||||||
report_id=request.report_id,
|
report_id=request.report_id,
|
||||||
generated_at=datetime(2026, 8, 2, 10, 0, tzinfo=UTC),
|
generated_at=datetime.now(UTC),
|
||||||
payload={"metric": 12},
|
payload={"metric": 12},
|
||||||
source_revisions=(
|
source_revisions=(
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@govoplan/reporting-webui",
|
"name": "@govoplan/reporting-webui",
|
||||||
"version": "0.1.21",
|
"version": "0.1.22",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user