//
//  Milestone.swift
//  Andromida
//
//  Represents a milestone achievement within a ritual arc.
//

import Foundation

/// A milestone that can be achieved during a ritual journey.
struct Milestone: Identifiable {
    let id = UUID()
    let day: Int
    let title: String
    let symbolName: String
    let isAchieved: Bool
    
    /// Standard milestones for a 28-day ritual arc.
    static func standardMilestones(currentDay: Int, totalDays: Int) -> [Milestone] {
        let halfwayDay = totalDays / 2
        
        return [
            Milestone(
                day: 1,
                title: String(localized: "First Day"),
                symbolName: "star.fill",
                isAchieved: currentDay >= 1
            ),
            Milestone(
                day: 7,
                title: String(localized: "One Week"),
                symbolName: "7.circle.fill",
                isAchieved: currentDay >= 7
            ),
            Milestone(
                day: halfwayDay,
                title: String(localized: "Halfway"),
                symbolName: "flag.fill",
                isAchieved: currentDay >= halfwayDay
            ),
            Milestone(
                day: 21,
                title: String(localized: "Three Weeks"),
                symbolName: "brain.fill",
                isAchieved: currentDay >= 21
            ),
            Milestone(
                day: totalDays,
                title: String(localized: "Complete"),
                symbolName: "trophy.fill",
                isAchieved: currentDay >= totalDays
            )
        ].filter { $0.day <= totalDays }
    }
}
