import uuid

import pytest
from src.__types.index import Client, ClientTenant, Distribution, PendingClientTenant, Tenant, User


@pytest.fixture
def mock_tenant() -> Tenant:
    return Tenant(
        id=uuid.uuid4(),
        legal_name="dummy_tenant",
        name="dummy_tenant_name",
        m2m_application_client_id="app-client-id",
        whi_customer_id=None,
        cydas_customer_id=None,
        allowed_m2m_metadata=[
            {"callerService": "ctm", "tenantName": "test_tenant1"},
            {"callerService": "ctm", "tenantName": "test_tenant2"},
        ],
    )


@pytest.fixture
def mock_client() -> Client:
    return Client(id=uuid.uuid4(), name="dummy_service", stage="test")


@pytest.fixture
def mock_pending_client_tenant(mock_client: Client) -> PendingClientTenant:
    return PendingClientTenant(
        client_id=mock_client.id,
        name="dummy_pending_client_tenant",
        distribution=Distribution.WHI_SFDC,
        customer_id="whi#dummy",
    )


@pytest.fixture
def mock_client_tenant(mock_tenant: Tenant) -> ClientTenant:
    return ClientTenant(
        id=uuid.uuid4(),
        tenant_id=mock_tenant.id,
        name="dummy_client_tenant",
        distribution=Distribution.WHI_SFDC,
        customer_id="whi#dummy",
    )


@pytest.fixture
def mock_user() -> User:
    return User(
        id=uuid.uuid4(),
        display_id="dummy_display_id",
        display_name="dummy_user",
        email="dummy_user@example.com",
    )
