mirror of
https://github.com/VGEAREN/Stockbar.git
synced 2026-10-07 15:37:57 +08:00
- New Watchlist model: named virtual portfolios with per-stock cost/shares - Watchlists persisted to watchlists.json, active ID in settings - AppState: effective cost/shares/PnL methods that respect active watchlist - Settings: create/delete/switch watchlists, edit writes to active watchlist - ProfitSummaryView shows active watchlist name - UI alignment fixes for toggle and text field padding Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 lines
284 B
Swift
13 lines
284 B
Swift
import Foundation
|
|
|
|
struct WatchlistEntry: Codable {
|
|
var costPrice: Double
|
|
var holdingShares: Double
|
|
}
|
|
|
|
struct Watchlist: Identifiable, Codable {
|
|
var id: String = UUID().uuidString
|
|
var name: String
|
|
var entries: [String: WatchlistEntry] = [:] // stockId -> entry
|
|
}
|