# This file was generated by liblab | https://liblab.com/

from enum import Enum
from .utils.json_map import JsonMap
from .base import BaseModel


@JsonMap({})
class LastCycle(BaseModel):
    """The last payment cycle.

    :param start: Long date-time format following ISO-8601, defaults to None
    :type start: str, optional
    :param end: Long date-time format following ISO-8601, defaults to None
    :type end: str, optional
    :param completion_date: Long date-time format following ISO-8601, defaults to None
    :type completion_date: str, optional
    """

    def __init__(self, start: str = None, end: str = None, completion_date: str = None):
        if start is not None:
            self.start = start
        if end is not None:
            self.end = end
        if completion_date is not None:
            self.completion_date = completion_date


class FinalPaymentCalculatedCalculationType(Enum):
    """An enumeration representing different categories.

    :cvar CUSTOM_AMOUNT: "CUSTOM_AMOUNT"
    :vartype CUSTOM_AMOUNT: str
    :cvar WORK_DAYS: "WORK_DAYS"
    :vartype WORK_DAYS: str
    :cvar CALENDAR_DAYS: "CALENDAR_DAYS"
    :vartype CALENDAR_DAYS: str
    :cvar FULL_AMOUNT: "FULL_AMOUNT"
    :vartype FULL_AMOUNT: str
    """

    CUSTOM_AMOUNT = "CUSTOM_AMOUNT"
    WORK_DAYS = "WORK_DAYS"
    CALENDAR_DAYS = "CALENDAR_DAYS"
    FULL_AMOUNT = "FULL_AMOUNT"

    def list():
        """Lists all category values.

        :return: A list of all category values.
        :rtype: list
        """
        return list(
            map(
                lambda x: x.value,
                FinalPaymentCalculatedCalculationType._member_map_.values(),
            )
        )


@JsonMap({})
class FinalPaymentCalculated(BaseModel):
    """FinalPaymentCalculated

    :param daily_rate: The daily rate paid.
    :type daily_rate: str
    :param total: Total amount to pay.
    :type total: str
    :param remaining_days: Dais remaining to end the contract.
    :type remaining_days: str
    :param last_cycle: The last payment cycle.
    :type last_cycle: LastCycle
    :param calculation_type: Either works days or calendar days
    :type calculation_type: FinalPaymentCalculatedCalculationType
    :param workweek_start: The day the work week starts, 0 to 6
    :type workweek_start: float
    :param workweek_end: The day the work week starts, 0 to 6
    :type workweek_end: float
    """

    def __init__(
        self,
        daily_rate: str,
        total: str,
        remaining_days: str,
        last_cycle: LastCycle,
        calculation_type: FinalPaymentCalculatedCalculationType,
        workweek_start: float,
        workweek_end: float,
    ):
        self.daily_rate = daily_rate
        self.total = total
        self.remaining_days = remaining_days
        self.last_cycle = self._define_object(last_cycle, LastCycle)
        self.calculation_type = self._enum_matching(
            calculation_type,
            FinalPaymentCalculatedCalculationType.list(),
            "calculation_type",
        )
        self.workweek_start = workweek_start
        self.workweek_end = workweek_end
