from pydantic import BaseModel
from fastapi_users import schemas

from .models import User


class UserBase(schemas.CreateUpdateDictModel):
    pass


class UserRead(User):
    class Config:
        fields = {
            '_id': {'alias': 'id'},
            'hashed_password': {'exclude': True}
        }


class UserCreate(UserBase):
    login: str
    password: str
    email: str
    entity_id: str


class UserUpdate(UserBase):
    pass


class PasswordUpdate(BaseModel):
    old_password: str
    password: str
