chore: integrate AddReceiptDialog into MaintenanceRecordForm (#182) #184

Closed
opened 2026-02-14 02:39:33 +00:00 by egullickson · 0 comments
Owner

Relates to #182

Summary

Replace the current ReceiptCameraButton ("Scan Receipt") in MaintenanceRecordForm with an "Add Receipt" button that opens the new AddReceiptDialog. Wire both upload and camera paths to the existing OCR processing pipeline.

Scope

  • Modify: frontend/src/features/maintenance/components/MaintenanceRecordForm.tsx
  • Remove ReceiptCameraButton import (from fuel-logs)
  • Add AddReceiptDialog import
  • Add showAddReceiptDialog state (useState)
  • Replace ReceiptCameraButton (lines 249-270) with MUI Button labeled "Add Receipt"
  • Add AddReceiptDialog component with wiring:
    • onFileSelect -> close dialog, handleCaptureImage(file)
    • onStartCamera -> close dialog, startCapture()
  • Keep existing Camera Dialog, OCR Backdrop, ReviewModal, ErrorDialog unchanged
  • Tier gating preserved (check before opening dialog)

Acceptance Criteria

  • "Add Receipt" button replaces "Scan Receipt" button
  • Clicking "Add Receipt" opens AddReceiptDialog (with tier check)
  • Upload path: file selected -> dialog closes -> OCR processing -> review modal
  • Camera path: "Take Photo" -> dialog closes -> CameraCapture opens -> OCR -> review modal
  • Review modal works identically for both input methods
  • Form population works identically for both paths
  • Receipt file stored for document upload on form submit
  • Tier gating (Pro feature) still works correctly
Relates to #182 ## Summary Replace the current `ReceiptCameraButton` ("Scan Receipt") in `MaintenanceRecordForm` with an "Add Receipt" button that opens the new `AddReceiptDialog`. Wire both upload and camera paths to the existing OCR processing pipeline. ## Scope - Modify: `frontend/src/features/maintenance/components/MaintenanceRecordForm.tsx` - Remove `ReceiptCameraButton` import (from fuel-logs) - Add `AddReceiptDialog` import - Add `showAddReceiptDialog` state (useState) - Replace `ReceiptCameraButton` (lines 249-270) with MUI Button labeled "Add Receipt" - Add `AddReceiptDialog` component with wiring: - `onFileSelect` -> close dialog, `handleCaptureImage(file)` - `onStartCamera` -> close dialog, `startCapture()` - Keep existing Camera Dialog, OCR Backdrop, ReviewModal, ErrorDialog unchanged - Tier gating preserved (check before opening dialog) ## Acceptance Criteria - "Add Receipt" button replaces "Scan Receipt" button - Clicking "Add Receipt" opens AddReceiptDialog (with tier check) - Upload path: file selected -> dialog closes -> OCR processing -> review modal - Camera path: "Take Photo" -> dialog closes -> CameraCapture opens -> OCR -> review modal - Review modal works identically for both input methods - Form population works identically for both paths - Receipt file stored for document upload on form submit - Tier gating (Pro feature) still works correctly
egullickson added the
status
in-progress
type
chore
labels 2026-02-14 02:39:46 +00:00
egullickson added this to the Sprint 2026-02-02 milestone 2026-02-14 02:39:48 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: egullickson/motovaultpro#184