using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Valg.EVA.Skanning.Entity.SerializedEntities.CountResultModel;
using Valg.EVA.Skanning.Resources.Language;

namespace Valg.EVA.Skanning.Sample.Startup.Ballot
{
    public class BallotOverview
    {
        public string AffiliationId { get; set; } = null;
        public bool ProposedRejected => RejectionReason != CastVote.RejectionReasonCode.NotRejected;
        public CastVote.RejectionReasonCode RejectionReason { get; set; } = CastVote.RejectionReasonCode.NotRejected;
        public bool AutomaticallyVerified { get; set; } = false;
        public bool ManuallyVerified => !AutomaticallyVerified;
        public ObservableCollection<PersonVote> PersonVotes { get; } = new ObservableCollection<PersonVote>();
        public ObservableCollection<WriteInVote> WriteInVotes { get; } = new ObservableCollection<WriteInVote>();
        public ObservableCollection<Renumbering> Renumberings { get; } = new ObservableCollection<Renumbering>();
        public ObservableCollection<Strikeout> Strikeouts { get; } = new ObservableCollection<Strikeout>();
        public bool HasPersonVotes => PersonVotes.Any();
        public bool HasWriteInVotes => WriteInVotes.Any();
        public bool HasRenumberings => Renumberings.Any();
        public bool HasStrikeouts => Strikeouts.Any();
        public bool IsAffiliationKnown => !string.IsNullOrWhiteSpace(AffiliationId);
        public string RejectionReasonText => $"{SampleLanguageString.Proposed_rejection_reason} ({RejectionReason}): {RejectionReasonCodeToTextMapper.Map(RejectionReason)}";
    }

    public class WriteInVote
    {
        public string AffiliationId { get; set; }
        public string CandidateName { get; set; }

    }

    public class PersonVote
    {
        public int CandidateNumber { get; set; }
        public string CandidateName { get; set; }

    }

    public class Strikeout
    {
        public int CandidateNumber { get; set; }
        public string CandidateName { get; set; }

    }

    public class Renumbering
    {
        public int OriginalCandidateNumber { get; set; }
        public int NewCandidateNumber { get; set; }
        public string CandidateName { get; set; }

    }
}

