Budget.swift 615 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // Budget.swift
  3. // ydnab
  4. //
  5. // Created by Andrea Franceschini on 22/09/2020.
  6. //
  7. import Foundation
  8. struct BudgetCategory: Codable, Identifiable {
  9. var id: UUID = UUID()
  10. var name: String = ""
  11. var hidden: Bool = false
  12. }
  13. struct BudgetSection: Codable, Identifiable {
  14. var id: UUID = UUID()
  15. var name: String = ""
  16. var hidden: Bool = false
  17. var categories: [BudgetCategory] = []
  18. }
  19. struct BudgetInfo: Codable, Identifiable {
  20. var id = UUID()
  21. var name: String = ""
  22. var localeIdentifier: String = ""
  23. var sections: [BudgetSection] = []
  24. }
  25. typealias BudgetsList = [BudgetInfo]