# pyright: reportCallIssue=false

from __future__ import annotations

from behave import when

from Ticket.testdata.ticket_test_data import TicketTestData


@when("create place multiple for ticket")  # pyright: ignore[reportGeneralTypeIssues]
def step_create_place_multiple(context) -> None:
    td = TicketTestData.from_behave_context(context)
    td.ensure_place()
    context.ticket_place_id = td.place_id


@when("create ticket category for created place")  # pyright: ignore[reportGeneralTypeIssues]
def step_create_ticket_category_for_place(context) -> None:
    td = TicketTestData.from_behave_context(context)
    td.ensure_ticket_category()
    context.ticket_category_id = td.category_id


@when("create ticket for created place and category")  # pyright: ignore[reportGeneralTypeIssues]
def step_create_ticket(context) -> None:
    td = TicketTestData.from_behave_context(context)
    td.ensure_ticket()
    context.ticket_id = td.ticket_id

