Skip to content

Conversation

@cybervoid0
Copy link
Owner

Document Management System Implementation

What

Added comprehensive document management system to the admin panel with full functionality for creating and storing documents related to barometers.

Key Changes:

  • New Document model in database with complete set of fields for document cataloging (title, catalogue number, document type, creator, dates, physical description, annotations, provenance, etc.)
  • Admin page for adding documents (/admin/add-document) with comprehensive form validation using Yup schema
  • API endpoints for document creation and management (/api/v2/documents)
  • Enhanced barometer form with new fields: materials selection, serial number, purchase date, estimated price, and movement type
  • Validation refactoring - simplified form data types by inferring from Yup validation schemas across multiple components
  • Database relations - documents can be linked to barometers and have associated images and condition status

Technical Details:

  • Added 8 new commits with incremental feature development
  • Created comprehensive Document model with 15+ fields including metadata
  • Implemented TypeScript type inference from Yup schemas for better type safety
  • Added file upload functionality for document images
  • Enhanced admin navigation with new document management link

Why

This feature enables proper cataloging and management of historical documents related to barometers (manuals, patents, advertisements, etc.), providing a complete archival system for the collection. The enhanced barometer form provides more detailed metadata capture for better collection management.

- Introduced a new Document model with various fields for document management, including title, catalogue number, and related metadata.
- Updated existing models (Image, Barometer, Condition) to establish relationships with the new Document model, enhancing data structure and integrity.
…rometer form

- Introduced a new 'purchasedAt' field in the barometer form to capture purchase dates.
- Implemented validation for the purchase date to ensure it is a valid date and not set in the future.
- Enhanced form functionality with a date input and clear button for user convenience.
- Extended dayjs with UTC plugin for consistent date handling across the application.
- Introduced a new 'serial' field in the barometer form to capture the serial number.
- Updated validation schema to include a maximum length for the serial number.
- Enhanced input fields with placeholders for better user guidance.
- Modified the purchase date input to include a clear button for improved usability.
- Improved layout and descriptions for various form fields to enhance user experience.
…er form

- Introduced a new 'estimatedPrice' field in the barometer form to capture the estimated price of the barometer.
- Implemented validation to ensure the estimated price is a positive number.
- Enhanced the form layout by adding an input field for estimated price with appropriate labels and placeholders for user guidance.
- Introduced a new 'subCategoryId' field in the barometer form to allow selection of subcategories.
- Updated validation schema to include the new subcategory field.
- Enhanced form functionality by integrating subcategory selection with appropriate labels and default values.
- Improved user experience by ensuring default selections for categories and subcategories when available.
…validation

- Added a new 'materials' field to the barometer form for selecting associated materials.
- Updated validation schema to include the materials field, ensuring it defaults to an empty array.
- Integrated MaterialsMultiSelect component for improved user experience in selecting materials.
- Refactored file upload component to clear validation errors upon successful file uploads and deletions.
- Simplified the manufacturer form data type by inferring from the Yup validation schema.
…validation schemas

- Removed explicit form data type definitions in various components.
- Updated validation schemas to infer types directly from Yup, enhancing type safety and reducing redundancy.
- Ensured consistent validation handling across components including InaccuracyReport, ConditionEdit, DateEdit, DimensionsEdit, EstimatedPriceEdit, ImagesEdit, MaterialsEdit, PurchasedAtEdit, TextAreaEdit, and TextFieldEdit.
- Introduced a new link in the admin page for adding documents, enhancing the admin interface.
- Updated routing constants to include a new route for document management.
- Implemented API functions for creating and updating documents, improving document handling capabilities.
@cybervoid0 cybervoid0 merged commit 6f51eae into master Aug 23, 2025
1 check failed
@cybervoid0 cybervoid0 deleted the documents-table branch September 14, 2025 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants