2026-05-25
Daily Changelog - Waste Vantage Legacy
Overview
Today's changes focus on adding database administration tools (a new interactive setup wizard), integrating tare weight calculations, adding api checks for supplier off-days, enabling customizable cancellation fee types, and introducing more robust raw SQL address-matching search features.
Added
- System Setup Wizard Command (
app/Console/Commands/SystemSetupWizardCommand.php)- Created a new interactive CLI tool
system:setup-wizardto perform Fresh Installs (wiping databases with foreign key checks temporarily disabled) or Reset Data (wiping transaction records only). - Automatically creates a database SQL dump backup via
mysqldumpinstorage/app/backups/before starting any truncations. - Contains an interactive guide prompting for primary Supplier details and initial Bank Account setups when installing fresh.
- Created a new interactive CLI tool
- Activity Log Diff Command (
app/Console/Commands/ActivityLogDiffCommand.php)- Created
activity-log:diffutility console command, displaying formatted field-level differences (oldvsnewattributes) for audit log entries.
- Created
- Bin Weight Repository (
app/Repositories/BinWeightRepository.php)- Added repository methods
getBinWeightByAddressandgetBinWeightByAddressParamBinWightsto resolve yard-based container tare weights.
- Added repository methods
- Supplier Day Off API Check (
app/Http/Controllers/Api/CheckDayOffController.php)- Added endpoint route
api/check-day-offverifying if a selected order date falls on a supplier's non-delivery day (NonDeliverymodel).
- Added endpoint route
- Cancellation Fee Type Database Migration (
database/migrations/2026_05_06_152453_add_cancellation_fee_type_to_order_invoices_table.php)- Added migration creating the
cancellation_fee_typestring column (default'percentage') insideorder_invoicestable.
- Added migration creating the
- Unit & Feature Test Drafts (
tests/)- Added
tests/Feature/Apis/CheckDayOffTest.phpwith safe DatabaseTransactions testing mode. - Added
tests/Unit/Repositories/BinWeightRepositoryTest.phpto validate address-based tare weight calculation.
- Added
Changed
- Task & Bin Weight Integration (
app/Http/Controllers/Admin/TaskController.php,app/Repositories/TaskRepository.php)- Swapped local database queries with
BinWeightRepository::getBinWeightByAddresswhen loading tare weight information on task views and runsheet builders.
- Swapped local database queries with
- Extra Services & Refactorings (
app/Http/Controllers/Admin/FrontBins/FrontBinController.php,app/Http/Controllers/Admin/RentalBins/RentalBinsController.php)- Standardized extra services lookup using
ExtraServiceRepository. - Preserved
gst_percentandis_gst_includeoptions across change-over order details. - Filtered front-bin contract invoice views to active details (
status_id = 1).
- Standardized extra services lookup using
- Enhanced Address Search Matchers (
app/Repositories/RentalBin.php,app/Repositories/BinLocationRepository.php,app/Order.php)- Replaced simple string filters with robust raw SQL
CONCAT_WSconstructs to search address parameters (unit, street number, postcode, suburb, state) combined.
- Replaced simple string filters with robust raw SQL
- Cancellation Fees (
app/Http/Controllers/Admin/OrderCancelController.php,app/OrderInvoice.php)- Integrated the new
cancellation_fee_typetoggle, allowing administrators to define credit note fees either as a dynamic percentage or as a flat nominal amount.
- Integrated the new
- Order Rental Repository Adjustments (
app/Repositories/OrderRentalRepository.php)- Restricted weight calculations within order details to non-rental categories by introducing the checks for
is_rental == 0.
- Restricted weight calculations within order details to non-rental categories by introducing the checks for
- API Routing (
routes/api.php)- Declared the public
check-day-offendpoint.
- Declared the public
Fixed
- Task Runsheet Controller (
app/Http/Controllers/Admin/TaskRunsheetController.php)- Restored (uncommented) the try-catch block inside the
task()action, ensuring errors are logged gracefully to avoid crashing the runsheet API.
- Restored (uncommented) the try-catch block inside the
- Non-Rental First Invoice Pricing (
app/Repositories/InvoiceManagement.php)- Corrected container price leaks on first invoices generated for non-rental orders by zeroing out the initial line item details (
price,quantity,subtotal= 0).
- Corrected container price leaks on first invoices generated for non-rental orders by zeroing out the initial line item details (
Removed
- None. No files or modules were deleted or deprecated.