Repository navigation
feat(reimbursement): add reimbursement bundle workflow, core check rules, and validated exports #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1a6fe31
fix(core): preserve negative sign for red-ink invoice amounts
stone16 c33e6f2
feat(core): add KnownLedger, check rules, 3-sheet Excel, and pypdfium…
stone16 ead58f4
feat(backend): add reimbursement sets CRUD, duplicate upload hint, an…
stone16 8672bbd
feat(frontend): add ReimbursementSetsPage, batch add-to-set, and blob…
stone16 99c57de
fix(reimbursement): address Opus & CodeRabbit review findings on dedu…
stone16 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from app.models.audit_log import AuditLog | ||
| from app.models.invoice import Invoice, InvoiceStatus, LlmResult, OcrResult, ParsingDiff | ||
| from app.models.reimbursement_set import ReimbursementSet, ReimbursementSetItem | ||
|
|
||
| __all__ = [ | ||
| "AuditLog", | ||
| "Invoice", | ||
| "InvoiceStatus", | ||
| "LlmResult", | ||
| "OcrResult", | ||
| "ParsingDiff", | ||
| "ReimbursementSet", | ||
| "ReimbursementSetItem", | ||
| ] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| """SQLAlchemy models for reimbursement sets and ordered invoice membership.""" | ||
|
|
||
| from datetime import datetime | ||
| from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, Text, UniqueConstraint | ||
| from sqlalchemy.orm import relationship | ||
|
|
||
| from app.database import Base | ||
|
|
||
|
|
||
| class ReimbursementSet(Base): | ||
| __tablename__ = "reimbursement_sets" | ||
|
|
||
| id = Column(Integer, primary_key=True, index=True) | ||
| name = Column(String(200), nullable=False) | ||
| description = Column(Text, nullable=True) | ||
| created_at = Column(DateTime, default=datetime.utcnow, nullable=False) | ||
| updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False) | ||
|
|
||
| items = relationship( | ||
| "ReimbursementSetItem", | ||
| back_populates="reimbursement_set", | ||
| cascade="all, delete-orphan", | ||
| order_by="ReimbursementSetItem.position", | ||
| ) | ||
|
|
||
|
|
||
| class ReimbursementSetItem(Base): | ||
| __tablename__ = "reimbursement_set_items" | ||
| __table_args__ = ( | ||
| UniqueConstraint("set_id", "position", name="uq_reimbursement_set_items_set_position"), | ||
| ) | ||
|
|
||
| id = Column(Integer, primary_key=True, index=True) | ||
| set_id = Column( | ||
| Integer, | ||
| ForeignKey("reimbursement_sets.id", ondelete="CASCADE"), | ||
| nullable=False, | ||
| index=True, | ||
| ) | ||
| invoice_id = Column( | ||
| Integer, | ||
| ForeignKey("invoices.id", ondelete="CASCADE"), | ||
| nullable=False, | ||
| unique=True, | ||
| ) | ||
| position = Column(Integer, nullable=False) | ||
| created_at = Column(DateTime, default=datetime.utcnow, nullable=False) | ||
|
|
||
| reimbursement_set = relationship("ReimbursementSet", back_populates="items") | ||
| invoice = relationship("Invoice") |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.