263 lines
7.0 KiB
C#
263 lines
7.0 KiB
C#
using Sarand.Net.Standard.Base.App;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Saxonite.Net.Standard.Base.App
|
|
{
|
|
//=======================================================================
|
|
public static partial class Sax
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Application configuration defaults.
|
|
public static class Config
|
|
{
|
|
public static String Context_Defaults { get; } = "Defaults";
|
|
public static class Security
|
|
{
|
|
public static class Password
|
|
{
|
|
}
|
|
public static class Activation
|
|
{
|
|
public static int EmailLinkExpiresMins_Default { get; } = 60;
|
|
public static int EmailLinkExpiresMins_Min { get; } = 30;
|
|
public static int EmailLinkExpiresMins_Max { get; } = 60 * 24;
|
|
}
|
|
public static class SignIn
|
|
{
|
|
public static class PasswordRequest
|
|
{
|
|
public static int EmailLinkExpiresMins_Default { get; } = 60;
|
|
public static int EmailLinkExpiresMins_Min { get; } = 30;
|
|
public static int EmailLinkExpiresMins_Max { get; } = 60 * 24;
|
|
}
|
|
public static class KeepLoggedIn
|
|
{
|
|
public static bool Allowed_Default { get; } = true;
|
|
public static int CookieExpiresDays_Default { get; } = 10;
|
|
public static int CookieExpiresDays_Min { get; } = 1;
|
|
public static int CookieExpiresDays_Max { get; } = 30;
|
|
}
|
|
}
|
|
}
|
|
public class Online
|
|
{
|
|
public static class Session
|
|
{
|
|
public static class Cookie
|
|
{
|
|
/// <summary>Default cookie name: '.AspNetCore.Session'</summary>
|
|
public static String Name { get; } = "Saxonite.Online.Session";
|
|
public static bool HttpOnly { get; } = true;
|
|
public static TimeSpan IdleTimeout { get; } = SacsSystem.DebugMode ? TimeSpan.FromMinutes(5) : TimeSpan.FromMinutes(60);
|
|
public static long RememberMeTimeoutMilis { get; } = (long)(SacsSystem.DebugMode ? TimeSpan.FromMinutes(2) : TimeSpan.FromMinutes(10)).TotalMilliseconds;
|
|
}
|
|
}
|
|
public static class DataCache
|
|
{
|
|
public static class RefreshIntervalSecs
|
|
{
|
|
public static int Initial { get; } = SacsSystem.DebugMode ? 2 : 5;
|
|
public static int Periodic{ get; } = SacsSystem.DebugMode ? 60 : 1800;
|
|
}
|
|
}
|
|
}
|
|
public class Admin
|
|
{
|
|
public static class Session
|
|
{
|
|
public static class Cookie
|
|
{
|
|
/// <summary>Default cookie name: '.AspNetCore.Session'</summary>
|
|
public static String Name { get; } = "Saxonite.Admin.Session";
|
|
public static bool HttpOnly { get; } = true;
|
|
public static TimeSpan IdleTimeout { get; } = SacsSystem.DebugMode ? TimeSpan.FromMinutes(5) : TimeSpan.FromMinutes(15);
|
|
public static long KeepLoggedInTimeoutMillis { get; } = (long)(SacsSystem.DebugMode ? TimeSpan.FromMinutes(2) : TimeSpan.FromMinutes(10)).TotalMilliseconds;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
/// <summary>
|
|
/// Code types (static lists).
|
|
/// <para>Defined by the underlying system and available for use throughout any application.</para>
|
|
/// <para>Only maintainable by updates to the software, ie. not held on the database.</para>
|
|
/// </summary>
|
|
public enum CodeType
|
|
{
|
|
YesNo,
|
|
RegionType,
|
|
UserRole,
|
|
Title,
|
|
OrganisationType,
|
|
OrganisationCategory,
|
|
OrganisationRole,
|
|
OpportunityType,
|
|
DataItemType,
|
|
};
|
|
|
|
//-------------------------------------------------------------------
|
|
public enum Application
|
|
{
|
|
Admin,
|
|
Online,
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
public enum InstanceType
|
|
{
|
|
Production,
|
|
UAT,
|
|
QC,
|
|
Dev
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
public enum DataItemType
|
|
{
|
|
Unknown = 0,
|
|
/* Do not change the numeric values - tied to database. */
|
|
// Reference data.
|
|
Region = 10,
|
|
Sport = 11,
|
|
// Accounts.
|
|
UserAccount = 100,
|
|
UserRole = 101,
|
|
UserOrganisation = 102,
|
|
UserSport = 103,
|
|
Organisation = 120,
|
|
// Activty data.
|
|
ActivityIndex = 200,
|
|
JournalistArticle = 210,
|
|
OrganisationOpportunity = 220,
|
|
OrganisationEvent = 225,
|
|
// Item link components.
|
|
ItemSport = 400,
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
public enum RegionType
|
|
{
|
|
Unknown = 0,
|
|
/* Do not change the numeric values - tied to database. */
|
|
Continent = 10,
|
|
SubContinent = 20,
|
|
/// <summary>Country - self-governing political entity, eg. Country, State (not US state)</summary>
|
|
Country = 30,
|
|
/// <summary>Nation, eg. Home Nation.</summary>
|
|
Nation = 40,
|
|
/// <summary>STate - major subdivision of country, eg. US state.</summary>
|
|
State = 50,
|
|
/// <summary>Province - eg. GB County.</summary>
|
|
Province = 60
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
/// <summary>User roles</summary>
|
|
public enum UserRole
|
|
{
|
|
Unknown = 0,
|
|
/* Do not change the values - tied to database. */
|
|
Journalist,
|
|
SystemAdmin,
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
/// <summary>Sport Participation</summary>
|
|
public enum SportParticipation
|
|
{
|
|
Unknown = 0,
|
|
/* Do not change the values/codes - tied to database. */
|
|
Regular,
|
|
Occasional,
|
|
Spectator,
|
|
Interested
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
/// <summary>Yes or No option.</summary>
|
|
public enum YesNo
|
|
{
|
|
Unknown = 0,
|
|
Yes,
|
|
No
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
/// <summary>Titles - for Contact details.</summary>
|
|
public enum Title
|
|
{
|
|
Unknown = 0,
|
|
Mr,
|
|
Mrs,
|
|
Miss,
|
|
Mx,
|
|
Dr,
|
|
Sir,
|
|
Madam,
|
|
Lord,
|
|
Lady
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
/// <summary>Organisation Types.</summary>
|
|
public enum OrganisationType
|
|
{
|
|
Unknown = 0,
|
|
/* Do not change the names/codes - tied to database. */
|
|
Commercial,
|
|
SocialEnterprise,
|
|
CommunityGroup,
|
|
Charity,
|
|
PublicSector,
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
/// <summary>Organisation Category.</summary>
|
|
public enum OrganisationCategory
|
|
{
|
|
Unknown = 0,
|
|
/* Do not change the names/codes - tied to database. */
|
|
Association,
|
|
Club,
|
|
Education,
|
|
Syndicate,
|
|
/// <summary>Commercial partner</summary>
|
|
Partner,
|
|
/// <summary>Other</summary>
|
|
Other,
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
/// <summary>Organisation roles</summary>
|
|
public enum OrganisationRole
|
|
{
|
|
Unknown = 0,
|
|
/* Do not change the values - tied to database. */
|
|
Member,
|
|
MemberAdmin,
|
|
ScheduleAdmin,
|
|
OpportunityAdmin,
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
/// <summary>Opportunity Type</summary>
|
|
public enum OpportunityType
|
|
{
|
|
Unknown = 0,
|
|
/* Do not change the values or codes - tied to database. */
|
|
Playing,
|
|
Official,
|
|
Coaching,
|
|
Volunteer,
|
|
Staff,
|
|
Board,
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|