-
Notifications
You must be signed in to change notification settings - Fork 0
#5 - Report Listing #44
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a comprehensive reporting system for auctions, allowing users to report problematic auctions and administrators to review them. The implementation includes database schema, backend controllers, API resources, form validation, and frontend React components.
Key changes:
- Added complete report management system with create, store, index, and show operations
- Implemented database migration, model, factory, and seeder for reports table
- Created authorization-protected admin routes for viewing and managing reports
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| routes/web.php | Added four new routes for report creation, storage, listing, and viewing with appropriate middleware protection |
| database/migrations/0001_01_01_000005_create_reports_table.php | Created reports table with foreign keys to users and auctions, includes reason and resolved_at fields |
| database/factories/ReportFactory.php | Added factory for generating test report data |
| database/seeders/ReportSeeder.php | Created seeder to generate 30 sample reports |
| database/seeders/DatabaseSeeder.php | Integrated ReportSeeder into the main seeder |
| app/Models/Report.php | Defined Report model with relationships to User (reporter) and Auction |
| app/Http/Resources/ReportResource.php | Created API resource for formatting report data in responses |
| app/Http/Requests/Auction/CreateReportRequest.php | Added form request with validation rules for report creation |
| app/Http/Controllers/Auction/ReportController.php | Implemented controller with create, store, index, and show methods for report management |
| app/Actions/Auction/CreateReportAction.php | Created action class to encapsulate report creation logic |
| resources/js/Types/report.ts | Defined TypeScript type for Report with all necessary fields |
| resources/js/Pages/Auction/ReportAuction.tsx | Created form component for users to submit auction reports |
| resources/js/Pages/Auction/ShowReport.tsx | Built component to display detailed report information |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AmonDeShir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obecnie jedna osoba może zgłosić tą samą aukcję wiele razy. Powinniśmy napisać politykę, która zablokuje taką możliwość oraz dodać do widoku resourca pole, które da frontendowi informacje o tym, czy dana aukcja został już przez niego zgłoszona coś typu 'wasReported'.
AmonDeShir
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* - Init (#1) * init * fix dockerfile * fix code style * - Fix taskfile * #8 - Auth (#32) * change vue to react * wip * auth * fix code style * apply suggestions * add import * Apply suggestions from code review * - remove api (#36) * fix routes * remove api * #9 - Listing Creation (#37) * 9 - Listing Creation * - Listing Creation * - task fix * - Copilot fixes * - task fix * - routes fix * - cr fixes * - cr fix 2 * - cr fix 3 * - cr fixes final final final (56) * - cr fixes final final final final final * - 3am mental asylum * - copilot slop * - cr fix final final final complete final * #4 - Edit Listing (#38) Added actions, controllers, requests and routes for: - Editing Auction. - Updating Auction. Added a policy for updating auction (user must be auction owner). Fixed auction description data type. * - Implement components (#39) * Implement components * fix code style * implement copilot suggestions * implement copilot suggestions * fix code style * #17 - Login page frontend (#40) * Implement components * fix code style * implement copilot suggestions * implement copilot suggestions * fix code style * Create navbar * Login page * Login page * Register * Reset Password * Fix register link * Fix CSRF * fix code style * Implement auctions page * fix code style * fix web * #16 - Create Listing Page - Frontend (#41) * Implement components * fix code style * implement copilot suggestions * implement copilot suggestions * fix code style * Create navbar * Login page * Login page * Register * Reset Password * Fix register link * Fix CSRF * fix code style * Implement auctions page * Added actions, controllers, requests and routes for: - Editing Auction. - Updating Auction. Added a policy for updating auction (user must be auction owner). Fixed auction description data type. * Implement auctions page * fix type * fix code style * fix linter * merge --------- Co-authored-by: DawBaz15 <[email protected]> * #7 - User Roles Management - Backend (#43) * #13 - Close Listing (#42) - Created endpoints for finishing and cancelling an auction. - Restored the update function in AuctionController. - Fixed route * #5 - Report Listing (#44) * 5 - Report Listing * cr changes and report resolved endpoint * #6 - listing image uploads backend (#45) * assing role on user register * add images to auctions * apply suggestions from copilot c: --------- Co-authored-by: Dawid Bazylewicz <[email protected]> * - Add auction view (#46) * wip * fix show page * fix code style * fix seeder * fix code style * fix code style * #12 - admin panel endpoints backend (#47) * 5 - Report Listing * assing role on user register * add images to auctions * apply suggestions from copilot c: * wip - admin panel, statistics * change Otoszroto\ to App\ * fix user factory * auctions stats screen * reports screen in admin panel * remove reason in reports, add link to auction * add translations * add lang/pl * fix code style --------- Co-authored-by: Dawid Bazylewicz <[email protected]> --------- Co-authored-by: DawBaz15 <[email protected]> Co-authored-by: Dominik Purgał <[email protected]> Co-authored-by: Dawid Bazylewicz <[email protected]>
Added endpoints for creating, storing, indexing and showing auction reports.