from enum import Enum
from typing import Literal, Optional

from asaaspy.schemas.base import BaseSchema


class BankAccountViewSchema(BaseSchema):
    agency: str
    account: str
    accountDigit: str


class BankBalanceViewSchema(BaseSchema):
    balance: float


class TransactionItemViewSchema(BaseSchema):
    object: str
    id: str
    value: float
    balance: float
    date: str
    description: str
    paymentId: str
    splitId: Optional[str] = None
    transferId: Optional[str] = None
    anticipationId: Optional[str] = None
    billId: Optional[str] = None
    invoiceId: Optional[str] = None
    paymentDunningId: Optional[str] = None
    creditBureauReportId: Optional[str] = None
    type: Literal[
        "PAYMENT_RECEIVED",
        "TRANSFER",
        "TRANSFER_FEE",
        "TRANSFER_REVERSAL",
        "REVERSAL",
        "PAYMENT_REVERSAL",
        "PAYMENT_REFUND_CANCELLED",
        "PAYMENT_FEE",
        "PAYMENT_FEE_REVERSAL",
        "PAYMENT_CUSTODY_BLOCK",
        "PAYMENT_CUSTODY_BLOCK_REVERSAL",
        "PHONE_CALL_NOTIFICATION_FEE",
        "PROMOTIONAL_CODE_CREDIT",
        "DEBIT",
        "DEBIT_REVERSAL",
        "DEBT_RECOVERY_NEGOTIATION_FINANCIAL_CHARGES",
        "RECEIVABLE_ANTICIPATION_GROSS_CREDIT",
        "RECEIVABLE_ANTICIPATION_FEE",
        "RECEIVABLE_ANTICIPATION_DEBIT",
        "RECEIVABLE_ANTICIPATION_PARTNER_SETTLEMENT",
        "BILL_PAYMENT",
        "BILL_PAYMENT_FEE",
        "BILL_PAYMENT_CANCELLED",
        "BILL_PAYMENT_FEE_CANCELLED",
        "BILL_PAYMENT_REFUNDED",
        "POSTAL_SERVICE_FEE",
        "INTERNAL_TRANSFER_DEBIT",
        "INTERNAL_TRANSFER_CREDIT",
        "INTERNAL_TRANSFER_REVERSAL",
        "CREDIT",
        "PARTIAL_PAYMENT",
        "PAYMENT_MESSAGING_NOTIFICATION_FEE",
        "PAYMENT_SMS_NOTIFICATION_FEE",
        "PAYMENT_DUNNING_REQUEST_FEE",
        "PAYMENT_DUNNING_RECEIVED_FEE",
        "PAYMENT_DUNNING_RECEIVED_IN_CASH_FEE",
        "PAYMENT_DUNNING_CANCELLATION_FEE",
        "CUSTOMER_COMMISSION_SETTLEMENT_CREDIT",
        "CUSTOMER_COMMISSION_SETTLEMENT_DEBIT",
        "PROMOTIONAL_CODE_DEBIT",
        "REFUND_REQUEST_FEE",
        "REFUND_REQUEST_CANCELLED",
        "REFUND_REQUEST_FEE_REVERSAL",
        "INVOICE_FEE",
        "PRODUCT_INVOICE_FEE",
        "CONSUMER_INVOICE_FEE",
        "ASAAS_CARD_RECHARGE",
        "ASAAS_CARD_RECHARGE_REVERSAL",
        "ASAAS_CARD_BALANCE_REFUND",
        "CHARGEBACK",
        "CHARGEBACK_REVERSAL",
        "ASAAS_CARD_BILL_PAYMENT",
        "ASAAS_CARD_BILL_PAYMENT_REFUND",
        "ASAAS_CARD_TRANSACTION",
        "ASAAS_CARD_CASHBACK",
        "ASAAS_CARD_CREDIT_VOUCHER",
        "ASAAS_CARD_CREDIT_VOUCHER_REFUND",
        "ASAAS_CARD_TRANSACTION_FEE",
        "ASAAS_CARD_TRANSACTION_REFUND",
        "ASAAS_CARD_TRANSACTION_FEE_REFUND",
        "ASAAS_CARD_TRANSACTION_PARTIAL_REFUND",
        "ASAAS_CARD_TRANSACTION_REFUND_CANCELLATION",
        "ASAAS_CARD_TRANSACTION_PARTIAL_REFUND_CANCELLATION",
        "ASAAS_MONEY_PAYMENT_COMPROMISED_BALANCE",
        "ASAAS_MONEY_PAYMENT_COMPROMISED_BALANCE_REFUND",
        "ASAAS_MONEY_PAYMENT_ANTICIPATION_FEE",
        "ASAAS_MONEY_PAYMENT_ANTICIPATION_FEE_REFUND",
        "ASAAS_MONEY_PAYMENT_FINANCING_FEE",
        "ASAAS_MONEY_PAYMENT_FINANCING_FEE_REFUND",
        "ASAAS_MONEY_TRANSACTION_CASHBACK",
        "ASAAS_MONEY_TRANSACTION_CASHBACK_REFUND",
        "ASAAS_MONEY_TRANSACTION_CHARGEBACK",
        "ASAAS_MONEY_TRANSACTION_CHARGEBACK_REVERSAL",
        "CHARGED_FEE_REFUND",
        "PIX_TRANSACTION_DEBIT",
        "PIX_TRANSACTION_DEBIT_REFUND",
        "PIX_TRANSACTION_CREDIT",
        "PIX_TRANSACTION_CREDIT_FEE",
        "PIX_TRANSACTION_CREDIT_REFUND",
        "PIX_TRANSACTION_CREDIT_REFUND_CANCELLATION",
        "PIX_TRANSACTION_DEBIT_FEE",
        "CREDIT_BUREAU_REPORT",
        "CONTRACTUAL_EFFECT_SETTLEMENT",
        "CONTRACTUAL_EFFECT_SETTLEMENT_REVERSAL",
        "FREE_PAYMENT_USE",
        "MOBILE_PHONE_RECHARGE",
        "REFUND_MOBILE_PHONE_RECHARGE",
        "CANCEL_MOBILE_PHONE_RECHARGE",
        "BACEN_JUDICIAL_LOCK",
        "BACEN_JUDICIAL_UNLOCK",
        "BACEN_JUDICIAL_TRANSFER",
        "INSTANT_TEXT_MESSAGE_FEE",
        "ASAAS_DEBIT_CARD_REQUEST_FEE",
        "ASAAS_PREPAID_CARD_REQUEST_FEE",
        "EXTERNAL_SETTLEMENT_CONTRACTUAL_EFFECT_BATCH_CREDIT",
        "EXTERNAL_SETTLEMENT_CONTRACTUAL_EFFECT_BATCH_REVERSAL",
        "CHILD_ACCOUNT_KNOWN_YOUR_CUSTOMER_BATCH_FEE",
        "CONTRACTED_CUSTOMER_PLAN_FEE",
        "ACCOUNT_INACTIVITY_FEE",
        "PAYMENT_ORIGIN_CHANNEL_FEE",
        "PAYMENT_SPLIT_DIVERGENCE_BLOCK",
        "PAYMENT_SPLIT_DIVERGENCE_BLOCK_REVERSAL",
        "RECEIVABLE_ANTICIPATION_PAYMENT_FEE",
        "ASAAS_MONEY_DONATION_DEBIT",
        "ASAAS_MONEY_DONATION_DEBIT_REFUND",
        "ASAAS_MONEY_PAYMENT_DEBIT",
        "ASAAS_MONEY_PAYMENT_DEBIT_REFUND",
        "CUSTOMER_COMMISSION_CHECKOUT",
        "RECEIVABLE_ANTICIPATION_CREDIT",
    ]


class StatusEnum(Enum):
    PENDING = "PENDING"
    APPROVED = "APPROVED"
    REJECTED = "REJECTED"
    AWAITING_APPROVAL = "AWAITING_APPROVAL"


class AccountStatusViewSchema(BaseSchema):
    id: str
    commercialInfo: StatusEnum
    bankAccountInfo: StatusEnum
    documentation: StatusEnum
    general: StatusEnum
