o
    ȟ1i/                     @   s|   d dl mZ d dlmZmZmZ d dlmZ d dlm	Z	 G dd deZ
G dd de
ZG d	d
 d
e
ZG dd de
ZdS )    )Optional)	BaseModel
ConfigDictmodel_validator)get_db)Userc                   @   sF   e Zd ZU eed< eed< eed< eed< eed< dZee ed< dS )	StaffBaseSchema
first_name	last_nameemailmobile_number
dbs_statusstaff	user_typeN)__name__
__module____qualname__str__annotations__r   r    r   r   /app/schema/staff.pyr   	   s   
 r   c                   @   s(   e Zd ZU eed< edddd ZdS )StaffCreateSchemapasswordafter)modec                 C   sT   t  }|ttj| jk dkrtdW d    | S 1 s#w   Y  | S )Nr   z8User Email ID not available.Please try with another one.)r   queryr   filterr   count
ValueError)selfdbr   r   r   validate   s    
zStaffCreateSchema.validateN)r   r   r   r   r   r   r!   r   r   r   r   r      s   
 r   c                   @   s    e Zd ZU eed< eddZdS )StaffResponseidT)from_attributesN)r   r   r   intr   r   model_configr   r   r   r   r"      s   
 r"   c                   @   s   e Zd ZU eed< dS )StaffUpdateSchemar#   N)r   r   r   r%   r   r   r   r   r   r'   "   s   
 r'   N)typingr   pydanticr   r   r   core.configr   modelsr   r   r   r"   r'   r   r   r   r   <module>   s    	