Remove asset and price-tracking subsystem #48
Labels
No labels
bug
duplicate
enhancement
good first issue
help wanted
question
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/incr#48
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Removes the stock-ticker machinery inherited from the VWCE-share origins. Already hidden from the UI in
bace06d— this deletes the code, routes and tables behind it.Scope
PHP:
app/Models/Asset.php,app/Models/Pricing/AssetPrice.phpapp/Http/Controllers/AssetController.php,app/Http/Controllers/Pricing/PricingController.phpTracker::asset()relationship;asset_idandprice_tracking_enabledcolumnsRoutes: the entire
assets.*(4) andpricing.*(4) groups inroutes/web.phpFrontend:
components/Assets/AssetSetupForm.tsx,components/Pricing/UpdatePriceForm.tsxTrackerAssetinterface andasset/price_tracking_enabledfields intypes/domain.tsOnboarding/CreateTrackerStep.tsxMigrations: new migration dropping
asset_pricesandassets, and droppingasset_id+price_tracking_enabledfromtrackers. Do not edit historical migrations.Related tickets
Closes the need for #38 (price tracking end-to-end) and #35 (settings toggle for price tracking) — both should be closed as won't-fix when this lands. They build the subsystem this removes.
Acceptance criteria
grep -ri "asset\|price" app/ routes/ resources/js/returns no product-code hitsScope reduced by #47
Two files listed here were already deleted in
d379f00:resources/js/components/Assets/AssetSetupForm.tsxresources/js/components/Pricing/UpdatePriceForm.tsxBoth were orphaned by
bace06d(v0.3.0 price-UI hiding) — nothing imported them — and they carried the only two remaining ESLint errors, so leaving them would have shipped #47 on a red branch. Since they were unreachable, they fell under #47's "delete unreachable" remit.Everything else in this ticket is unchanged: the PHP models/controllers, the
assets.*andpricing.*route groups, the schema migration, and thetypes/domain.tsfields all still need doing.Done —
671cdb611 files, −392 lines. The stock-ticker machinery is gone.
Deleted:
Asset,Pricing/AssetPrice,AssetController,Pricing/PricingController,CreateTrackerStep.tsx(orphaned since #51).Migration:
2026_08_15_000003_drop_assets_and_pricing.php— drops theasset_idFK and column plusprice_tracking_enabledfromtrackers, thenasset_prices, thenassets.Routes:
assets.*andpricing.*groups removed (8 routes).Types:
domain.tsreduced to{id, label, unit, count}.Trackeris nowuser_id,label,unit,count.Beyond the ticket
TrackerController::update()returnedback()redirects — the last redirect-based endpoint, the same pattern behind the silent-failure bug fixed in #50. Converted to JSON with a 404 for a missing tracker, matchingCounterController. Deliberate contract change; two tests added since the endpoint was previously uncovered.Caught before commit
down()initially hadasset_prices.priceasdecimal(12,4)— the original is(10,4)— and omitted three indexes (assets.symbol,asset_prices.asset_id,asset_prices.date). Corrected against the source migrations.That is the second time writing
down()from memory produced a schema mismatch (#49 had the same class of error). Lesson taken: write the round-trip test first rather than hand-checking the transcription.New tests
DropAssetsMigrationTest(4 tests) executes the migration rather than inspecting it:down()restores all threeup()afterdown()drops them again, proving the FK ordering (dropForeignbeforedropColumn;asset_pricesbeforeassets)countsurvives the round trip — the one that actually mattersFrom review
Clean pass, no blockers, no changes recommended.
It verified the FK ordering against real migration history and found the premise slightly narrower than I stated: a third FK (
users.asset_id → assets) existed historically but was already dropped in2026_05_02_000003, sotrackers.asset_idwas the only remaining reference. Conclusion unchanged.Also confirmed
price_tracking_enabledis genuinely unreferenced — the remaining grep hits are Laravel'slaravel-assetspublish tag and Inertia's asset-versioning helper, both unrelated — and that no caller expected the old redirect contract.Gates
Pint PASS (48 files) · PHPUnit OK (31 tests, 81 assertions) · ESLint exit 0 · build PASS
The #54 suite passed unchanged throughout this deletion — no regressions.
"PHPStan clean" not checked; not installed yet (#55).