-
Notifications
You must be signed in to change notification settings - Fork 3
Feature Quotes & Updated Item Positions #55
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 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.
| 'is_valid_from' => now()->format('Y-m-d h:m:s'), | ||
| 'is_valid_to' => now()->addDays(5)->format('Y-m-d h:m:s'), |
Copilot
AI
Nov 27, 2025
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.
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.
| 'positions', | ||
| ]); | ||
|
|
||
| $filteredQuote->put('positions', $this->filterPositions($quote->get('positions'))); |
Copilot
AI
Nov 27, 2025
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.
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);
| $filteredQuote->put('positions', $this->filterPositions($quote->get('positions'))); | |
| $filteredQuote->put('positions', $quote->get('positions') ? $this->filterPositions($quote->get('positions')) : null); |
No description provided.