42 lines
903 B
Python
42 lines
903 B
Python
from pydantic import BaseModel, EmailStr, Field, validator, ConfigDict
|
|
from datetime import datetime
|
|
from typing import Optional, Dict, Any
|
|
#
|
|
import re
|
|
from enum import Enum
|
|
#
|
|
|
|
|
|
|
|
class SupplierType(Enum):
|
|
NACIONAL = "nacional"
|
|
EXTRANJERO = "extranjero"
|
|
GLOBAL = "global"
|
|
|
|
class SuppliersBase(BaseModel):
|
|
rfc: str
|
|
email : EmailStr
|
|
short_name : str
|
|
razon_social : str
|
|
fiscal_number : str
|
|
cellphone: str
|
|
supplier_type : SupplierType
|
|
is_active : bool = True
|
|
|
|
class SupplierCreate(SuppliersBase):
|
|
location_id: int
|
|
client_id: int
|
|
|
|
class SupplierUpdate(SuppliersBase):
|
|
pass
|
|
|
|
class SupplierResponse(SupplierCreate):
|
|
id: int
|
|
created_at: datetime
|
|
updated_at: Optional[datetime]
|
|
deleted_at: Optional[datetime]
|
|
created_by: int
|
|
updated_by: Optional[int]
|
|
deleted_by: Optional[int]
|
|
class messageResponse(BaseModel):
|
|
message : str |