From a74e1d746c4f4f6070874b1131d6f93713265add Mon Sep 17 00:00:00 2001 From: AlexeerCT Date: Fri, 13 Mar 2026 13:32:47 -0500 Subject: [PATCH] Update depreciation_date field type in models and schemas - Changed the type of the depreciation_date field from Optional[int] to Optional[datetime] in the LineItem model and LineItemBase schema for improved accuracy in date representation. - Updated the frontend interface to reflect the change, altering depreciation_date from number to string to accommodate the new datetime format. --- backend/api/v1/modules/a76/items/models.py | 2 +- backend/api/v1/modules/a76/items/schemas.py | 2 +- frontend/src/lib/api/dashboard/a76/items.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/api/v1/modules/a76/items/models.py b/backend/api/v1/modules/a76/items/models.py index 7da837c3..8d4e1fee 100644 --- a/backend/api/v1/modules/a76/items/models.py +++ b/backend/api/v1/modules/a76/items/models.py @@ -176,7 +176,7 @@ class LineItem(Base, TenantScopedMixin, TimestampMixin): ) # NUMEROGUIA/NUMERODEGUIA # Dates - depreciation_date: Mapped[Optional[int]] = mapped_column( + depreciation_date: Mapped[Optional[datetime]] = mapped_column( Integer ) # FECHADEPRECIACION diff --git a/backend/api/v1/modules/a76/items/schemas.py b/backend/api/v1/modules/a76/items/schemas.py index 62072356..a752701e 100644 --- a/backend/api/v1/modules/a76/items/schemas.py +++ b/backend/api/v1/modules/a76/items/schemas.py @@ -203,7 +203,7 @@ class LineItemBase(BaseModel): guide_number: Optional[str] = Field(None, max_length=50, description="Guide number") # Dates - depreciation_date: Optional[int] = Field(None, description="Depreciation date") + depreciation_date: Optional[datetime] = Field(None, description="Depreciation date") # Administrative fields rectification: Optional[int] = Field(None, description="Rectification") diff --git a/frontend/src/lib/api/dashboard/a76/items.ts b/frontend/src/lib/api/dashboard/a76/items.ts index 1d986317..1c7f2a75 100644 --- a/frontend/src/lib/api/dashboard/a76/items.ts +++ b/frontend/src/lib/api/dashboard/a76/items.ts @@ -192,7 +192,7 @@ export interface Item { reference_number?: string; order?: string; guide_number?: string; - depreciation_date?: number; + depreciation_date?: string; rectification?: number; warehouse?: string; location?: string;