from pydantic import BaseModel
from typing import Optional, List


class PaymentMethodSubRow(BaseModel):
    brand: str
    payment_count: int
    refund_count: int
    payment_amount: float
    refund_amount: float
    fees: float
    net_settlement: float


class PaymentMethodRow(BaseModel):
    method: str
    payment_count: int
    refund_count: int
    payment_amount: float
    refund_amount: float
    fees: float
    net_settlement: float
    sub_rows: List[PaymentMethodSubRow]


class PaymentMethodReportResponse(BaseModel):
    rows: List[PaymentMethodRow]
    total_payment_amount: float
    total_refund_amount: float
    total_net_settlement: float


class PaymentMethodSummaryItem(BaseModel):
    method: str
    count: int
    amount: float


class PaymentMethodSummaryResponse(BaseModel):
    most_used: List[PaymentMethodSummaryItem]
    highest_volume: List[PaymentMethodSummaryItem]
