from datetime import datetime

from pydantic import BaseModel, Field


class OtpModel(BaseModel):

    country_code: str = Field(..., min_length=2, max_length=5)

    phone: str = Field(..., min_length=6, max_length=15)

    otpCode: str = Field(..., min_length=4, max_length=6)

    purpose: str = Field(
        ...,
        description="register or forgot_password"
    )

    is_active: bool = True

    created_at: datetime = Field(
        default_factory=datetime.utcnow
    )

