using GB5Shared.ListQuery; namespace SwDAL.DTO.SyncGroup; // ── Main entity DTO ──────────────────────────────────────────────────────── public class SyncGroupDTO { public int SyncGroupId { get; set; } public string SyncGroupCode { get; set; } = string.Empty; public string SyncGroupName { get; set; } = string.Empty; public int DbModelId { get; set; } public string? DbModelName { get; set; } // read-only JOIN public string? Description { get; set; } // Standard M-table fields public short Version { get; set; } public byte Status { get; set; } = 1; public short SortOrder { get; set; } = 9999; public int CreatedById { get; set; } public DateTime CreatedOn { get; set; } public int ModifiedById { get; set; } public DateTime ModifiedOn { get; set; } public byte SourceType { get; set; } = 5; public int TenantId { get; set; } // Populated by BLL.GetById — not part of the M-table row itself public List SyncTables { get; set; } = new(); } // ── Sync table (detail) DTO ──────────────────────────────────────────────── public class SyncTableDTO { public int SyncTableId { get; set; } // IDENTITY surrogate (020_ALTER_MSWSYNCTABLE.sql) public int SyncGroupId { get; set; } public string TableName { get; set; } = string.Empty; public string SchemaName { get; set; } = "dbo"; public byte SyncBehavior { get; set; } = 1; public string? FilterClause { get; set; } public int TenantId { get; set; } } // ── Picklist DTO ─────────────────────────────────────────────────────────── public class SyncGroupPickListDTO { public int SyncGroupId { get; set; } public string SyncGroupName { get; set; } = string.Empty; } // ── List infrastructure ──────────────────────────────────────────────────── public sealed class SyncGroupListCriteria : ICriteria { [CriteriaField("ouid")] public int? OUId { get; set; } [CriteriaField("dbmodelid")] public int? DbModelId { get; set; } [CriteriaField("searchtext")] public string? SearchText { get; set; } [CriteriaField("sortby")] public string? SortBy { get; set; } [CriteriaField("sortdesc")] public bool SortDesc { get; set; } [CriteriaField("pagesize")] public int PageSize { get; set; } = 100; [CriteriaField("pageoffset")] public int PageOffset { get; set; } = 0; } public sealed record SyncGroupListQuery(SyncGroupListCriteria Criteria) : IListQuery; public sealed class SyncGroupListDTO { public int SyncGroupId { get; set; } public string? SyncGroupCode { get; set; } public string? SyncGroupName { get; set; } public int DbModelId { get; set; } public int TenantId { get; set; } public int TotalCount { get; set; } }