0.1.4 models update

This commit is contained in:
2026-07-22 16:12:10 +03:00
parent 588bff725b
commit 8e66161ddd
12 changed files with 386 additions and 18 deletions

View File

@@ -0,0 +1,35 @@
from decimal import Decimal
from src.models.pydantic_models.model import Base
from pydantic import Field
from typing import Annotated
class NomenclatureCreate(Base):
article:Annotated[str, Field(...,min_length=5,max_length=16, description="name of the article")]
price:Annotated[Decimal, Field(..., max_digits=12, description="price of the article")]
tnvd:Annotated[int, Field(..., max_digits=10, description="tnvd from the Markirovka.crpt")]
status:Annotated[bool, Field(..., description="status of the article")]
doc_type:Annotated[str, Field(..., description="document type (declaration or certificate)")]
fabric:Annotated[str, Field(..., description="fabric of the product")]
class NomenclatureOut(Base):
article:Annotated[str, Field(..., min_length=5,max_length=16, description="name of the article")]
price:Annotated[Decimal, Field(..., max_digits=12,description="price of the article")]
tnvd:Annotated[int, Field(..., max_digits=10,description="tnvd from the Markirovka.crpt")]
status:Annotated[bool, Field(..., description="status of the article")]
doc_type:Annotated[str, Field(...,max_length=64, description="document type (declaration or certificate)")]
fabric:Annotated[str, Field(...,max_length=64, description="fabric of the product")]
class DocumentTypeCreate(Base):
name:Annotated[str, Field(...,max_length=64, description="certificate or declaration")]
class DocumentTypeOut(Base):
name:Annotated[str, Field(..., max_length=64,description="certificate or declaration")]
class FabricCreate(Base):
name:Annotated[str, Field(..., max_length=64,description="certificate or declaration")]
class FabricOut(Base):
name:Annotated[str, Field(..., max_length=64,description="certificate or declaration")]