import Foundation

// MARK: - Priority

enum Priority: String, CaseIterable, Identifiable {
    case low
    case medium
    case high

    var id: String { rawValue }

    var displayName: String {
        switch self {
        case .low: return "Low"
        case .medium: return "Medium"
        case .high: return "High"
        }
    }

    var colorHex: UInt {
        switch self {
        case .low: return 0x4CAF50     // green
        case .medium: return 0xFF9800  // orange
        case .high: return 0xF44336    // red
        }
    }
}

// MARK: - TodoFilter

enum TodoFilter: String, CaseIterable, Identifiable {
    case all
    case active
    case done

    var id: String { rawValue }

    var displayName: String {
        switch self {
        case .all: return "All"
        case .active: return "Active"
        case .done: return "Done"
        }
    }
}

// MARK: - Categories

let todoCategories: [String] = ["Personal", "Work", "Shopping", "Health", "Learning"]

// MARK: - Todo

struct Todo: Identifiable, Equatable {
    let id: Int64
    var title: String
    var completed: Bool
    var category: String
    var priority: Priority
    var createdAt: Int64

    static func == (lhs: Todo, rhs: Todo) -> Bool {
        lhs.id == rhs.id
            && lhs.title == rhs.title
            && lhs.completed == rhs.completed
            && lhs.category == rhs.category
            && lhs.priority == rhs.priority
            && lhs.createdAt == rhs.createdAt
    }
}
