phlippieb / daily-budget-app

A simple SwiftUI/iOS app to view your daily budget allowance
GNU General Public License v3.0
1 stars 0 forks source link

Refactor data modeling system #46

Open phlippieb opened 5 months ago

phlippieb commented 5 months ago

Specifically, find a more elegant solution than the current fix at #39

The current relationship between the container, budgets, and expenses is ambiguous. An expense needs to be present in the container AND in a budget. If it's not properly set up, it can still work correctly, but updates won't propagate.

Instead, consider making the container the only "owner" for expenses, and inverting the link, so that an expense knows which budget it has. Use a @Query statement to get all expenses related for budget.