using System;
using System.Collections.Generic;

namespace Valg.EVA.Skanning.Contracts.CommonEnums
{
    public enum BallotPaperType
    {
        Undefined = 0,
        ParliamentGeneral = 11,
        Parliament = 10,
        Municipality3 = 02,
        Municipality2 = 01,
        County3 = 20, 
        County2 = 05, 
        MunicipalityGeneral = 04,
        CountyGeneral = 06,
        OsloDistrict = 07, 
        OsloDistrictGeneral = 09, 
        ParliamentPersonal = 101, 
        ParliamentBlank = 15,
        MunicipalityBlank3 = 14,
        MunicipalityBlank2 = 12,
        CountyBlank2 = 16, 
        OsloDistrictBlank = 17,
        Municipality3X = 19,
        CountyBlank3 = 21,
        QualityCheck = 99,
        Unknown = 100,   
    }

    public enum BlankBallotPaperType
    {
        ParliamentBlank = BallotPaperType.ParliamentBlank,
        MunicipalityBlank3 = BallotPaperType.MunicipalityBlank2,
        MunicipalityBlank2 = BallotPaperType.MunicipalityBlank3,
        CountyBlank2 = BallotPaperType.CountyBlank2,
        CountyBlank3 = BallotPaperType.CountyBlank3,
        OsloDistrictBlank = BallotPaperType.OsloDistrictBlank
    }
    public static class BlankBallotPaperTypeClass {
        public static Dictionary<BallotPaperType, BallotPaperType> CandidateBallotPaperType = new Dictionary<BallotPaperType, BallotPaperType>()
        {
            { BallotPaperType.ParliamentBlank, BallotPaperType.Parliament },
            { BallotPaperType.MunicipalityBlank2, BallotPaperType.Municipality2 },
            { BallotPaperType.MunicipalityBlank3, BallotPaperType.Municipality3 },
            { BallotPaperType.CountyBlank2, BallotPaperType.County2 },
            { BallotPaperType.CountyBlank3, BallotPaperType.County3 },
            { BallotPaperType.OsloDistrictBlank, BallotPaperType.OsloDistrictBlank }
        };

        public static bool IsBallotPaperTypeBlank(BallotPaperType ballotPaperType)
        {
            return Enum.IsDefined(typeof(BlankBallotPaperType), (BlankBallotPaperType) ballotPaperType);
        }
    }
}

