Skip to content

Conversation

@DawBaz15
Copy link
Collaborator

Added endpoints for creating, storing, indexing and showing auction reports.

@DawBaz15 DawBaz15 linked an issue Dec 30, 2025 that may be closed by this pull request
@KacperWalenga KacperWalenga requested a review from Copilot January 5, 2026 17:30
Copy link

Copilot AI left a 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.

Copy link
Member

@AmonDeShir AmonDeShir left a 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'.

@DawBaz15 DawBaz15 requested a review from AmonDeShir January 6, 2026 15:58
Copy link
Member

@AmonDeShir AmonDeShir left a comment

Choose a reason for hiding this comment

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

LGTM

@AmonDeShir AmonDeShir merged commit bb05e88 into main Jan 6, 2026
3 checks passed
@AmonDeShir AmonDeShir deleted the #5---Report-Listing branch January 6, 2026 16:36
KacperWalenga added a commit that referenced this pull request Jan 6, 2026
* - 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]>
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.

Report Listing - Backend

3 participants