using CommunityToolkit.Mvvm.ComponentModel;

namespace GreadyPoang.EntityLayer;

public partial class RoundBuilderElement : ObservableObject
{
    public RoundBuilderElement()
    {
        ParticipantId = 0;
        ParticipantName = string.Empty;
        GameRoundRegNr = 0;
        GameRegPoints = 0;
        Status = GamePointStatus.New;
        GameRoundStartDate = DateTime.MinValue;
        GameRoundId = 0;
        GamePointId = 0;
    }

    [ObservableProperty]
    private int participantId;

    [ObservableProperty]
    private string participantName;

    [ObservableProperty]
    private int gameRoundRegNr;

    [ObservableProperty]
    private int gameRegPoints;

    [ObservableProperty]
    [NotifyPropertyChangedFor(nameof(StatusString))]
    private GamePointStatus status;

    [ObservableProperty]
    [NotifyPropertyChangedFor(nameof(GameRoundStartDateString))]
    private DateTime gameRoundStartDate;

    [ObservableProperty]
    private int gameRoundId;

    [ObservableProperty]
    private int gamePointId;

    public string StatusString
    {
        get { return status.ToString(); }
    }

    public string GameRoundStartDateString
    {
        get { return gameRoundStartDate.ToString("yyyy-MM-dd"); }
    }


}
