Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions ios/Runner/RecordTransactionIntent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,26 @@ struct RecordTransactionIntent: AppIntent {
static var title: LocalizedStringResource = "Record an Expense"
static var description: IntentDescription = "Log expenses"

@Parameter(title: "Account", description: "Exact name, or UUID of the target account")
@Parameter(title: "Account", description: "Exact name, or UUID of the target account.")
var account: String

@Parameter(title: "Amount", description: "Expense amount. Sign doesn't matter.")
var amount: Double

@Parameter(title: "Category", description: "Exact name, or UUID of the target account")
@Parameter(title: "Category", description: "Exact name, or UUID of the target account.")
var category: String

@Parameter(title: "Notes", description: "Transaction notes. Markdown supported.")
var notes: String

@Parameter(title: "Title", description: "Transaction title.")
var title: String

static var openAppWhenRun = false

func perform() async throws -> some IntentResult & ProvidesDialog {
let tx = RecordedTransaction(type: .expense, amount: amount, fromAccount: account, category: category)
let tx = RecordedTransaction(type: .expense, amount: amount, fromAccount: account, category: category, title: title, notes: notes)
try RecordedTransactionService.append(tx)
return .result(dialog: "Recorded transaction for \(account): $\(amount) in category \(category).")
return .result(dialog: "Expense recorded ✅")
}
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: A personal finance managing app

publish_to: "none" # Remove this line if you wish to publish to pub.dev

version: "0.19.0+321"
version: "0.19.0+322"

environment:
sdk: ">=3.10.0 <4.0.0"
Expand Down