// Copyright (c) 2025 TerraByte Inc.
//
// This script defines the data model for a single Git change.
// An object of this class holds information about a file that has been
// added, modified, or deleted.
//
// HOW TO USE:
// 1. Place this script inside the "Editor" folder.
// 2. This class is used by GitService.cs and ArbitratorWindow.cs.

using LibGit2Sharp;

namespace Terra.Arbitrator.Services
{
    /// <summary>
    /// A data container for a single file change detected by Git.
    /// </summary>
    public class GitChange
    {
        public string FilePath { get; private set; }
        public string OldFilePath { get; private set; }
        public ChangeKind Status { get; private set; }
        
        /// <summary>
        /// Represents whether the user has checked the box for this file in the UI.
        /// </summary>
        public bool IsSelectedForCommit { get; set; }

        public GitChange(string newPath, string oldPath, ChangeKind status)
        {
            FilePath = newPath;
            OldFilePath = oldPath;
            Status = status;
            IsSelectedForCommit = true; // Default to select
        }
    }
}