Coverage for backend \ app \ Productos \ schemas \ categoriaProductoSchemas.py: 100.00%

15 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-29 16:13 -0500

1from pydantic import BaseModel, Field 

2from typing import Optional 

3 

4class CategoriaProductoBaseSchema(BaseModel): 

5 nombreCategoria: str = Field(..., min_length=1, max_length=50, example="Bebidas") 

6 

7class CategoriaProductoCrearSchema(CategoriaProductoBaseSchema): 

8 pass 

9 

10class CategoriaProductoActualizarSchema(BaseModel): 

11 nombreCategoria: Optional[str] = Field(None, min_length=1, max_length=50, example="Bebidas") 

12 activoCategoria: Optional[bool] = None 

13 

14class CategoriaProductoRespuestaSchema(BaseModel): 

15 idCategoriaProducto: int 

16 nombreCategoria: str 

17 activoCategoria: bool 

18 

19 class Config: 

20 from_attributes = True