Refactor item management: Update schemas, models, and API routes

- Renamed customs-related schemas in line_items to LineCustomCreate, LineCustomUpdate, and LineCustomResponse.
- Adjusted models to streamline invoice_id mapping in Item model.
- Enhanced item routes to include company_id in summary statistics endpoint.
- Refactored ItemService to improve item creation and update logic, removing redundant methods.
- Updated frontend components for item management, including new item creation and editing functionalities.
- Added API client for items with CRUD operations and improved error handling.
This commit is contained in:
AlexeerCT
2025-12-30 09:22:52 -06:00
parent 304f7b07d4
commit 30b8daf16e
8 changed files with 623 additions and 481 deletions

View File

@@ -28,8 +28,7 @@ class Item(Base, TenantScopedMixin, TimestampMixin):
}
id: Mapped[int] = mapped_column(primary_key=True, autoincrement=True)
invoice_id: Mapped[int] = mapped_column(
ForeignKey("a76.invoice_header.id")) # CONSECUTIVO
invoice_id: Mapped[int] = mapped_column(ForeignKey("a76.invoice_header.id")) # CONSECUTIVO
# Type: IMPORT_TEMP, IMPORT_DEF, EXPORT, REPAIR, etc.
item_type: Mapped[str] = mapped_column(String(20))
system_origin: Mapped[str] = mapped_column(String(10)) # SCAF or SCAII