Skip to content

Updated NonProfit Files#22

Merged
mrysav merged 3 commits intomainfrom
feat-file-system-integration-flow
Mar 5, 2026
Merged

Updated NonProfit Files#22
mrysav merged 3 commits intomainfrom
feat-file-system-integration-flow

Conversation

@TrickkyRicky
Copy link
Contributor

What changed

NonprofitDocument was storing raw file bytes in a fileData Bytes column. So we now store the reference to where the file is located with the new filePath column. Existing records are left the same and that flow is fine but new files going forward will have the filePath column populated instead of fileData.


Two storage paths

Record type fileData filePath Download behaviour
Legacy has bytes NULL Served from DB blob
New uploads NULL has path Served from disk

The download endpoint handles both transparently


Key changes

Database

  • fileData made optional (Bytes?) existing rows left same
  • filePath String? added NULL on all existing rows

API

  • GET /api/nonprofit-documents list endpoint, returns metadata only
  • GET /api/nonprofit-documents/download?id= new dedicated download endpoint; checks filePath first, falls back to fileData for legacy records
  • POST /api/nonprofit-documents writes to disk, stores filePath, clears fileData on update
  • PATCH /api/nonprofit-documents same as POST; also deletes the old file from disk when replacing

Other

  • docker-compose.ymluploads/ directory mounted as a named volume so files survive container restarts
  • Admin UI — download buttons now call the dedicated endpoint instead of base64-decoding blobs client-side

@TrickkyRicky TrickkyRicky requested a review from a team as a code owner March 1, 2026 04:20
@TrickkyRicky TrickkyRicky linked an issue Mar 1, 2026 that may be closed by this pull request
4 tasks
Copy link

@kierstinhicks kierstinhicks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Approved.

@TrickkyRicky TrickkyRicky requested a review from mrysav March 5, 2026 00:52
@mrysav mrysav merged commit 2dc2487 into main Mar 5, 2026
1 check passed
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.

Store Nonprofit Documents on the File System Instead of the Database

3 participants