# -*- coding: utf-8 -*-
# hub/ticket/services/mock_service.py

"""Offline transport-сервис Ticket."""

from __future__ import annotations

from PySide6.QtCore import QObject

from domain import TicketConnectionStatus
from .base_service import BaseService


class MockService(BaseService):
    """Безопасный offline-режим при недоступном COM-порте."""

    def __init__(self, parent: QObject | None = None):
        super().__init__(parent)
        self._running = False

    def start(self) -> None:
        self._running = True
        self._set_connection_status(
            TicketConnectionStatus.DISCONNECTED,
            "Оффлайн-режим",
        )
        self._set_button_initialization(False, 0)

    def stop(self) -> None:
        self._running = False

    def is_running(self) -> bool:
        return self._running
