from datetime import datetime
from uuid import UUID
from pydantic import ConfigDict
from fastapi import Form

from backend.schemas.fuware_model import FuwareModel

class UserBase(FuwareModel):
  username: str = Form(...)

class UserRequest(UserBase):
  password: str = Form(...)

class UserCreate(UserRequest):
  name: str

class UserSeeds(UserCreate):
  is_admin: bool
  is_lock: bool

class PrivateUser(UserBase):
  id: UUID
  name: str
  is_admin: bool
  is_lock: bool
  created_at: datetime
  updated_at: datetime
  model_config = ConfigDict(from_attributes=True)

class ProfileResponse(UserBase):
  name: str
  is_admin: bool
  created_at: datetime
  updated_at: datetime
  model_config = ConfigDict(from_attributes=True)

class LoginResponse(FuwareModel):
  access_token: str
  exp: int
  name: str
