2.0 KiB
2.0 KiB
Session History: Frontend Refactoring for v1.7.0 Schema
Date: 2025-12-23 Objective: Refactor frontend components and services to align with the v1.7.0 database schema and document numbering requirements.
1. Summary of Changes
Frontend Refactoring
DrawingUploadFormRefactor:- Implemented dynamic validation validation schemas using Zod discriminated unions.
- Added support for Contract Drawing fields:
mapCatId,volumePage. - Added support for Shop/AsBuilt fields:
legacyDrawingNumber,revisionTitle. - Added full support for
AS_BUILTdrawing type. - Dynamically passes
projectIdto context hooks.
DrawingList&DrawingCard:- Added
AS_BUILTtab support. - Implemented conditional rendering for new columns (
Volume Page,Legacy No.,Rev. Title).
- Added
- Service Layer Updates:
- Migrated
ContractDrawingService,ShopDrawingService, andAsbuiltDrawingServiceto useFormDatafor all creation/upload methods to ensure correct binary file handling. - Updated Types to fully match backend DTOs.
- Migrated
- Documentation:
- Updated
task.mdandwalkthrough.md.
- Updated
2. Issues Encountered & Status
Resolved
- Fixed
Unexpected anylint errors inDrawingUploadForm(mostly). - Resolved type mismatches in state identifiers.
Known Issues (Pending Fix)
- Build Failure:
pnpm buildfailed infrontend/app/(admin)/admin/numbering/[id]/page.tsx.- Error:
Object literal may only specify known properties, and 'templateId' does not exist in type 'Partial<NumberingTemplate>'. - Location:
numberingApi.saveTemplate({ ...data, templateId: parseInt(params.id) }); - Cause: The
saveTemplatemethod likely expects a specific DTO that conflicts with the spread...dataor the explicittemplateIdproperty assignment. This needs to be addressed in the next session.
- Error:
3. Next Steps
- Fix the build error in
admin/numbering/[id]/page.tsx. - Proceed with full end-to-end testing of the drawing upload flows.