"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from .amountdecimal import AmountDecimal, AmountDecimalTypedDict
from moovio_sdk.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class AccountFeesTypedDict(TypedDict):
    r"""A detailed breakdown of account fees."""

    wallet_fee: AmountDecimalTypedDict
    r"""Fees associated with wallet services."""
    merchant_pci_fee: AmountDecimalTypedDict
    r"""Fees for PCI compliance."""
    invoice_payment_fee: AmountDecimalTypedDict
    r"""Fees for invoice payments."""
    total: AmountDecimalTypedDict
    r"""Total platform fees."""
    kyb_fee: NotRequired[AmountDecimalTypedDict]
    r"""Fees for business verification."""
    kyc_fee: NotRequired[AmountDecimalTypedDict]
    r"""Fees for customer verification."""
    transaction_monitoring_fee: NotRequired[AmountDecimalTypedDict]
    r"""Fees for transaction risk monitoring."""


class AccountFees(BaseModel):
    r"""A detailed breakdown of account fees."""

    wallet_fee: Annotated[AmountDecimal, pydantic.Field(alias="walletFee")]
    r"""Fees associated with wallet services."""

    merchant_pci_fee: Annotated[AmountDecimal, pydantic.Field(alias="merchantPCIFee")]
    r"""Fees for PCI compliance."""

    invoice_payment_fee: Annotated[
        AmountDecimal, pydantic.Field(alias="invoicePaymentFee")
    ]
    r"""Fees for invoice payments."""

    total: AmountDecimal
    r"""Total platform fees."""

    kyb_fee: Annotated[Optional[AmountDecimal], pydantic.Field(alias="kybFee")] = None
    r"""Fees for business verification."""

    kyc_fee: Annotated[Optional[AmountDecimal], pydantic.Field(alias="kycFee")] = None
    r"""Fees for customer verification."""

    transaction_monitoring_fee: Annotated[
        Optional[AmountDecimal], pydantic.Field(alias="transactionMonitoringFee")
    ] = None
    r"""Fees for transaction risk monitoring."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["kybFee", "kycFee", "transactionMonitoringFee"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


try:
    AccountFees.model_rebuild()
except NameError:
    pass
