"""Sales-module test fixtures.

Overrides the top-level `test_account` fixture (tests/conftest.py) to
default to the `professional` plan for every test under tests/apps/sales/.

INDL-59 gates the entire `/api/v1/sales/*` router behind
`require_feature("sales")`, which is false for `starter`. The shared
`test_account` fixture defaults to `starter` for modules that don't care
about plan, so sales tests need their own tenant on a plan that actually
has the Sales feature — this override keeps every existing sales test
working against a tenant that can reach the router at all, without
touching the global fixture used by unrelated modules.
"""
import pytest_asyncio
from sqlalchemy.ext.asyncio import AsyncSession


@pytest_asyncio.fixture
async def test_account(db_session: AsyncSession):
    from src.apps.tenants.models.account import Account

    account = Account(
        organization_name="Test Cemetery",
        subdomain="testcemetery",
        contact_email="admin@testcemetery.com",
        plan="professional",
        status="active",
    )
    db_session.add(account)
    await db_session.flush()
    return account
