Backend — Tracker model, refactor Purchase → Entry #32
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#32
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?
Update backend models, controllers, and routes to match the new schema from #31.
Models
Trackermodel:belongsTo User,belongsTo Asset (nullable),hasMany Entry,hasMany MilestonePurchase→Entry: update fillable/casts (shares→quantity,price_per_share→unit_price)Milestone: addtracker_id, scope queries to trackerUser: dropasset_id,price_tracking_enabled; addhasOne TrackerAsset: removeusers()relationshipControllers
PurchaseController→EntryController, update all field namesAssetController::current()/setCurrent()withTrackerControllerTrackerController:show(get active tracker),store(create tracker during onboarding),update(update label/unit/asset/price_tracking)PricingController: scope totracker->asset_idMilestoneController: scope to trackerRoutes (flat — active tracker resolved server-side)
GET/POST /tracker— show/create active trackerPATCH /tracker— update tracker (label, unit, asset, price_tracking_enabled)GET/POST /entries,DELETE /entries/{entry}— replaces/purchasesGET/POST /milestones— scoped to tracker/pricing/*unchanged, scope internallyDesign decisions
User::default()->trackerresolves the active tracker everywhereUser::first()pattern unchanged for now