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,211 @@
|
||||
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.Support
|
||||
{
|
||||
//=======================================================================
|
||||
// ItemSport.
|
||||
//=======================================================================
|
||||
public abstract class SaxItemProcessMessage : SaxDisposableHierarchyItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Columns.
|
||||
public enum Column
|
||||
{
|
||||
Pos,
|
||||
Id,
|
||||
// Item process.
|
||||
ItemProcessInstanceId,
|
||||
// Process message.
|
||||
MessageType,
|
||||
MessageType_Desc,
|
||||
Message,
|
||||
Recorded_DateTime,
|
||||
Recorded_Date,
|
||||
Recorded_Time,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Properties other than common.</summary>
|
||||
public class DataProperties
|
||||
{
|
||||
public SysId ItemProcessInstanceId { get; set; }
|
||||
public DateTime? RecordedAt { get; set; }
|
||||
public SaMessageLevel MessageType { get; set; }
|
||||
public String Message { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data.
|
||||
public new class Data : SacsHierarchyItem.Data
|
||||
{
|
||||
// Data members.
|
||||
private readonly DataProperties data = new DataProperties();
|
||||
// Construction.
|
||||
public Data()
|
||||
{
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
// Properties.
|
||||
public SysId ItemProcessInstanceId
|
||||
{
|
||||
get { return data.ItemProcessInstanceId; }
|
||||
set { CheckChanged(data.ItemProcessInstanceId, value); data.ItemProcessInstanceId = value; }
|
||||
}
|
||||
public DateTime? RecordedAt
|
||||
{
|
||||
get { return data.RecordedAt; }
|
||||
set { CheckChangedNullable(data.RecordedAt, value); data.RecordedAt = value; }
|
||||
}
|
||||
public SaMessageLevel MessageType
|
||||
{
|
||||
get { return data.MessageType; }
|
||||
set { CheckChanged((int)data.MessageType, (int)value); data.MessageType = value; }
|
||||
}
|
||||
public String Message
|
||||
{
|
||||
get { return data.Message; }
|
||||
set { CheckChanged(data.Message, value); data.Message = value; }
|
||||
}
|
||||
// Population.
|
||||
internal void PopulateFrom(Data data)
|
||||
{
|
||||
ItemProcessInstanceId = data.ItemProcessInstanceId;
|
||||
RecordedAt = data.RecordedAt;
|
||||
MessageType = data.MessageType;
|
||||
Message = data.Message;
|
||||
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 ItemProcessInstanceId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue RecordedAt { get; set; } = ValidValue.Valid;
|
||||
public ValidValue MessageType { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Message { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Data data = new Data();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected SaxItemProcessMessage(SysId id, SysId itemProcessId) : base(id)
|
||||
{
|
||||
base.SetData(data);
|
||||
ItemProcessInstanceId = itemProcessId;
|
||||
Status = DefaultStatus;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Status.
|
||||
private static readonly List<SaStatus> validStatuses = new List<SaStatus>()
|
||||
{
|
||||
SaStatus.Active,
|
||||
SaStatus.Deleted,
|
||||
};
|
||||
public static SaStatus DefaultStatus { get { return SaStatus.Active; } }
|
||||
public static List<SaStatus> ValidStatuses { get { return new List<SaStatus>(validStatuses); } }
|
||||
public static DataValue.TriStateType GetStatusTriState(SaStatus status)
|
||||
{
|
||||
if (status == SaStatus.Active) return DataValue.TriStateType.Green;
|
||||
if (status == SaStatus.Deleted) return DataValue.TriStateType.Purple;
|
||||
return DataValue.TriStateType.Unknown;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// 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 (SysId.IsValid(ItemProcessInstanceId) && SysId.ToInt(ItemProcessInstanceId) != SysId.ToInt(data.ItemProcessInstanceId))
|
||||
throw new NotSupportedException($"{SysUtil.Fn} Item Process Id cannot be changed");
|
||||
this.data.PopulateFrom(data);
|
||||
}
|
||||
public SysId ItemProcessInstanceId
|
||||
{
|
||||
get { return data.ItemProcessInstanceId; }
|
||||
protected set { data.ItemProcessInstanceId = value; }
|
||||
}
|
||||
public DateTime? RecordedAt
|
||||
{
|
||||
get { return data.RecordedAt; }
|
||||
set { data.RecordedAt = value; }
|
||||
}
|
||||
public SaMessageLevel MessageType
|
||||
{
|
||||
get { return data.MessageType; }
|
||||
set { data.MessageType = value; }
|
||||
}
|
||||
public String Message
|
||||
{
|
||||
get { return data.Message; }
|
||||
set { data.Message = 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
|
||||
//-------------------------------------------------------------------
|
||||
// List parameters.
|
||||
public enum StatusCat
|
||||
{
|
||||
Any,
|
||||
ActiveOnly,
|
||||
InactiveOnly,
|
||||
NotDeleted,
|
||||
DeletedOnly,
|
||||
}
|
||||
/// <summary>
|
||||
/// Item list parameters.
|
||||
/// </summary>
|
||||
public new class Params : SacsHierarchyItem.Params
|
||||
{
|
||||
// List filtering.
|
||||
public HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SysId> ItemProcessInstanceIdsIncluded { get; } = new HashSet<SysId>();
|
||||
public HashSet<SaMessageLevel> MessageTypesIncluded { get; } = new HashSet<SaMessageLevel>();
|
||||
// Common properties.
|
||||
public String NotesPartial { get; set; }
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
// Item list extension methods.
|
||||
public static class SaxItemProcessMessageList
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
}
|
||||
Reference in New Issue
Block a user