using Valg.EVA.Skanning.Contracts.Security;

namespace Valg.EVA.Skanning.Services.EmergencyMode
{
    public static class TokenTemplates
    {
        public const string TokenTemplate = @"
                <token>
                  <isEmergencyMode>true</isEmergencyMode>
                  <uid>99999999999</uid>
                  <operatorName>[operatorName]</operatorName>
                  <electionEventId>[electionEventId]</electionEventId>
                  <electionEventName>[electionEventName]</electionEventName>
                  <created>2000.01.01-12:00:00</created>
                  <expiration>2000.01.00-12:00:00</expiration>
                  <roles>
                        [roles]
                  </roles>
                </token>";

        public const string RoleTemplate = @"
                <role>
                  <roleName>EmergencyMode</roleName>
                  <roleId>EmergencyMode</roleId>
                  <areaContextId>[areaContextId]</areaContextId>
                  <areaContextName>[areaContextName]</areaContextName>
                  <electionContextId>[electionContextId]</electionContextId>
                  <electionContextName>[electionContextName]</electionContextName>
                  <reportingUnits>
                    <reportingUnit>
                      <id>[reportingUnitId]</id>
                      <name>[reportingUnitName]</name>
                    </reportingUnit>
                  </reportingUnits>
                  <accesses>
                    <access>" + ClaimDefinitions.VerifyAccessClaimType + @"</access>
                    <access>" + ClaimDefinitions.JobManagementAccessClaimType + @"</access>
                    <access>" + ClaimDefinitions.ScanAccessClaimType + @"</access>                    
                    <access>" + ClaimDefinitions.TransferAccessClaimType + @"</access>
                  </accesses>
                </role>";

        public const string RoleBydelsvalgOsloTemplate = @"
                <role>
                  <roleName>EmergencyMode</roleName>
                  <roleId>EmergencyMode</roleId>
                  <areaContextId>[areaContextId]</areaContextId>
                  <areaContextName>[areaContextName]</areaContextName>
                  <electionContextId>[electionContextId]</electionContextId>
                  <electionContextName>[electionContextName]</electionContextName>
                  <reportingUnits />
                  <accesses>
                      <access>" + ClaimDefinitions.VerifyAccessClaimType + @"</access>
                    <access>" + ClaimDefinitions.JobManagementAccessClaimType + @"</access>
                    <access>" + ClaimDefinitions.ScanAccessClaimType + @"</access>                    
                    <access>" + ClaimDefinitions.TransferAccessClaimType + @"</access>
                  </accesses>
                </role>";
    }
}
