Repository navigation
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Owner
Author
|
Could not land into |
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.
Linear: https://linear.app/aminbaa/issue/AMI-7/require-a-reason-when-rejecting-an-expense
Factory decision: build
Plan: Add a nullable
reject_reasoncolumn to the expenses table in app/db.py, with a small ALTER for existing databases because the schema uses CREATE IF NOT EXISTS.In app/expenses.py add a
RejectInmodel withreason: str = Field(min_length=1, max_length=500). Make the reject endpoint take it as the body and havedecidestore it. Approve is unchanged.Return the stored reason in the expense responses (the
SELECT *rows already include it).Update the existing reject test to send a reason. Add tests for a missing reason (422), an empty reason (422), a reason over 500 characters (422), and the stored reason showing up on GET. Update the README endpoint table.
Why:
reasonof 1 to 500 characters onPOST /expenses/{id}/reject, stored, returned on fetch, and a 422 when missing.*in CODEOWNERS). It does not touchapp/auth.pyor.github/, which are the platform-owned paths, as far as the ticket describes.personal_phoneorwork_phone, so the data rules are not triggered.app/auth.pyor.github/, the decision changes to escalate, because those paths need platform-team review.can_viewalready limit who can fetch an expense, so the owner (the employee) and their manager can see the reason.Opened by ticket-factory. CI and review run on this PR; the factory lands it into
factory_pre_mergewhen they pass.