Skip to main content

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-wizard to 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 mysqldump in storage/app/backups/ before starting any truncations.
    • Contains an interactive guide prompting for primary Supplier details and initial Bank Account setups when installing fresh.
  • Activity Log Diff Command (app/Console/Commands/ActivityLogDiffCommand.php)
    • Created activity-log:diff utility console command, displaying formatted field-level differences (old vs new attributes) for audit log entries.
  • Bin Weight Repository (app/Repositories/BinWeightRepository.php)
    • Added repository methods getBinWeightByAddress and getBinWeightByAddressParamBinWights to resolve yard-based container tare weights.
  • Supplier Day Off API Check (app/Http/Controllers/Api/CheckDayOffController.php)
    • Added endpoint route api/check-day-off verifying if a selected order date falls on a supplier's non-delivery day (NonDelivery model).
  • 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_type string column (default 'percentage') inside order_invoices table.
  • Unit & Feature Test Drafts (tests/)
    • Added tests/Feature/Apis/CheckDayOffTest.php with safe DatabaseTransactions testing mode.
    • Added tests/Unit/Repositories/BinWeightRepositoryTest.php to validate address-based tare weight calculation.

Changed

  • Task & Bin Weight Integration (app/Http/Controllers/Admin/TaskController.php, app/Repositories/TaskRepository.php)
    • Swapped local database queries with BinWeightRepository::getBinWeightByAddress when loading tare weight information on task views and runsheet builders.
  • 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_percent and is_gst_include options across change-over order details.
    • Filtered front-bin contract invoice views to active details (status_id = 1).
  • Enhanced Address Search Matchers (app/Repositories/RentalBin.php, app/Repositories/BinLocationRepository.php, app/Order.php)
    • Replaced simple string filters with robust raw SQL CONCAT_WS constructs to search address parameters (unit, street number, postcode, suburb, state) combined.
  • Cancellation Fees (app/Http/Controllers/Admin/OrderCancelController.php, app/OrderInvoice.php)
    • Integrated the new cancellation_fee_type toggle, allowing administrators to define credit note fees either as a dynamic percentage or as a flat nominal amount.
  • 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.
  • API Routing (routes/api.php)
    • Declared the public check-day-off endpoint.

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.
  • 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).

Removed

  • None. No files or modules were deleted or deprecated.