Skip to content

Feat/form-request#232

Open
iMercyvlogs wants to merge 5 commits into
devfrom
feat/FormRequest
Open

Feat/form-request#232
iMercyvlogs wants to merge 5 commits into
devfrom
feat/FormRequest

Conversation

@iMercyvlogs

Copy link
Copy Markdown
Collaborator

Use FormRequest in store and update methods in the transactionController

@sourceant

sourceant Bot commented May 12, 2026

Copy link
Copy Markdown

Code Review Summary

This PR successfully refactors the TransactionController to use FormRequest classes for store and update operations. This aligns with Laravel best practices and cleans up the controller logic.

🚀 Key Improvements

  • Extracted validation logic into StoreTransactionRequest and UpdateTransactionRequest.
  • Created a base ApiFormRequest to standardize JSON error responses for validation failures.
  • Updated multiple import-related requests to extend the new base class.

💡 Minor Suggestions

  • Remove commented-out code in the header of all updated Request files.
  • Standardize boolean checks in required_if validation rules.

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. See the overview comment for a summary.

Comment thread app/Http/Controllers/API/v1/TransactionController.php Outdated
Comment thread app/Models/Party.php Outdated
Comment thread database/seeders/ConfigurationSeeder.php Outdated
@iMercyvlogs iMercyvlogs requested review from kofimokome and nfebe and removed request for kofimokome May 12, 2026 12:49

@sourceant sourceant Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. No specific code suggestions were generated. See the overview comment for a summary.

@github-actions

github-actions Bot commented May 12, 2026

Copy link
Copy Markdown

Coverage Report
PR coverage: 72.09%
Baseline: 72.04%
Change: ✅+0%

@nfebe nfebe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request title not properly named, seems to have is_myself changes leaking in.

@nfebe

nfebe commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@iMercyvlogs the pull request title does not follow the patterns we use

@kofimokome kofimokome left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good. However, failure responses have a structure. See

$this->failure()

It should be such that If the form request validation fails, the response structure should follow the same structure as $this->failure()

@iMercyvlogs iMercyvlogs changed the title Feat/form request Feat/form-request Jun 8, 2026
@iMercyvlogs iMercyvlogs requested review from kofimokome and nfebe June 8, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants