Repository navigation
Release v0.1.0 - #13
Merged
Merged
Conversation
Backend fixes:
- [B1] Fix WarehouseDockController class name (was WarehouseSectionController)
- [B2] Fix PurchaseOrder resource orde_date_at typo -> order_date_at; add order_number alias for public_id
- [B3] Fix SalesOrder resource orde_date_at typo -> order_date_at; add order_number alias for public_id
- [B4] Rename WarehouesDock.php -> WarehouseDock.php (filename typo fix)
- [B5] Rename SuplierFilter.php -> SupplierFilter.php (filename typo fix)
- [B6] Fix PurchaseOrderController payload key: purchaseOrder -> purchase_order
- [B7] Fix SalesOrderController payload key: salesOrder -> sales_order
- [B8] Fix Audit model User namespace: App\Models\User -> Fleetbase\Models\User
Add HasPublicId trait, SoftDeletes, align fillable with actual DB schema
- [B9] Add all missing WMS fields to Inventory resource (status, bin_location_uuid,
zone_uuid, lot_number, serial_number, uom, reserved_quantity, available_quantity,
max_quantity, reorder_point, unit_cost, received_at, last_counted_at)
- [B10] Fix PalletServiceProvider error messages (Storefront -> Pallet)
- [B11] Fix InventoryController::createRecord - explicitly set batch_uuid on inventory
record; add received_at timestamp; improve batch_number generation
- [B12] Fix StockAdjustment resource - use incrementing_id; add missing fields
(inventory_uuid, warehouse_uuid, reason, notes, adjustment_type)
- [B13] Create missing Audit HTTP Resource class
Frontend fixes:
- [F1] Build out Audit model with all attributes, relationships, and computed properties
- [F2] Build out AuditsIndexController with columns, search, queryParams, and tracking
- [F3] Fix routes.js - add index sub-routes to audits, reports, and batch parent routes
- [F4] Build out audits/index.hbs template with Layout::Resource::Tabular
- [F5] Fix inventory model - add all missing WMS fields (bin_location_uuid, zone_uuid,
lot_number, serial_number, uom, reserved_quantity, available_quantity, max_quantity,
reorder_point, unit_cost, received_at, last_counted_at, isLowStock, isExpired)
Fix supplier relationship type (vendor -> supplier)
- [F6] Fix purchase-order model - add order_number, order_date_at, currency, meta attrs
Fix supplier relationship type (vendor -> supplier)
- [F7] Fix sales-order model - add order_number, currency, meta attrs
Fix supplier relationship type (vendor -> supplier)
- [F8] Fix inventory-form-panel.hbs - fix @onchange on Supplier ModelSelect
(was passing string value, now correctly uses fn (mut ...))
- [F9] Fix @isResizeble typo -> @isResizable across ALL form panel components:
inventory, warehouse, supplier, purchase-order, sales-order, batch,
product, stock-adjustment, warehouse-editor
- [F10] Create addon/serializers/audit.js
- [F11] Complete translations/en-us.yaml - add all ~120 missing translation keys
across resource, common, product, inventory, warehouse, supplier,
purchase-order, sales-order, batch, and audit namespaces
## What changed
### Backend
**Migration (modified, not new)**
- Refactored pallet_audits table: added event_type column (indexed), renamed
auditable_uuid/type to subject_uuid/subject_type for clarity, added
scheduled_at/completed_at for time-bounded events, added composite indexes
on (company_uuid, event_type) and (subject_uuid, subject_type)
**New: AuditEventType constants class**
- Defines all machine-readable event type keys: stock_adjustment, cycle_count,
po_received, so_fulfilled, stock_transfer, inventory_created, batch_created, etc.
**New: HasOperationalAuditTrail trait**
- Reusable trait any Pallet model can use to call logAuditEvent()
- Automatically captures company_uuid, performed_by_uuid, subject, and meta
**New: AuditService**
- Centralised service for programmatic audit logging from controllers
- Provides log() and logForModel() helpers
**Refactored: Audit model**
- Now immutable (no direct create/update/delete via API)
- Added event_type, subject_uuid/type, scopes (byEventType, bySubject, recent)
- Added SoftDeletes, HasPublicId, correct Fleetbase User namespace
**Refactored: AuditController**
- Now read-only: index() and show() only
- Added eventTypes() endpoint: GET /pallet/v1/audits/event-types
- Filters by event_type, subject_type, performed_by_uuid, date range
**Refactored: Audit HTTP Resource**
- Returns event_type, subject_label, action, reason, meta, performedBy
**Refactored: routes.php**
- Replaced generic fleetbaseRoutes('audits') with explicit read-only routes
- Added GET /pallet/v1/audits/event-types endpoint
**WMS model integrations**
- StockAdjustment: logs STOCK_ADJUSTMENT event on created()
- CycleCount: logs CYCLE_COUNT event on complete() and approve()
- PurchaseOrder: markAsReceived() logs PO_RECEIVED event
- SalesOrder: markAsFulfilled() logs SO_FULFILLED event
- StockTransfer: logs STOCK_TRANSFER event on ship() and receive()
**Spatie LogsActivity added to 8 primary models**
- Product, Inventory, Warehouse, Supplier, Batch, PurchaseOrder, SalesOrder,
StockAdjustment now all use LogsActivity with logOnly() + logOnlyDirty()
- Consistent with how core-api handles User, Alert, File, etc.
### Frontend
**Audit model**
- Updated to use event_type, subject_uuid/type instead of auditable_uuid/type
- Added eventTypeLabel, subjectLabel, eventTypeBadgeClass computed properties
- Added createdAgo with addSuffix option
**Audits/index controller**
- queryParams updated: event_type + subject_type replace auditable_type
- Columns updated: Event Type, Action, Subject, Subject ID, Reason, Performed By, Date
- Added eventTypeOptions array for dropdown filter
- Added filterByEventType() and clearFilters() actions
**Audits/index template**
- Added event type filter dropdown in subheader slot
- Added clear filters button (shown when any filter is active)
- Set @Cancreate=false and @canDelete=false (immutable trail)
**Audit serializer**
- Removed createdBy embedded relation (no longer in schema)
**Translations**
- Expanded audit section with event-types, filter labels, search placeholder
- Added common.clear_filters and common.no-records keys
Backend: - Add migration: purchase_order_items and sales_order_items tables with full schema: product_uuid, warehouse_uuid, quantity, quantity_received/ quantity_fulfilled, outstanding_quantity, unit_price, unit_cost, total_price, currency, sku, lot_number, serial_number, expiry_date, unit_of_measure, status, notes, meta, received_at/fulfilled_at - Add PurchaseOrderItem model with recalculateTotalPrice(), relationships to Product, Warehouse, PurchaseOrder; LogsActivity trait - Add SalesOrderItem model with recalculateTotalPrice(), relationships to Product, Warehouse, Inventory, SalesOrder; LogsActivity trait - Add hasMany items() + item_count/total_value aggregates to PurchaseOrder model - Add hasMany items() + item_count/total_value aggregates to SalesOrder model - Add PurchaseOrderItemController (index, store, update, destroy) - Add SalesOrderItemController (index, store, update, destroy) - Add PurchaseOrderItem and SalesOrderItem HTTP Resources - Update PurchaseOrder resource to include items, item_count, total_value - Update SalesOrder resource to include items, item_count, total_value - Add nested item routes: GET/POST/PUT/DELETE for both PO and SO items Frontend: - Add purchase-order-item Ember model with all attributes + computed helpers - Add sales-order-item Ember model with all attributes + computed helpers - Add hasMany items + item_count/total_value to purchase-order Ember model - Add hasMany items + item_count/total_value to sales-order Ember model - Add purchase-order-item and sales-order-item serializers - Update purchase-order and sales-order serializers to embed items - Add purchase-order-panel/items tab component (HBS + JS) with: - Inline add row with product ModelSelect, SKU, quantity, unit price - Inline edit row per item - Read-only rows showing product, SKU, qty, qty received, unit price, total - Status badge per item - Delete per item - Disabled when order is received/cancelled - Add sales-order-panel/items tab component (HBS + JS) with same pattern (qty fulfilled instead of qty received) - Wire Items tab into purchase-order-panel and sales-order-panel components - Expand translations: purchase-order.line-items.* and sales-order.line-items.*
Backend:
- PurchaseOrderController: full receive() action with DB transaction,
line-item iteration, inventory create/increment, lot/serial/expiry/bin
tracking, PO status transition (partial/received), audit trail logging
- SalesOrderController: full fulfill() action with pre-flight stock check,
FEFO inventory selection, available_quantity deduction, SO item status
tracking, SO status transition (partial/fulfilled), audit trail logging
- routes.php: POST purchase-orders/{id}/receive and sales-orders/{id}/fulfill
Frontend:
- receive-purchase-order-form-panel: order summary, per-item receipt rows
with ordered/received/outstanding quantities, lot/expiry/notes inputs,
submits to API, calls onReceived callback on success
- fulfill-sales-order-form-panel: order summary, FEFO notice, per-item
fulfillment rows with ordered/fulfilled/outstanding quantities, notes
input, submits to API, calls onFulfilled callback on success
- context-panel.js: registered receiving intent for purchaseOrder and
fulfilling intent for salesOrder
- purchase-orders/index.js: receivePurchaseOrder() action, improved columns
- sales-orders/index.js: fulfillSalesOrder() action, improved columns
- translations/en-us.yaml: added receive and fulfill translation keys
…emplates
Both purchase-order-panel/items.hbs and sales-order-panel/items.hbs had
the {{#if (eq this.editingItem.id item.id)}} block incorrectly closed
with {{/each}} instead of {{/if}}, with the {{/each}} for the outer
each loop also missing. This caused a Babel build error:
'if doesn't match each - 28:23'
Fixed both files:
- {{/each}} on line 89 replaced with {{/if}}
- {{/each}} added on line 90 to correctly close the outer each loop
- extension.js: register 'pallet' dashboard via widgetService.registerDashboard()
and 8 widgets via widgetService.registerWidgets() using correct Widget +
ExtensionComponent pattern (Widget/ExtensionComponent from @fleetbase/ember-core/contracts)
Removed unused Hook import. Default widgets: inventory-summary, low-stock,
po-status, so-status, recent-activity. Optional: stock-value, expiring-stock,
top-products.
- templates/home.hbs: replaced bare {{outlet}} with <Dashboard> component using
@defaultDashboardId='pallet', @defaultDashboardName='Pallet Dashboard',
@extension='pallet' inside <Layout::Section::Body> with overflow scroll.
Frontend widget components (widget/ namespace):
- widget/inventory-summary: 5-KPI banner (SKUs, units, value, warehouses, low-stock)
- widget/low-stock: table of products at/below min_stock_level
- widget/po-status: 4-status badge grid + recent PO list
- widget/so-status: 4-status badge grid + recent SO list
- widget/recent-activity: scrollable audit trail feed with event icons
- widget/stock-value: horizontal bar chart of value per warehouse
- widget/expiring-stock: table of batches expiring within 30 days
- widget/top-products: ranked bar chart of most-moved products
Backend:
- MetricsController: 7 read-only endpoints (inventory-summary, low-stock,
po-status, so-status, stock-value, expiring-stock, top-products), all scoped
to session company_uuid
- routes.php: added metrics prefix group with all 7 endpoints under
fleetbase.protected middleware
PHP fatal error: 'Cannot declare class CreateOrderItemsTables, because the
name is already in use' was caused by a naming conflict with another package
that registers a migration class with the same name.
All 14 named-class migrations have been converted to the anonymous class
pattern (return new class extends Migration { ... };) which is the modern
Laravel standard and completely eliminates cross-package class name conflicts.
The 2024_11_06_create_wms_tables.php and 2024_11_07_create_order_items_tables.php
files were already using the anonymous pattern and were left unchanged.
pallet_purchase_order_items and pallet_sales_order_items were referencing 'pallet_products' and 'pallet_warehouses' which do not exist as standalone tables. The correct backing tables are: - pallet_products → 'entities' (Product extends FleetOps Entity) - pallet_warehouses → 'places' (Warehouse extends Fleetbase Place) The 'pallet_inventory' reference on sales_order_items is correct and unchanged. All other Pallet migrations already use the correct 'entities' and 'places' table names consistently.
pallet_sales_order_items referenced 'pallet_inventory' but the actual
table created by the inventory migration is 'pallet_inventories' (plural).
Fixed: ->on('pallet_inventory') → ->on('pallet_inventories')
…et_warehouses table - Create new pallet_warehouses migration with WMS-specific fields: code, type, status, capacity, current_utilization, floor_area_sqm, operating_hours, timezone, phone, email, manager_uuid, total_docks, is_active, is_default, meta, place_uuid (FK to places table) - Update 8 existing migrations to reference pallet_warehouses instead of places for warehouse_uuid foreign keys - Rewrite Warehouse PHP model to extend Model (not Place) with: - place_uuid belongsTo(Place) for geographic/address data - company(), createdBy(), manager() relationships - All WMS hasMany relationships preserved - getAddressAttribute() proxy to linked Place - getTotalInventoryValue() using entities table - Update WarehouseController to create/update linked Place from address fields on create/update operations - Rewrite WarehouseResource to proxy address fields from linked Place and include new WMS-specific fields (code, type, status, capacity, utilization_percentage, floor_area_sqm, operating_hours, etc.) - Update WarehouseFilter to remove type=pallet-warehouse constraint and add proper type/status/isActive filter methods - Update 9 Pallet models to use Warehouse class instead of FleetOps\Place for warehouse_uuid relationships: Inventory, WarehouseSection, WarehouseDock, WarehouseZone, BinLocation, CycleCount, StockTransfer, PickList, Wave, InventoryReservation - Rewrite Ember warehouse model to extend Model (not PlaceModel) with all WMS attributes, place belongsTo, and computed properties - Update warehouse serializer to embed place, sections, docks, zones - Update warehouse-form-panel with two content panels: 'Warehouse Details' (name, code, type, status, capacity, phone, email, is_active, is_default) and 'Address' (street, city, etc.) - Update warehouse/details.hbs to show new WMS fields (code, type, status, is_active) replacing the old is_3pl field - Expand translations with new warehouse field keys (code, type, status, is-active, is-default, email, phone, floor-area, timezone, total-bins, total-docks, total-zones, utilization) and add common.active/inactive keys
- align ember-concurrency to ^4.0.6: committed pnpm-lock.yaml resolved 4.0.6 against specifier ^3.1.1, so 'pnpm install --frozen-lockfile' (the CI install step) failed on this branch; lockfile regenerated, frozen install verified - composer test:unit now self-heals a vendor -> server_vendor symlink: pest's binary resolves vendor/autoload.php relative to itself, so the renamed vendor-dir made 'composer test:unit' unrunnable as shipped - run pest with E_DEPRECATED suppressed so the EOL pest v1 stack boots on PHP 8.4 (CI's PHP 8.2 unaffected) - ignore /vendor (compatibility symlink) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- add orchestra/testbench ^8.36 (blocker: core-api controllers need Illuminate\Foundation, which only laravel/framework provides; no container existed for request()/session()/config() so the suite could not run at all) - upgrade pest ^1 -> ^2.33 + collision ^7 (matches core-api's own dev harness; the EOL pest 1 stack breaks on PHP 8.4 once Laravel's error handler re-enables deprecations) - server/tests/TestCase.php: Testbench app on a shared per-process SQLite file; the mysql connection aliases to it because core models pin $connection = 'mysql'; shims for core tables (companies, users, places, files, ...) whose real migrations are MySQL-only; runs Pallet's own migrations. MySQL-only contracts go to the MySQL lane. - server/tests/Pest.php binds the TestCase; runner passes --test-directory server/tests (pest resolves Pest.php from there) - rename Feature.php -> FeatureTest.php and tighten phpunit discovery to suffix Test.php (bare .php ingested Pest.php/TestCase.php as tests); migrate phpunit.xml.dist to the PHPUnit 10 schema - make migration up/down paths SQLite-safe: split multi-column drops into one call each, skip dropForeign on sqlite (identical behavior on MySQL); rollback now runs green every test teardown - pin runner flags: xdebug.mode=off (9x faster), memory_limit=512M, E_DEPRECATED suppressed composer test:unit: 18 passed (64 assertions) in ~30s — first green backend suite on this package. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
getDisplayNameAttribute() declares : string but fell through to public_id, which is null on unsaved/partial records — TypeError. Terminal fallback is now an empty string. Caught by the existing resource-contract test once the suite became runnable. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Three changes, on this working branch rather than a separate one as requested. Only these three files are staged — the in-progress addon edits are left alone. 1. release.yml delegates to the reusable workflow in fleetbase/fleetbase, which validates and pushes the tag when a dev-v* branch merges to main. The version is never retyped: it comes from the branch name, and the tag is refused unless composer.json, package.json, extension.json and RELEASE.md already agree with it. 2. create-release.yml is NEW. pallet was the only module without one, so tagging it published to npm and GitHub Packages and created no GitHub Release at all. Copied from the other modules, with body_path: RELEASE.md so the notes are the release body, matching fleetbase/fleetbase. 3. RELEASE.md is seeded, because the tag workflow refuses to release without notes whose first line names the version. Both placeholder markers must be replaced before a release will go through — that guard exists so the template itself can never be published as the release notes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…guard - add @ember/legacy-built-in-components ^0.4.2 (devDep): ember-engines 0.9's LinkToExternal extends @ember/routing LinkTo, which is not a constructible class on Ember 5.4 — the whole test suite failed at boot with 'Class extends value [object Object]'. With the package present (same peer resolution as fleetops and the console) ember-engines takes its legacy LinkComponent branch and the suite executes. - pallet-engine.css: split two multi-layer background shorthands into longhands — clean-css v3 (ember-engines css pipeline) crashes parsing 'gradient position / size, color' shorthand, which broke the production build. Identical rendering. - tests/test-helper.js: QUnit testTimeout 30s — a hung await previously wedged the suite for 90+ minutes with no output. Production build verified green; test suite now runs (failures are pre-existing placeholder tests, tracked for the coverage phase). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…port Three production defects, each with regression coverage: - StockTransfer::cancel() on an in_transit transfer only flipped status — stock deducted by ship() was permanently lost. Cancel now restores source-warehouse stock in a transaction with row locks and records a transfer_cancelled ledger entry + audit event. (StockTransferTest) - the stock ledger was unwritable and unreadable: recordStockTransaction() inserts transaction_date_at but the table never had the column (every ledger insert failed), and Inventory::transactions() joins on inventory_uuid which also didn't exist. Repair migration adds both plus a transaction_type index; StockTransaction gains real casts, relations, and HasPublicId; the writer now populates inventory_uuid. - Warehouse + WarehouseController imported Fleetbase\Models\Place, which doesn't exist (Place lives in Fleetbase\FleetOps\Models) — the place() relation and address accessors fatally errored whenever touched. Harness: TestCase now registers responsecache/activitylog providers (inert in tests) and applies core-api's class expansions (Str::humanize etc.) so model save paths run like production. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
composer test:lint now passes in check mode. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Stock-correctness fixes, each with regression tests:
- CycleCount::approve() applied per-item adjustments in independent
transactions; a mid-loop failure (reserved-stock guard) left earlier
adjustments committed with the count still 'completed'. The whole
approval — every adjustment plus the status change — is now one
transaction. CycleCountItem::recordCount() also now requires the parent
count to be in_progress.
- PurchaseOrderController::receive() read the PO line item and inventory
row without locks inside its transaction — concurrent receipts could
exceed outstanding_quantity. Both reads now lockForUpdate.
- StockAdjustmentController::resolveInventory() same unlocked
read-modify-write — now locked.
- InventoryReservation::release()/fulfill() checked status on the
in-memory instance only; a stale instance could release or commit
stock twice. Both now re-read the row under lock inside the
transaction. InventoryReservationController::createRecord() returned
an error response from inside its transaction closure (committing
instead of rolling back) — it now throws.
- reordered catch blocks in Warehouse/Inventory/SalesOrder/PurchaseOrder
controllers where catch \Exception preceded the specific handlers,
making them unreachable.
Test harness: the default DB connection is now the same connection NAME
models pin ('mysql') — connection names get separate PDO handles, so
DB::transaction() on a different default never covered model writes;
atomicity tests were silently meaningless before this.
Suite: 31 passed (110 assertions), stable across 3 consecutive runs.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…, link uniqueness - StorefrontInventoryController::unlink() saved the product and cleared variant links non-atomically — now one transaction - InventoryController::createRecord() created a Batch then an Inventory with no transaction — a failed inventory save orphaned the batch - storefront link uniqueness was PHP-only; unique indexes on pallet_products.storefront_product_uuid and pallet_product_variants.storefront_variant_uuid now backstop the race (single-id storefront release/commit and batch transitions were already covered by the locked in-transaction re-check added to InventoryReservation::release/fulfill) Suite: 34 passed (118 assertions). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The unsummarised listing returned 500: "syntax error near 'from `pallet_inventories`'". The controller's `array_shift($queryBuilder->columns)` hotfix drops a column that summarizeByProduct then replaces with its own aggregates. On the plain listing nothing puts it back, so the query went out as `select from pallet_inventories`. Moved inside the branch that needs it. The panel also said the wrong thing while that was happening. It reported "not stocked in any warehouse" — a claim about the data — when the request had failed and it knew nothing about the data at all. An error and an empty result are different answers and no longer share a branch. That is the trap I named two iterations ago about the report builder, built into my own component this time: a screen that reports nothing rather than something wrong sends you looking in the wrong place. It cost three commits here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every quantity in IndexInventory reads an alias that Inventory::scopeSummarizeByProduct produces — total_quantity, total_reserved_quantity, minimum_quantity and the rest. The same controller now also serves the unsummarised listing, where none of those aliases exist, so a per-warehouse row reported 0 on hand, 0 reserved and 0 available for stock that is plainly there. Zero looks like an answer. The warehouse names were right, the numbers were wrong, and nothing distinguished "this warehouse holds none" from "this field was never selected" — the fourth time this loop has turned on that distinction. Each field now falls back to the column it aggregates. The summarised listing is unchanged: where the alias exists it still wins. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The reservations list could not name the order a reservation belonged to. The
model has carried sales_order_uuid and a salesOrder relation since the WMS
refactor, and the relation has been in the model's $with the entire time — so
the order was loaded on every query and the resource emitted nothing but a raw
uuid. §F's Sales Order column was left out because a column of uuids is worse
than no column at all.
The eager load was worse than useless. SalesOrder's own $with is customer,
warehouse, items.product, items.variant, items.warehouse and items.inventory,
so listing reservations hydrated an entire order and its whole line-item tree
per row, then threw all of it away. The relation now uses withOnly([]) — the
order itself, nothing beneath it.
The resource emits a reference rather than the SalesOrder resource. That
resource renders items through whenLoaded('items', $this->items ?? []), whose
second argument PHP evaluates before whenLoaded can decide anything, so it
lazy-loads the items and would have put a full order tree on every row.
Rendered through cell/related-record, already used for three columns on the
adjustments list, so an order deleted after the stock was held reads as such
instead of as a reservation that was never held for anything. The serializer
needed the same underscore bridge inventory.js needed for bin_location:
ember-core's ApplicationSerializer calls keyForRelationship without defining
it, so sales_order never reaches salesOrder and the column reads blank.
Verified against the running instance: reservation_q1l2j2ab49 now reports
SO-6A89F293F2F35, the two unlinked reservations render a dash, and listing all
three costs one sales-order query and zero line-item queries.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tion show what a reservation is being held for
Ember CI failed at Lint with 92 stylelint errors, all in pallet-engine.css. PHP
CI failed at php-cs-fixer with three files. Neither workflow had ever reached
its later steps, so nothing behind those gates had been exercised.
The stylelint errors were four kinds:
52 selector-class-pattern thirteen classes written in BEM (__element,
--modifier) among the ~50 plain kebab-case ones
in the same file. Renamed, with their templates.
.svg-inline--fa is FontAwesome's own generated
class and is not ours to rename, so its three
rules carry a scoped disable instead.
29 no-descending-specificity mostly selector lists ordering .dark after
body[data-theme='dark']. Reordering within one
list cannot change anything — every selector in
it shares the declaration block.
5 no-duplicate-selectors four selectors each split across two or three
rules with disjoint properties. Merged.
6 auto-fixable empty lines, and overflow-x/y as a shorthand.
Nine rules were `body[data-theme='dark'] X` duplicating the `[data-theme='dark']
X, .dark X` rule directly above with identical declarations. Folded in. The
body-prefixed form was always redundant: [data-theme='dark'] X already matches
everything body[data-theme='dark'] X does.
Two exceptions remain, both bare `div` key selectors ranked below a rule from
another component that sets different properties. Hoisting them ~300 lines to
satisfy source order would split their own component blocks apart.
Every one of the 243 selectors resolves to identical declarations before and
after, checked with postcss — the one intended difference is the overflow
shorthand.
PHP CI's three files were unused imports, import order, and increment style,
all from earlier commits of mine on this branch. php-cs-fixer --fix.
Behind that gate, phpstan level 0 found a real bug: the public sales order API
imported Fleetbase\Models\Contact, which does not exist. Contact lives in the
FleetOps package and every other file in Pallet says so. Contact::where() would
have thrown at runtime; Contact::class did not throw at all, because ::class is
resolved by the compiler as a literal string, so it silently wrote a
customer_type no other code reads back. Tests cover both halves.
324 tests pass, up from 322. stylelint, eslint and php-cs-fixer are clean.
phpstan above level 0 is unresolved and reported separately.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PHP CI's static analysis step has been red since the config was added and had
never once passed: 2752 errors at level max. Almost none were defects. PHPStan
cannot see Eloquent — Model::where(), $model->uuid, $order->items and every
relation read are undefined symbols to it — so the analysis was reporting the
framework, and the real findings were buried.
Four changes make it see the framework:
larastan the Eloquent extension. On its own it removed only 15%
(2752 -> 2330): in a package with no bootable app it
cannot infer model properties from the database.
@Property blocks generated for all 28 models from the table schema, the
model's casts and its relations. 602 columns.
@mixin on all 45 API resources. A JsonResource forwards unknown
properties to the model it wraps through __get, and
naming that model is what lets the analysis follow it.
This was the big one: level 1 went 973 -> 30.
return types on 125 relation methods. larastan resolves relations from
the return type, so without them ->with('variant') was
reported as a relation that does not exist.
Level 1 across the whole tree, down from 2752 at max / 1401 at level 1:
level 1: 0 level 2: 77 level 3: 230
level 4: 238 level 5: 238 level 6: 737
Level 1 is where "this method does not exist" and "this property does not
exist" are enforced, and it immediately found a live bug: SupplierFilter::query()
called $this->scopeToPalletSuppliers(), a method renamed to the scopeToCompany()
override in 3c52444 with this one call site missed. Every search on the
suppliers list raised "Call to undefined method". The listing worked, so only
typing in the search box hit it, and nothing exercised that path.
Six fields the API emits that no model can supply are listed in ignoreErrors
rather than silenced, each with what is actually wrong. reportUnmatchedIgnoredErrors
is on, so fixing one fails the config until its entry goes. The worst is
photo_url: pallet_products has photo_uuid and no accessor for a url, while the
console renders @resource.photo_url in three places — a product photo shows
after upload and is gone on the next load.
325 tests pass, up from 324. composer test:lint, test:types and test:unit are
all green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Each of these was a resource reading a property no model had. A JsonResource
forwards unknown properties to its model through __get and gets null back — no
error, no warning, just a field that is never populated. They were listed in
phpstan.neon.dist last commit; they are fixed here and the ignoreErrors block
is gone, so level 1 now passes with nothing suppressed.
photo_url (both Product resources)
pallet_products has photo_uuid and no url column, and nothing derived one.
The console reads photo_url in eleven places — the product pill, the panel
header, the details panel, the catalogue list and three inventory lists —
and the upload form sets photo_uuid and photo_url on the record as soon as
a file is chosen. So a photo appeared the instant it was uploaded and was
gone on the next load, falling back to the placeholder every time.
Product now has the photo relation the console already assumed, and
photo_url reads through it. Eager-loaded, because appending it would
otherwise lazy-load one file per row on seven different lists. Null rather
than a placeholder when there is no photo: every caller supplies its own
fallback and they differ.
incrementing_id (Audit, StockAdjustment resources)
Both tables have an id column; neither model appended it, so the `id` the
resources emit for internal requests was null on every row. Harmless only
because the Ember serializer keys records on uuid.
currency (SalesOrder resource) and customer_reference_code (PurchaseOrder)
pallet_sales_orders has customer_reference_code and no currency;
pallet_purchase_orders has currency and no customer_reference_code. Both
internal resources emitted both. The public v1 resources have the split
right, which is what gives the copy-paste away. A purchase order has a
supplier, not a customer, so customer_reference_code was never meaningful
there. Also dropped currency from the sales order's activity log options,
which was watching an attribute that cannot change.
The line items carry their own currency, so the sales order panel's total
is denominated from them instead of from the order's absent field.
Product::getIncrementingIdAttribute() re-selected the id already on the row,
one query per product on every list that appends it. It reads the attribute now.
Six tests, five of which fail without these changes; the sixth guards against
substituting a placeholder image for a missing photo. Verified against the
running instance inside a rolled-back transaction: linking a real file to a
real product produced its url, and both order resources emit only their own
column. 331 tests pass, up from 325.
The files shim in the test harness gained the slug column File writes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Pallet's CI has run Node 22.x everywhere since it was written — the ember workflow sets NODE_VERSION: 22.x for all three of its jobs — while package.json claimed ">= 18". The console, which loads this engine, already requires ">= 22". Nothing here still supports 18, so the declaration was the only thing out of date. .nvmrc pins the same major for local shells: without it a machine with several Node versions installed will happily pick an old one, which is exactly what happened while investigating the ember test failures — the suite was being run on 18.15.0 against a package built for 22. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Match fleetops: pull_request triggers now also fire for PRs targeting release/v* and dev-v* branches, so work merged into a release branch is tested before the release branch itself is merged to main.
Pallet Working Release
Pins expiry day counts as absolute integers so they read the same on Carbon 2 and 3. Based on release/v0.0.2, because main has no diffIn calls yet.
Laravel 11+ ships a native Request::array(), which wins over core-api's macro of that name and stops it splitting comma-separated values. Needs core-api with inputArray.
Set the version in composer.json, package.json and extension.json, start RELEASE.md, and run CI on pull requests into release/v* and dev-v*.
Laravel 11+ dropped Doctrine. Three things in pallet relied on it: - add_order_number's hasIndex() called getDoctrineSchemaManager(), which no longer exists. The catch turned that into "no index", so down() never dropped the unique index and a re-run would add it twice. It now uses Schema::hasIndex(). - SQLite column drops now rebuild the table, and fail on a foreign key or index left on the column. The down() migrations skipped dropForeign on SQLite and never dropped indexes. They now drop the foreign key and index first on every driver, which is also what MySQL needs. - repair_warehouse_hierarchy_keys passed a key name to dropForeign([...]), which takes column names, so the MySQL path looked for a key that doesn't exist. It passes the column now. Tests: Pest 3 needs --test-directory server/tests (as composer test:unit passes). The SQLite lane registers a polygon() column macro, since Laravel 11 removed it from Blueprint (MySQL gets it from the spatial fork), and no longer maps Doctrine types. 334 tests pass.
…uild The engine is lazy-loaded, which keeps its modules out of the dummy app that `ember test` builds, so every test importing @fleetbase/pallet-engine/* failed to load. Eager loading is now scoped to `ember test` run from this package. ember-core 0.3.22 imports tracked-built-ins without declaring it, so the universe registry service could not be created in tests. 0.3.26 declares it.
…or removed code The dummy app now carries the API/OSRM/socket config ember-core reads at import, the prototype extensions the console enables and ember-ui depends on, a hostRouter alias, an inert @fleetbase/console/extensions module, and an ember-intl locale before first render. Tests for components and routes that no longer exist are removed, and the canonical route/controller lists follow the order details views to orders/*/details.
The integration tests were untouched ember-cli blueprints asserting an empty render, which no panel satisfies once it can load. Each now renders its component with a record and checks what it shows: form titles for new and existing records, detail headers and the default tab, context-panel focus/clear, the category list (store query stubbed), and the warehouse editor's wormholed overlay. The dummy app gains stand-ins for the console host models pallet's models relate to, and the canonical route/controller lists follow operations/* into their index and details children.
feat!: move to Laravel 12 and core-api 2.0
…ve records ember-local-storage caches storage proxies at module scope, so a later test read proxies owned by an earlier test's destroyed container. Every setup helper now resets them. The inventory form test creates the record with a batch as the inventory route does, and the form-title checks look at the overlay title rather than the whole panel, whose submit button says Add until the record is saved.
The form's custom fields resolve their owner through the current user's company, which the console always has loaded before a form can open. Also removes the temporary error-stack logging from the previous commit.
fix(tests): make the Ember test job finish and pass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release v0.1.0: the Laravel 12 release, for fleetbase/fleetbase
release/v0.8.0.This branch already sets the version in
composer.json,package.jsonandextension.json, startsRELEASE.mdwith the linerelease.ymlchecks, and runs CI on pull requests intorelease/v*anddev-v*.Merge into
release/v0.1.0firstThen finish
RELEASE.mdwith anything else that lands here.Tag after
Composer can't resolve these until they are tagged, so CI on this PR stays red until then.
Do not merge or tag until the PRs above are merged and green.