fix: use invoicing role contact for invoice email - #488
Open
kocaemre wants to merge 1 commit into
Open
Conversation
Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>
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.
Summary
Fixes #487.
The invoice email path only looked at the legacy
client.invoicing_contactrelationship. The current contacts UI can also attach contacts through theClientContactassociation with roleinvoicing, which meant a client could visibly have an invoicing contact with an email address while Send Invoice still failed with “No contact email available”.This adds a shared invoice-recipient contact lookup that:
ClientContactwhose role isinvoicingAI assistance was used while drafting this change; I reviewed the code path and verified the final patch locally.
Checklist
just dev).justis not installed in this environment.just test).pytest -q→ 549 passed, 1 skipped.just precommit).justis not installed in this environment. Ranruff check ...andgit diff --checkinstead.tuttle/model.py), I generated and reviewed an Alembic migration (just migrate "<msg>").Verification
uv sync --dev source .venv/bin/activate python -m py_compile tuttle/model.py tuttle/invoicing.py tuttle/app/invoicing/intent.py tuttle_tests/test_invoice.py pytest tuttle_tests/test_invoice.py -q pytest -q ruff check tuttle/model.py tuttle/invoicing.py tuttle/app/invoicing/intent.py tuttle_tests/test_invoice.py git diff --checkResults:
pytest tuttle_tests/test_invoice.py -q: 41 passedpytest -q: 549 passed, 1 skippedruff check ...: All checks passedgit diff --check: no whitespace errors