Move effective_status to service layer, document env vars and test setup - #1005
Open
ambermartin681 wants to merge 1 commit into
Open
Conversation
Closes kellymusk#978, kellymusk#979, kellymusk#980. - kellymusk#980: Move effective_status() out of src/api/payment_requests.rs and into src/services/payment_requests.rs as a public function, so any future caller (a webhook handler, a scheduled job) can determine expiry without importing from the API layer. - kellymusk#979: .env.example now documents TEST_DATABASE_URL (previously undocumented despite being required for real integration test runs) and warns against committing real secrets. .env is already gitignored. - kellymusk#978: Verified GET /me already returns `email` in MeView and in the Me schema in openapi.yaml — no code change needed, issue was already resolved by prior work. - kellymusk#977: Added a doc comment block to tests/common/mod.rs explaining the migration-once model, the lack of per-test isolation/teardown, and why parallel test execution is currently safe. The per-test DB isolation implementation (sqlx::test macro, schema-per-test, etc.) is test-authoring work and intentionally left out of this pass. Also fixes the same pre-existing extractor.rs compile break described in PR kellymusk#1004 (ApiError gained a `field` member; two call sites weren't updated).
|
@ambermartin681 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! 🚀 |
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
Closes #978
closes #979
closes #980
closes #977
effective_status()in payment requests API is pure logic that should be in the service layer #980 — Movedeffective_status()out ofsrc/api/payment_requests.rsand intosrc/services/payment_requests.rsas a public function, so any future caller (a webhook handler, a scheduled job, a new endpoint) can determine expiry without importing from the API layer..env.examplewith all required and optional variables documented #979 —.env.examplenow documentsTEST_DATABASE_URL(previously required by the integration tests but undocumented in the example file) and warns against committing real secrets..envwas already gitignored.emailtoGET /meresponse — frontend can't display the logged-in email without it #978 — VerifiedGET /mealready returnsemailin bothMeViewand theMeschema inopenapi.yaml. No code change needed — the issue was already resolved by prior work.tests/common/setup module — document what it provides and add teardown logic #977 — Added a doc comment block totests/common/mod.rsexplaining the migrate-once model, the lack of per-test isolation/teardown, and why parallel execution is currently safe given that. The per-test DB isolation implementation (sqlx::testmacro, schema-per-test, etc.) is test-authoring work and intentionally left out of this pass.Also fixes the same pre-existing
extractor.rscompile break flagged in PR #1004 on this repo (ApiErrorgained afieldmember; two call sites here weren't updated), needed for this branch to build.Test plan
cargo checkpasses clean (only pre-existing warnings).