fix: replace in-memory receipt store with persistent database access - #957
Open
Calebstack wants to merge 32 commits into
Open
Calebstack wants to merge 32 commits into
Calebstack wants to merge 32 commits into
Conversation
|
@Calebstack Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR replaces the in-memory receipt store with a persistent database-backed repository. Receipt reads and writes now go through the database, so receipts survive process restarts and stay consistent across multiple instances. The existing receipt normalization and hash behavior are preserved, with the service delegating to a new repository layer.
Related Issue
Closes BE-105
Changes
🗄️ Persistent Receipt Repository
[ADD]
app/backend/src/receipts/receipts.repository.tsnull/empty results instead of throwing for missing rows.[ADD]
app/backend/src/receipts/migrations/001_create_receipts_table.sqlreceiptstable with columns for the normalized receipt payload, ID/hash, timestamps, and metadata required by the service.[ADD]
app/backend/src/receipts/receipts.types.ts[MODIFY]
app/backend/src/receipts/receipts.module.tsReceiptsRepositoryinto the module and registers it for dependency injection.[MODIFY]
app/backend/src/receipts/receipts.service.tsTODOand swaps the in-memory map for the repository-backed store.🧪 Test Coverage
[ADD]
app/backend/src/receipts/receipts.repository.unit.spec.ts[MODIFY]
app/backend/src/receipts/receipts.service.unit.spec.tsVerification Results
Closes #804