feat(database): add deleted_at column to units of measure tables and update DTO field lengths

This commit is contained in:
Galindo97
2026-01-12 11:38:12 -06:00
parent 0aea981cf1
commit 27e18c9d0b
3 changed files with 33 additions and 24 deletions

View File

@@ -21,29 +21,29 @@ class UnitOfMeasureAmericanBase(BaseModel):
class UnitOfMeasureCustomsBase(BaseModel):
code: str = Field(..., max_length=2, description="Customs Code")
description: Optional[str] = Field(None, max_length=20)
code: str = Field(..., max_length=10, description="Customs Code")
description: Optional[str] = Field(None, max_length=50)
scaii_unit_code: Optional[str] = Field(None, max_length=5)
class UnitOfMeasureBase(BaseModel):
code: str = Field(..., max_length=5, description="Unit Code")
code: str = Field(..., max_length=20, description="Unit Code")
description: Optional[str] = Field(None, max_length=100)
description_en: Optional[str] = Field(None, max_length=100)
customs_code: Optional[str] = Field(None, max_length=2)
american_code: Optional[str] = Field(None, max_length=3)
ace_code: Optional[str] = Field(None, max_length=4)
oma_code: Optional[str] = Field(None, max_length=10)
customs_code: Optional[str] = Field(None, max_length=20)
american_code: Optional[str] = Field(None, max_length=20)
ace_code: Optional[str] = Field(None, max_length=20)
oma_code: Optional[str] = Field(None, max_length=20)
class UnitOfMeasureGeneralBase(BaseModel):
code: str = Field(..., max_length=5, description="Unit Code")
code: str = Field(..., max_length=20, description="Unit Code")
description: Optional[str] = Field(None, max_length=100)
conversion_factor: Optional[Decimal] = None
mexico_unit: Optional[str] = Field(None, max_length=5)
american_unit_code: Optional[str] = Field(None, max_length=5)
customs_code: Optional[str] = Field(None, max_length=2)
ace_code: Optional[str] = Field(None, max_length=4)
mexico_unit: Optional[str] = Field(None, max_length=20)
american_unit_code: Optional[str] = Field(None, max_length=20)
customs_code: Optional[str] = Field(None, max_length=20)
ace_code: Optional[str] = Field(None, max_length=20)
# --- Create DTOs ---
@@ -90,29 +90,29 @@ class UnitOfMeasureAmericanUpdate(BaseModel):
class UnitOfMeasureCustomsUpdate(BaseModel):
code: Optional[str] = Field(None, max_length=2)
description: Optional[str] = Field(None, max_length=20)
code: Optional[str] = Field(None, max_length=10)
description: Optional[str] = Field(None, max_length=50)
scaii_unit_code: Optional[str] = Field(None, max_length=5)
class UnitOfMeasureUpdate(BaseModel):
code: Optional[str] = Field(None, max_length=5)
code: Optional[str] = Field(None, max_length=20)
description: Optional[str] = Field(None, max_length=100)
description_en: Optional[str] = Field(None, max_length=100)
customs_code: Optional[str] = Field(None, max_length=2)
american_code: Optional[str] = Field(None, max_length=3)
ace_code: Optional[str] = Field(None, max_length=4)
oma_code: Optional[str] = Field(None, max_length=10)
customs_code: Optional[str] = Field(None, max_length=20)
american_code: Optional[str] = Field(None, max_length=20)
ace_code: Optional[str] = Field(None, max_length=20)
oma_code: Optional[str] = Field(None, max_length=20)
class UnitOfMeasureGeneralUpdate(BaseModel):
code: Optional[str] = Field(None, max_length=5)
code: Optional[str] = Field(None, max_length=20)
description: Optional[str] = Field(None, max_length=100)
conversion_factor: Optional[Decimal] = None
mexico_unit: Optional[str] = Field(None, max_length=5)
american_unit_code: Optional[str] = Field(None, max_length=5)
customs_code: Optional[str] = Field(None, max_length=2)
ace_code: Optional[str] = Field(None, max_length=4)
mexico_unit: Optional[str] = Field(None, max_length=20)
american_unit_code: Optional[str] = Field(None, max_length=20)
customs_code: Optional[str] = Field(None, max_length=20)
ace_code: Optional[str] = Field(None, max_length=20)
# --- Response DTOs ---