v1.3.0 Restructure Saxonite workspace and upgrade to .NET 10 (#1)
Move Saxonite’s projects into a dedicated `Workspace` folder and align the solution with .NET 10 and the current Common workspace. Update encryption integration, test project structure and coverage, and repository guidance and upgrade notes. - Relocate application and library projects while retaining Git rename history. - Split tests into Admin, Online, and Shared projects; add representative behavioral and serialization tests. - Update Common integration, application version, and repository documentation. Application version: 1.3.0 Reviewed-on: #1 Co-authored-by: andy <andy@sarand.com>
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,214 @@
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Bus
|
||||
{
|
||||
//=======================================================================
|
||||
// ActivityIndex.
|
||||
//=======================================================================
|
||||
public abstract class SaxActivityFeedback : SaxDisposableHierarchyItem, IDisposable
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Columns.
|
||||
public enum Column
|
||||
{
|
||||
Pos,
|
||||
// Item.
|
||||
ItemType,
|
||||
ItemType_Code,
|
||||
ItemType_Desc,
|
||||
ItemId,
|
||||
// Feedback.
|
||||
ViewCount,
|
||||
FeedbackCount,
|
||||
FeedbackTotal,
|
||||
FeedbackAverage,
|
||||
// Common.
|
||||
CreateOn_Date,
|
||||
UpdateOn_Date,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Properties other than common.</summary>
|
||||
public class DataProperties
|
||||
{
|
||||
public ItemId ItemId { get; set; } = new ItemId();
|
||||
public long ViewCount { get; set; }
|
||||
public long FeedbackCount { get; set; }
|
||||
public long FeedbackTotal { get; set; }
|
||||
public decimal FeedbackAverage { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data.
|
||||
public new class Data : SacsHierarchyItem.Data
|
||||
{
|
||||
// Data members.
|
||||
private readonly DataProperties data = new DataProperties();
|
||||
// Construction.
|
||||
public Data() { }
|
||||
// Properties.
|
||||
public ItemId ItemId
|
||||
{
|
||||
get { return data.ItemId; }
|
||||
set { CheckChanged(data.ItemId, value); data.ItemId = value; }
|
||||
}
|
||||
public long ViewCount
|
||||
{
|
||||
get { return data.ViewCount; }
|
||||
set { CheckChanged(data.ViewCount, value); data.ViewCount = value; }
|
||||
}
|
||||
public long FeedbackCount
|
||||
{
|
||||
get { return data.FeedbackCount; }
|
||||
set { CheckChanged(data.FeedbackCount, value); data.FeedbackCount = value; }
|
||||
}
|
||||
public long FeedbackTotal
|
||||
{
|
||||
get { return data.FeedbackTotal; }
|
||||
set { CheckChanged(data.FeedbackTotal, value); data.FeedbackTotal = value; }
|
||||
}
|
||||
public decimal FeedbackAverage
|
||||
{
|
||||
get { return data.FeedbackAverage; }
|
||||
set { CheckChanged(data.FeedbackAverage, value); data.FeedbackAverage = value; }
|
||||
}
|
||||
// Population.
|
||||
internal void PopulateFrom(Data data)
|
||||
{
|
||||
ItemId = data.ItemId;
|
||||
ViewCount = data.ViewCount;
|
||||
FeedbackCount = data.FeedbackCount;
|
||||
FeedbackTotal = data.FeedbackTotal;
|
||||
FeedbackAverage = data.FeedbackAverage;
|
||||
base.PopulateFrom(data);
|
||||
}
|
||||
public Data Clone()
|
||||
{
|
||||
Data data = new Data();
|
||||
data.PopulateFrom(this);
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Error field - identify properties with validation error.
|
||||
public new class ErrField : SacsHierarchyItem.ErrField
|
||||
{
|
||||
// Identifies the field that has invalid data.
|
||||
public ValidValue ItemId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ViewCount { get; set; } = ValidValue.Valid;
|
||||
public ValidValue FeedbackCount { get; set; } = ValidValue.Valid;
|
||||
public ValidValue FeedbackTotal { get; set; } = ValidValue.Valid;
|
||||
public ValidValue FeedbackAverage { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Data data = new Data();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected SaxActivityFeedback(ItemId itemId) : base()
|
||||
{
|
||||
base.SetData(data);
|
||||
ItemId = itemId;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item Types.
|
||||
private readonly static List<Sax.DataItemType> validItemTypes = new List<Sax.DataItemType>()
|
||||
{ Sax.DataItemType.Article, Sax.DataItemType.OrganisationEvent, Sax.DataItemType.OrganisationOpportunity };
|
||||
public static List<Sax.DataItemType> ValidItemTypes { get { return new List<Sax.DataItemType>(validItemTypes); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public void Dispose() { }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public Data GetData() { return data.Clone(); }
|
||||
public void SetData(Data data)
|
||||
{
|
||||
// Properties that cannot be changed if previously specified.
|
||||
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
|
||||
if (ItemId.IsValid(ItemId) && ItemId.Type != data.ItemId.Type && SysId.ToInt(ItemId.Id) != SysId.ToInt(data.ItemId.Id))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
|
||||
this.data.PopulateFrom(data);
|
||||
}
|
||||
public ItemId ItemId
|
||||
{
|
||||
get { return data.ItemId; }
|
||||
protected set { data.ItemId = value; }
|
||||
}
|
||||
public long ViewCount
|
||||
{
|
||||
get { return data.ViewCount; }
|
||||
set { data.ViewCount = value; }
|
||||
}
|
||||
public long FeedbackCount
|
||||
{
|
||||
get { return data.FeedbackCount; }
|
||||
set { data.FeedbackCount = value; }
|
||||
}
|
||||
public long FeedbackTotal
|
||||
{
|
||||
get { return data.FeedbackTotal; }
|
||||
set { data.FeedbackTotal = value; }
|
||||
}
|
||||
public decimal FeedbackAverage
|
||||
{
|
||||
get { return data.FeedbackAverage; }
|
||||
set { data.FeedbackAverage = value; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Flags - positions 1-16 available.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A s s o c i a t e d D a t a
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// P a r a m s
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Combination Sport and Region Ids to index activities.
|
||||
/// </summary>
|
||||
public class SportFeedbackAverages
|
||||
{
|
||||
public SportFeedbackAverages(SysId sportId, SysId regionId)
|
||||
{
|
||||
FeedbackTotal = sportId;
|
||||
FeedbackAverage = regionId;
|
||||
}
|
||||
public SysId FeedbackTotal { get; }
|
||||
public SysId FeedbackAverage { get; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Item list parameters.
|
||||
/// </summary>
|
||||
public new class Params : SacsHierarchyItem.Params
|
||||
{
|
||||
// List filtering.
|
||||
public List<ItemId> ItemIdsIncluded { get; } = new List<ItemId>();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
// Item list extension methods.
|
||||
public static class SaxActivityFeedbackList
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
}
|
||||
Reference in New Issue
Block a user