from fortytwo.parameter import Sort, SortDirection


class SlotSort:
    """
    Sort class specifically for slot resources with all supported 42 API sort fields.
    """

    @staticmethod
    def by_id(direction: SortDirection = SortDirection.DESCENDING) -> Sort:
        """
        Sort by ID (default descending).

        Args:
            direction (SortDirection): Sort direction.
        """
        return Sort([("id", direction)])

    @staticmethod
    def by_begin_at(direction: SortDirection = SortDirection.DESCENDING) -> Sort:
        """
        Sort by begin date.

        Args:
            direction (SortDirection): Sort direction.
        """
        return Sort([("begin_at", direction)])

    @staticmethod
    def by_end_at(direction: SortDirection = SortDirection.DESCENDING) -> Sort:
        """
        Sort by end date.

        Args:
            direction (SortDirection): Sort direction.
        """
        return Sort([("end_at", direction)])

    @staticmethod
    def by_user_id(direction: SortDirection = SortDirection.ASCENDING) -> Sort:
        """
        Sort by user ID.

        Args:
            direction (SortDirection): Sort direction.
        """
        return Sort([("user_id", direction)])

    @staticmethod
    def by_created_at(direction: SortDirection = SortDirection.DESCENDING) -> Sort:
        """
        Sort by created date.

        Args:
            direction (SortDirection): Sort direction.
        """
        return Sort([("created_at", direction)])

    @staticmethod
    def by_scale_team_id(direction: SortDirection = SortDirection.ASCENDING) -> Sort:
        """
        Sort by scale team ID.

        Args:
            direction (SortDirection): Sort direction.
        """
        return Sort([("scale_team_id", direction)])
