from pydantic import BaseModel

class UserLoan(BaseModel):
    id: str
    full_name: str
    email: str
    phone: str

    class Config:
        from_attributes = True

class LoanResponse(BaseModel):
    id: str
    timType: str
    amount: float
    interestRate: float 
    remainingBalance: float
    monthlyPayment: float
    nextPaymentDate: str;    
    status: str
    createdAt: str
    daysOverdue: int
    client: UserLoan

    class Config:
        from_attributes = True
        
class LoanDetailResponse(BaseModel):
    total: int
    page: int
    page_size: int
    total_pages: int
    data: list  [LoanResponse]
    class Config:
        from_attributes = True