namespace ECPDAL.Collaboration.DTOs;
///
/// A single collaboration space row in TCOLLABORATIONSPACE — a thin named container + owner +
/// lifecycle status only. Per the plan's explicit scope decision, this module stores NO
/// discussion/comment content of its own; discussion flows through the existing Communication
/// module's TCOMMENTTHREAD, attached via ObjectTypeId=CollaborationSpace (MENTITY-registered) and
/// ObjectId=CollaborationSpaceId. Nothing in this DTO/module references ECPDAL.Communication/BLL.
///
public class CollaborationSpaceDTO
{
public int CollaborationSpaceId { get; set; }
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public int OwnerUserId { get; set; }
public string? OwnerUserCode { get; set; }
public string? OwnerUserName { get; set; }
public byte Status { get; set; } = 1; // 1=active 2=archived
public int OuId { get; set; } = -1;
public int TenantId { get; set; } = -1;
public string DatabaseName { get; set; } = string.Empty;
public byte DatabaseType { get; set; }
public short Version { get; set; }
public int CreatedById { get; set; } = -1;
public DateTime CreatedOn { get; set; }
public int ModifiedById { get; set; } = -1;
public DateTime ModifiedOn { get; set; }
/// Populated in-memory by CollaborationSpaceBLL when assembling a detail view —
/// never read from TCOLLABORATIONSPACE directly.
public List Members { get; set; } = [];
}
/// Input shape for SaveCollaborationSpace — a smaller surface than the full read DTO.
public class SaveCollaborationSpaceDTO
{
public int CollaborationSpaceId { get; set; }
public string Name { get; set; } = string.Empty;
public string? Description { get; set; }
public int OuId { get; set; } = -1;
}
/// A single membership row in TCOLLABORATIONSPACEMEMBER.
public class CollaborationSpaceMemberDTO
{
public int CollaborationSpaceMemberId { get; set; }
public int CollaborationSpaceId { get; set; }
public int UserId { get; set; }
public string? UserCode { get; set; }
public string? UserName { get; set; }
public byte Role { get; set; } = 2; // 1=owner 2=member
public int TenantId { get; set; } = -1;
public string DatabaseName { get; set; } = string.Empty;
public byte DatabaseType { get; set; }
public byte Status { get; set; } = 1; // 1=Active 2=Deleted
public int CreatedById { get; set; } = -1;
public DateTime CreatedOn { get; set; }
public int ModifiedById { get; set; } = -1;
public DateTime ModifiedOn { get; set; }
}
public class AddCollaborationSpaceMemberDTO
{
public int CollaborationSpaceId { get; set; }
public int UserId { get; set; }
public byte Role { get; set; } = 2; // 1=owner 2=member
}
/// Dropdown-picker row for GetSelectListCollaborationSpace — spaces the current user
/// owns or is a member of, same visibility rule as GetCollaborationSpaceList.
public class CollaborationSpacePicklistDTO
{
public int CollaborationSpaceId { get; set; }
public string Name { get; set; } = string.Empty;
}
/// Dropdown-picker row for GetSelectListCollaborationSpaceMember (the "Add Member"
/// picker) — users NOT already a member of the given space.
public class CollaborationSpaceMemberPicklistDTO
{
public int UserId { get; set; }
public string UserCode { get; set; } = string.Empty;
public string UserName { get; set; } = string.Empty;
}