Files
lcbp3/specs/09-history/2025-12-23-frontend-refactor-v170.md
admin 7db6a003db
Some checks failed
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled
251223:1649 On going update to 1.7.0: Refoctory drawing Module & document number Module
2025-12-23 16:49:16 +07:00

39 lines
2.0 KiB
Markdown

# 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
- **`DrawingUploadForm` Refactor:**
- 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_BUILT` drawing type.
- Dynamically passes `projectId` to context hooks.
- **`DrawingList` & `DrawingCard`:**
- Added `AS_BUILT` tab support.
- Implemented conditional rendering for new columns (`Volume Page`, `Legacy No.`, `Rev. Title`).
- **Service Layer Updates:**
- Migrated `ContractDrawingService`, `ShopDrawingService`, and `AsbuiltDrawingService` to use `FormData` for all creation/upload methods to ensure correct binary file handling.
- Updated Types to fully match backend DTOs.
- **Documentation:**
- Updated `task.md` and `walkthrough.md`.
## 2. Issues Encountered & Status
### Resolved
- Fixed `Unexpected any` lint errors in `DrawingUploadForm` (mostly).
- Resolved type mismatches in state identifiers.
### Known Issues (Pending Fix)
- **Build Failure**: `pnpm build` failed in `frontend/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 `saveTemplate` method likely expects a specific DTO that conflicts with the spread `...data` or the explicit `templateId` property assignment. This needs to be addressed in the next session.
## 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.