diff --git a/pyproject.toml b/pyproject.toml index dddb585..aa5a892 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "delta-barth" -version = "0.2.1" +version = "0.2.2" description = "prognosis module" authors = [ {name = "Florian Förster", email = "f.foerster@d-opt.com"}, diff --git a/src/delta_barth/pipelines.py b/src/delta_barth/pipelines.py index aef60ba..40f599e 100644 --- a/src/delta_barth/pipelines.py +++ b/src/delta_barth/pipelines.py @@ -4,7 +4,7 @@ from datetime import datetime as Datetime from delta_barth.analysis import forecast from delta_barth.management import SESSION -from delta_barth.types import JsonResponse, JsonStatus +from delta_barth.types import JsonExportResponse, JsonResponse, JsonStatus def pipeline_sales_forecast( @@ -21,13 +21,14 @@ def pipeline_sales_forecast( def pipeline_sales_forecast_dummy( company_id: int | None, start_date: Datetime | None, -) -> tuple[JsonResponse, JsonStatus]: +) -> JsonExportResponse: result = forecast.pipeline_sales_dummy( SESSION, company_id=company_id, start_date=start_date, ) - response = JsonResponse(result.response.model_dump_json()) - status = JsonStatus(result.status.model_dump_json()) + export = JsonExportResponse(result.model_dump_json()) + # response = JsonResponse(result.response.model_dump_json()) + # status = JsonStatus(result.status.model_dump_json()) - return response, status + return export diff --git a/src/delta_barth/types.py b/src/delta_barth/types.py index 65397df..d6652fc 100644 --- a/src/delta_barth/types.py +++ b/src/delta_barth/types.py @@ -76,6 +76,7 @@ class PipeResult(t.Generic[R]): self.results = response +JsonExportResponse = t.NewType("JsonExportResponse", str) JsonResponse = t.NewType("JsonResponse", str) JsonStatus = t.NewType("JsonStatus", str)