Commit f75a2a77 authored by George Papathanail's avatar George Papathanail
Browse files

feat: wire AppDeploymentRepository through the DI chain

parent c74770e2
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@ from open_exposure_gateway.adapters.database.repos.callback_deliveries import (
from open_exposure_gateway.adapters.database.repos.callback_registrations import (
    SqlCallbackRegistrationRepository,
)
from open_exposure_gateway.adapters.database.repos.deployments import (
    SqlAppDeploymentRepository,
)
from open_exposure_gateway.adapters.database.repos.operations import (
    SqlOperationRepository,
)
@@ -41,6 +44,7 @@ from open_exposure_gateway.ports.database.callbacks import (
    CallbackDeliveryRepository,
    CallbackRegistrationRepository,
)
from open_exposure_gateway.ports.database.deployments import AppDeploymentRepository
from open_exposure_gateway.ports.database.instances import AppInstanceRepository
from open_exposure_gateway.ports.database.operations import OperationRepository
from open_exposure_gateway.ports.database.qod_sessions import QodSessionRepository
@@ -124,6 +128,10 @@ def get_app_instance_repo(session: SessionDep) -> AppInstanceRepository:
    return SqlAppInstanceRepository(session)


def get_app_deployment_repo(session: SessionDep) -> AppDeploymentRepository:
    return SqlAppDeploymentRepository(session)


def get_callback_registration_repo(session: SessionDep) -> CallbackRegistrationRepository:
    return SqlCallbackRegistrationRepository(session)

@@ -149,6 +157,7 @@ def get_edge_app_service(
    callback_registration_repo: CallbackRegistrationRepository = Depends(
        get_callback_registration_repo
    ),
    app_deployment_repo: AppDeploymentRepository = Depends(get_app_deployment_repo),
) -> EdgeApplicationManagementService:
    return EdgeApplicationManagementService(
        srm,
@@ -157,6 +166,7 @@ def get_edge_app_service(
        operation_repo,
        app_instance_repo,
        callback_registration_repo,
        app_deployment_repo=app_deployment_repo,
    )


+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ from open_exposure_gateway.domain.edge_application_management import (
)
from tests.conformance.harness import app
from tests.unit.fakes import (
    FakeAppDeploymentRepository,
    FakeAppInstanceRepository,
    FakeAppRegistrationRepository,
    FakeCallbackDeliveryRepository,
@@ -64,6 +65,7 @@ def service_overrides() -> Generator[None, None, None]:
    )
    operation_repo = FakeOperationRepository()
    app_instance_repo = FakeAppInstanceRepository()
    app_deployment_repo = FakeAppDeploymentRepository()
    wire_operation_consumer(bus, operation_repo, app_instance_repo)
    wire_srm_worker(bus, srm)
    app.dependency_overrides[get_edge_app_service] = lambda: EdgeApplicationManagementService(
@@ -73,6 +75,7 @@ def service_overrides() -> Generator[None, None, None]:
        operation_repo=operation_repo,
        app_instance_repo=app_instance_repo,
        callback_registration_repo=FakeCallbackRegistrationRepository(),
        app_deployment_repo=app_deployment_repo,
    )

    qod_operation_repo = FakeOperationRepository()