import datetime

from django.utils.translation import gettext_lazy as _


class FileFieldConstants:
    """
    This class defines constants related to file formats.

    Attributes:
        FILE_SIZE (int): The maximum allowed file size (5 MB).
        IMAGE_FORMATS (list): Supported image formats.
        DOCUMENT_FORMATS (list): Supported document formats.
        VIDEO_FORMATS (list): Supported video formats.
        AUDIO_FORMATS (list): Supported audio formats.
    """

    FILE_SIZE = 15 * 1024 * 1024
    IMAGE_FORMATS = ["png", "jpg", "jpeg", "webp"]
    DOCUMENT_FORMATS = ["doc", "docx", "pdf", "xlsx", "xls"]
    VIDEO_FORMATS = ["mp4"]
    AUDIO_FORMATS = ["mp3", "aac", "wav"]


class AssetTypeConstants:
    """
    This class defines constants for asset types and their choices.

    Attributes:
        VIDEO (int): Asset type for videos.
        IMAGE (int): Asset type for images.
        AUDIO (int): Asset type for audio.

    Methods:
        get_asset_choices(): Get choices for asset types as a list of tuples.
    """

    VIDEO, IMAGE, AUDIO = (1, 2, 3)

    @classmethod
    def get_asset_choices(cls):
        """
        Get choices for asset types.

        Returns:
            list: A list of tuples containing asset type choices and their corresponding labels.
        """
        choices = [
            (cls.VIDEO, _("Video")),
            (cls.IMAGE, _("Image")),
            (cls.AUDIO, _("Audio")),
        ]
        return choices


class StationConstants:
    """
    This class defines constants for owner types and their choices.

    Attributes:
        USER (int): User type for Station.
        OWNER (int): User type for Station.

    Methods:
        get_asset_choices(): Get choices for owner types as a list of tuples.
    """

    (USER, OWNER) = (1, 2)
    (PENDING, CLOSE) = (1, 2)

    @classmethod
    def get_choices(cls):
        """
        Get choices for types.

        Returns:
            list: A list of tuples containing owner type choices and their corresponding labels.
        """
        choices = [
            (cls.USER, _("User")),
            (cls.OWNER, _("Owner")),
        ]
        return choices

    @classmethod
    def get_suggest_station_request_status(cls):
        """
        Get choices for Status.

        Returns:
            list: A list of tuples containing Suggest Station Status choices and their corresponding labels.
        """
        return [
            (cls.PENDING, _("Pending")),
            (cls.CLOSE, _("Close")),
        ]


class VehicleManufacturingYear:
    """
    This class defines constants for owner types and their choices.

    Methods:
        get_choices(): Get choices for ManufacturingYear as a list of tuples.
    """

    @classmethod
    def get_choices(cls):
        """
        Get choices for types.

        Returns:
            list: A list of tuples containing year choices and their corresponding labels.
        """
        today = datetime.date.today()
        return [(r, r) for r in range(1984, today.year + 1)]
