Skip to content

Conversation

@StanBarrows
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings November 27, 2025 08:47
Copilot finished reviewing on behalf of StanBarrows November 27, 2025 08:49
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 pull request adds comprehensive support for the Quotes feature and Item Positions API in the Bexio connector library. The implementation follows the established patterns in the codebase for API requests, DTOs, and test coverage.

  • Implements 15 quote-related API endpoints covering the full lifecycle of quotes (create, fetch, edit, delete, search, issue, accept, decline, reissue, mark as sent, revert issue, PDF generation, and conversions to invoices/orders)
  • Adds 5 item position endpoints to manage line items in quotes and other KB documents
  • Includes comprehensive test coverage for all new endpoints using the Pest testing framework with Saloon HTTP mocking

Reviewed changes

Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Requests/Quotes/CreateAQuoteRequest.php Implements quote creation with position filtering logic
src/Requests/Quotes/EditAQuoteRequest.php Handles quote updates with field whitelisting
src/Requests/Quotes/FetchAQuoteRequest.php Retrieves a single quote by ID
src/Requests/Quotes/FetchAListOfQuotesRequest.php Lists quotes with pagination support
src/Requests/Quotes/DeleteAQuoteRequest.php Deletes a quote
src/Requests/Quotes/SearchQuotesRequest.php Searches quotes with criteria and pagination
src/Requests/Quotes/ShowPdfAQuoteRequest.php Generates PDF representation of a quote
src/Requests/Quotes/AcceptAQuoteRequest.php Accepts a quote
src/Requests/Quotes/DeclineAQuoteRequest.php Declines a quote
src/Requests/Quotes/IssueAQuoteRequest.php Issues a quote
src/Requests/Quotes/ReissueAQuoteRequest.php Reissues a quote
src/Requests/Quotes/RevertIssueAQuoteRequest.php Reverts an issued quote
src/Requests/Quotes/MarkAsSentAQuoteRequest.php Marks a quote as sent
src/Requests/Quotes/CreateInvoiceFromQuoteRequest.php Converts a quote to an invoice
src/Requests/Quotes/CreateOrderFromQuoteRequest.php Converts a quote to an order
src/Requests/ItemPositions/CreateAnItemPositionRequest.php Creates item positions with type-based field filtering
src/Requests/ItemPositions/EditAnItemPositionRequest.php Updates item positions
src/Requests/ItemPositions/FetchAnItemPositionRequest.php Retrieves a single item position
src/Requests/ItemPositions/FetchAListOfItemPositionsRequest.php Lists item positions for a KB document
src/Requests/ItemPositions/DeleteAnItemPositionRequest.php Deletes an item position
src/Dto/Quotes/QuoteDTO.php Data transfer object for quote data with tax and position collections
src/Dto/ItemPositions/ItemPositionDTO.php DTO for item position responses
src/Dto/ItemPositions/CreateEditItemPositionDTO.php DTO for creating/editing item positions
src/Dto/ItemPositions/OfferItemPositionDTO.php Specialized DTO with kb_offer default for offer positions
tests/Requests/Quotes/*.php 15 test files covering all quote endpoints
tests/Requests/ItemPositions/*.php 5 test files covering all item position endpoints

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 66 to 67
'is_valid_from' => now()->format('Y-m-d h:m:s'),
'is_valid_to' => now()->addDays(5)->format('Y-m-d h:m:s'),
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

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

Incorrect date format used. The format 'h:m:s' uses 12-hour format (h) instead of 24-hour format (H), and 'm' represents months instead of minutes (i). The correct format should be 'Y-m-d H:i:s' for datetime strings.

Copilot uses AI. Check for mistakes.
'positions',
]);

$filteredQuote->put('positions', $this->filterPositions($quote->get('positions')));
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

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

Potential bug when positions is null. The method filterPositions expects a Collection but $quote->get('positions') can return null since positions is nullable in QuoteDTO. This will cause a fatal error. Consider adding a null check: $filteredQuote->put('positions', $quote->get('positions') ? $this->filterPositions($quote->get('positions')) : null);

Suggested change
$filteredQuote->put('positions', $this->filterPositions($quote->get('positions')));
$filteredQuote->put('positions', $quote->get('positions') ? $this->filterPositions($quote->get('positions')) : null);

Copilot uses AI. Check for mistakes.
@StanBarrows StanBarrows marked this pull request as draft November 27, 2025 14:33
@StanBarrows StanBarrows changed the title Feature Quotes Feature Quotes & Updated Item Positions Nov 28, 2025
@StanBarrows StanBarrows marked this pull request as ready for review November 28, 2025 09:57
@StanBarrows StanBarrows merged commit 08a7f20 into main Nov 28, 2025
11 checks passed
@StanBarrows StanBarrows deleted the feature-quotes branch November 28, 2025 09:57
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.

2 participants