class CandidateBase(Base): """ Nexton recruit candidate """ name: str = Field(..., description="Candidate name") email: str = Field(..., description="Candidate email") linkedin_url: str = Field(..., description="LinkedIn URL") avatar_path: Optional[str] = Field(..., description="Candidate avatar path")
class TransactionItemBase(RelationBase): """ TransactionItem """ transaction_id: UUID = Field(..., description="Transaction Id") product_id: UUID = Field(..., description="Product Id") quantity: int = Field(..., description="Quantity of items") amount: float = Field(..., description="Amount")
class TransactionCreate(BaseModel): type: TransactionTypesBase = Field( ..., description= "Transaction type. Possible values are: PAYMENT, CASH-OUT, TRANSFER", ) description: str = Field(..., description="Transaction description") amount: float = Field(..., description="Total transaction amount") user_id: UUID = Field( ..., description="Connected user_id that has executed the transaction") items: List[TransactionItemCreate] = Field( ..., description="List of transaction items")
class TransactionItemCreate(BaseModel): product_id: UUID = Field(..., description="Product Id") quantity: int = Field(..., description="Quantity of items") amount: float = Field(..., description="Amount")
class CandidateUpdate(CandidateCreate): avatar_path: Optional[str] = Field(..., description="Candidate avatar path")
class CandidateCreate(BaseModel): name: str = Field(..., description="Candidate name") email: str = Field(..., description="Candidate email") linkedin_url: str = Field(..., description="LinkedIn URL")
class ProductBase(Base): """ Product """ description: str = Field(..., description="Product description")
class ProductCreate(BaseModel): description: str = Field(..., description="Product description")