-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monthly recurring expenses and income #30
base: dev
Are you sure you want to change the base?
Conversation
Authenticate once screen appear
I added an automatic version but I don't know if .onAppear() {} on the NavigationView in ExpenseView is the right way |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can reuse the same model and files instead of duplicating. You just need to add a new frequency
var in DataModel and update design accordingly. I'd recommend creating a new branch from main to implement this as the current one takes a different approach.
import Foundation | ||
import CoreData | ||
|
||
public class MonthlyTransactionCD: NSManagedObject, Identifiable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of new model, we can use the existing model ExpenseCD with frequency
enum. Which can store values such as { onetime, monthly }
. Use this frequency val to query.
Also we don't need a separate button (Add income every month) to create recurring expense. Let's add a toggle which can update the frequency value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a possibility that this feature will be included in the app in the App Store? I ask myself this question because you mentioned that this is a different approach. However, I will start working on it.
@@ -11,6 +11,7 @@ import CoreData | |||
class AddExpenseViewModel: ObservableObject { | |||
|
|||
var expenseObj: ExpenseCD? | |||
var monthlyTransactionObj: MonthlyTransactionCD? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this to use single model (refer above comment).
I have created the first version of this function, but the function is not ready yet. The functionality works as shown in the video below. I need a little more time to make it work automatically and to make the function compatible with images. I have commented out the corresponding code, because when a monthly transaction is made the following message comes:
CoreData: debug: PostSaveMaintenance: fileSize 12347672 greater than prune threshold CoreData: debug: PostSaveMaintenance: incremental_vacuum with freelist_count - 1491 and pages_to_free 298 CoreData: annotation: PostSaveMaintenance: wal_checkpoint(TRUNCATE)
. But I wanted to show you some of my code to get some initial feedback. I want to know if this way of linking the view models to the new core data entity is the right one or if you might have some other ideas. #29 Thank you for the opportunity to contribute.
MonthlyTransactions1.mp4