Activity index, Db schema validation.
This commit is contained in:
2021-05-31 20:27:40 +01:00
parent 63473c725b
commit 7b0a710b13
36 changed files with 1008 additions and 208 deletions
+4 -4
View File
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
//-------------------------------------------------------------------
public static class Version
{
private static String version { get; } = "1.0.5.0";
private static String version { get; } = "1.0.5.3";
// Retrieve version.
public static String GetFullVersion () { return version; }
public static String GetAppVersion ()
@@ -39,9 +39,9 @@ namespace Saxonite.Net.Standard.Base.App
//-------------------------------------------------------------------
// Version history.
// 1.0.5 ?-May-2021 Activity Index
// - Admin Database page.
// - Online Account country.
// 1.0.5 31-May-2021 Activity Index
// - Admin Database Schema (Home) and Tables page.
// - Online Account country, Home activities.
// 1.0.4 20-May-2021 Online profile sports & opportunities
// - Admin Organisation Region & Sport.
// - Online Profile Sports - simple list with name.
@@ -69,6 +69,8 @@ namespace Saxonite.Net.Standard.Base.App
LastName = userAccount.LastName;
DisplayName = userAccount.GetDisplayName();
EmailAddress = userAccount.EmailAddress;
RegionIdCountry = userAccount.RegionIdCountry;
RegionIdProvince = userAccount.RegionIdProvince;
if (sessionContext.Application == Sax.Application.Admin)
KeepLoggedIn = userAccount.KeepLoggedIn_Admin;
else if (sessionContext.Application == Sax.Application.Online)
@@ -87,12 +89,13 @@ namespace Saxonite.Net.Standard.Base.App
public String LastName { get; protected set; }
public String DisplayName { get; protected set; }
public String EmailAddress { get; protected set; }
public SysId RegionIdCountry { get; protected set; }
public SysId RegionIdProvince { get; protected set; }
public bool KeepLoggedIn { get; protected set; }
public bool UserAccountSupplied { get; protected set; }
// Roles.
public class RoleData
{
private RoleData() { }
public RoleData(SaxUserRole userRole)
{
if (userRole != null)
@@ -107,13 +110,6 @@ namespace Saxonite.Net.Standard.Base.App
[JsonIgnore]
private readonly List<RoleData> roles = new List<RoleData>();
public List<RoleData> Roles { get { return new List<RoleData>(roles); } protected set { roles.Clear(); roles.AddRange(value); } }
/// <summary>User - JSON deserialisation route.</summary>
protected void SetRoles(List<RoleData> roles)
{
if (this.roles.Count > 0)
throw new NotSupportedException("Session Data Roles cannot be replaced.");
this.roles.AddRange(roles);
}
[JsonIgnore]
public bool IsJournalist { get { return roles?.Exists(item => item.Role == Sax.UserRole.Journalist) ?? false; } }
}
@@ -122,7 +118,7 @@ namespace Saxonite.Net.Standard.Base.App
protected void SetUser(UserData user)
{
if (User != null && User.UserAccountSupplied)
throw new NotSupportedException("Session Data User cannot be replaced.");
throw new NotSupportedException("Session User cannot be replaced.");
User = user;
}
@@ -23,6 +23,12 @@ namespace Saxonite.Net.Standard.Base.Bus
ItemType_Code,
ItemType_Desc,
ItemId,
// Journalist Article.
Article_Headline,
Article_Summary,
// Organisation opportunity.
Opportunity_Position,
Opportunity_Outline,
// Sport.
SportId,
Sport_Name,
@@ -44,21 +44,28 @@ namespace Saxonite.Net.Standard.Base.Consoles
/// </summary>
public class IndexResults
{
public class ItemData
public class ActivityData
{
public ItemData(ItemId itemId, DateTime effectiveOn)
public ActivityData(ItemId itemId, DateTime effectiveOn)
{
ItemId = itemId;
EffectiveOn = effectiveOn;
}
public ItemId ItemId { get; }
public DateTime EffectiveOn { get; }
public String Caption { get; protected set; }
public String Blurb { get; protected set; }
public SysId SportId{ get; protected set; }
public String SportName{ get; protected set; }
public SysId RegionId { get; protected set; }
public String RegionName{ get; protected set; }
}
public List<ItemData> Items { get; } = new List<ItemData>();
public List<ActivityData> Items { get; } = new List<ActivityData>();
}
//-------------------------------------------------------------------
// Data members.
private SaxInternals internals = null;
private readonly List<Sax.DataItemType> validActivityItemTypes = new List<Sax.DataItemType>()
{
Sax.DataItemType.JournalistArticle,
@@ -75,12 +82,14 @@ namespace Saxonite.Net.Standard.Base.Consoles
{
if (disposing)
{
if (internals != null) internals.Dispose(); internals = null;
}
}
//-------------------------------------------------------------------
// Properties.
protected SaxSessionContext SessionContext { get; }
protected SaxInternals Internals { get { if (internals == null) internals = new SaxInternals(SessionContext); return internals; } }
protected List<Sax.DataItemType> ValidActivityItemTypes { get { return validActivityItemTypes.ToList(); } }
//-------------------------------------------------------------------