hibatorrahmen's picture
Add backend application and Dockerfile
8ae78b0
from pydantic import BaseModel, EmailStr, Field
from typing import Optional
from datetime import datetime
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
class UserBase(BaseModel):
"""Base model for user data."""
email: EmailStr
first_name: str
last_name: str
class UserCreate(UserBase):
"""Model for creating a new user."""
password: str
class User(UserBase):
"""Model for user response."""
id: str
created_at: datetime
is_active: bool
class Config:
from_attributes = True
class UserLogin(BaseModel):
email: EmailStr
password: str
class UserOut(BaseModel):
id: str
email: EmailStr
first_name: str
last_name: str
class Config:
from_attributes = True