from typing import Optional

from api_validations.core_validations import BaseModelRegular


class ListOptionsValidation:
    tr = {
        "page": "Sayfa",
        "size": "Boyut",
        "order_field": "Sıralama Alanı",
        "order_type": "Sıralama Türü",
        "include_joins": "Alt İçerikleri",
        "query": "Sorgu",
    }
    en = {
        "page": "Page",
        "size": "Size",
        "order_field": "Order Field",
        "order_type": "Order Type",
        "include_joins": "Include Joins",
        "query": "Query",
    }


class ListOptions(BaseModelRegular, ListOptionsValidation):
    page: Optional[int] = 1
    size: Optional[int] = 10
    order_field: Optional[str] = "id"
    order_type: Optional[str] = "asc"
    include_joins: Optional[list] = []
    query: Optional[dict] = {}


class CrudRecordValidation:
    tr = {
        "uu_id": "UUID",
        "created_at": "Oluşturulma Tarihi",
        "updated_at": "Güncellenme Tarihi",
        "created_by": "Oluşturan",
        "updated_by": "Güncelleyen",
        "confirmed_by": "Onaylayan",
        "is_confirmed": "Onay",
        "expiry_starts": "Geçerlilik Başlangıç Tarihi",
        "expiry_ends": "Geçerlilik Bitiş Tarihi",
        "active": "Aktif",
        "is_notification_send": "Bildirim Gönderildi",
        "is_email_send": "E-posta Gönderildi",
    }
    en = {
        "uu_id": "UUID",
        "created_at": "Created At",
        "updated_at": "Updated At",
        "created_by": "Created By",
        "updated_by": "Updated By",
        "confirmed_by": "Confirmed By",
        "is_confirmed": "Confirmed",
        "expiry_starts": "Expiry Starts",
        "expiry_ends": "Expiry Ends",
        "active": "Active",
        "is_notification_send": "Notification Send",
        "is_email_send": "Email Send",
    }

class CrudRecords:
    uu_id: Optional[str] = None
    created_at: Optional[str] = None
    updated_at: Optional[str] = None
    created_by: Optional[str] = None
    updated_by: Optional[str] = None
    confirmed_by: Optional[str] = None
    is_confirmed: Optional[bool] = None
    active: Optional[bool] = None
    is_notification_send: Optional[bool] = None
    is_email_send: Optional[bool] = None


class PydanticBaseModelValidation:
    tr = {
        "active": "Aktif",
        "deleted": "Silinmiş",
        "expiry_starts": "Geçerlilik Başlangıç Tarihi",
        "expiry_ends": "Geçerlilik Bitiş Tarihi",
        "is_confirmed": "Onay",
    }
    en = {
        "active": "Active",
        "deleted": "Deleted",
        "expiry_starts": "Expiry Starts",
        "expiry_ends": "Expiry Ends",
        "is_confirmed": "Confirmed",
    }


class PydanticBaseModel(BaseModelRegular):

    active: Optional[bool] = None
    deleted: Optional[bool] = None
    expiry_starts: Optional[str] = None
    expiry_ends: Optional[str] = None
    is_confirmed: Optional[bool] = None


class EndpointPydantic(BaseModelRegular):
    data: Optional[dict] = {}


class EndpointValidation(BaseModelRegular):
    endpoint: Optional[str] = None


class PatchRecord(BaseModelRegular):

    confirm: Optional[bool] = None
    delete: Optional[bool] = None
    active: Optional[bool] = None
