Add invoice processing functionality and enhance models and routes
- Introduced new routes for processing invoices in the router. - Added `InvoiceStatus` enum to manage invoice states. - Enhanced `InvoiceHeader` and `InvoiceFinancials` models with new fields for status tracking and total packages. - Updated schemas to include new fields for invoice processing. - Implemented API methods for processing invoices and checking process status in the frontend. - Removed outdated validation files related to invoice processing.
This commit is contained in:
@@ -43,6 +43,9 @@ class ClassCreateDTO(BaseModel):
|
||||
iva_exempt_fraction: Optional[str] = Field(
|
||||
None, max_length=4, description="IVA exempt fraction"
|
||||
)
|
||||
is_active: Optional[bool] = Field(
|
||||
True, description="Indicates if the class is active (default: true)"
|
||||
)
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
@@ -76,6 +79,9 @@ class ClassCreateDTOFA(ClassCreateDTO):
|
||||
class_enabled: Optional[bool] = Field(
|
||||
True, description="Indica si la clase está habilitada"
|
||||
)
|
||||
is_active: Optional[bool] = Field(
|
||||
True, description="Indicates if the class is active (default: true)"
|
||||
)
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
@@ -116,6 +122,9 @@ class ClassUpdateDTO(BaseModel):
|
||||
iva_exempt_fraction: Optional[str] = Field(
|
||||
None, max_length=4, description="IVA exempt fraction"
|
||||
)
|
||||
is_active: Optional[bool] = Field(
|
||||
True, description="Indicates if the class is active (default: true)"
|
||||
)
|
||||
|
||||
model_config = ConfigDict(from_attributes=True, extra='forbid') # Explicitly forbid extra fields
|
||||
|
||||
@@ -136,6 +145,7 @@ class ClassResponseDTO(BaseModel):
|
||||
sub_key: Optional[str] = None
|
||||
physical_review: Optional[int] = None
|
||||
iva_exempt_fraction: Optional[str] = None
|
||||
is_active: Optional[bool] = None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
|
||||
@@ -84,13 +84,17 @@ class Class(Base, TenantScopedMixin, TimestampMixin):
|
||||
String(4)
|
||||
) # FRACCIONEXENTAIVA
|
||||
|
||||
is_active: Mapped[bool] = mapped_column(
|
||||
default=True, server_default="true", nullable=False
|
||||
) # Campo para habilitar/deshabilitar clases sin eliminarlas
|
||||
|
||||
# Relationships
|
||||
material_type: Mapped[Optional["MaterialType"]] = relationship(
|
||||
foreign_keys=[material_key]
|
||||
)
|
||||
unit_of_measure_info: Mapped[Optional["UnitOfMeasure"]] = relationship(
|
||||
foreign_keys=[unit_of_measure]
|
||||
)
|
||||
)
|
||||
|
||||
# Inverse relationship with GParts that have this class
|
||||
parts: Mapped[list["Part"]] = relationship(
|
||||
|
||||
Reference in New Issue
Block a user