1.9 KiB
1.9 KiB
Phase 009: Fuel And Maintenance Entry Images
Goal
Allow fuel and maintenance entries to store multiple receipt/service images, display them only when requested, and optionally include them in portable backups.
Work
- Use Active Storage for fuel and maintenance entry images.
- Support multiple images per entry.
- Accept only JPEG and PNG uploads.
- Enforce a 10 MB maximum per image.
- Add image upload fields to fuel and maintenance entry forms.
- Allow images to be added to existing fuel and maintenance entries.
- Load entry images inline on demand from the vehicle detail history tables.
- Show small thumbnails that link to full-size images.
- Allow users to delete individual attached images.
- Add separate backup download options for data-only and image-inclusive backups.
- Extend backup import/export to support images while preserving data-only restores.
- Deduplicate imported images by filename and checksum during merge restores.
Deliverables
- Active Storage migrations and model attachment declarations.
- Attachment validation behavior for fuel and maintenance entries.
- Lazy inline image display and deletion UI.
- Lazy inline image upload UI for existing entries.
- Backup/export support for data-only and full image backups.
- Request and model specs for image behavior and backup image portability.
Acceptance Criteria
- Users can attach multiple JPEG/PNG images to fuel and maintenance entries.
- Uploads over 10 MB or non-JPEG/PNG uploads are rejected.
- Vehicle detail pages do not load image thumbnails until a user requests them.
- Existing fuel and maintenance entries can add images from the history tables.
- Successful existing-entry uploads immediately show thumbnails inline.
- Requested images render inline as small thumbnails linked to full-size images.
- Users can delete individual entry images.
- Data-only backups exclude image content.
- Image-inclusive backups restore images and avoid duplicate images on merge.