17 lines
517 B
Python
17 lines
517 B
Python
|
|
from typing import Any, Protocol
|
||
|
|
|
||
|
|
from config import DATA_SOURCE
|
||
|
|
from services.planner_service import PlannerService
|
||
|
|
from services.powerautomate_bridge import PowerAutomateBridge
|
||
|
|
|
||
|
|
|
||
|
|
class DataService(Protocol):
|
||
|
|
def get_all_projects(self, group_ids: list[str] | None = None) -> list[dict[str, Any]]: ...
|
||
|
|
|
||
|
|
|
||
|
|
def create_data_service() -> DataService:
|
||
|
|
"""Crea el servicio de datos segun DATA_SOURCE en .env."""
|
||
|
|
if DATA_SOURCE == "powerautomate":
|
||
|
|
return PowerAutomateBridge()
|
||
|
|
return PlannerService()
|