using System;
using GB5Shared.Enums;
namespace GB5Shared.DTO.Draft
{
///
/// Abstract base all entity line/sub-detail DTOs must inherit.
/// RowGuid is generated once by the FE (crypto.randomUUID) and
/// never changes for the lifetime of the row — even across crash
/// recovery. It is the upsert key in TDRAFT_ROWS and the join
/// key for attachment resolution (TATTACHMENT.ROWGUID).
///
public abstract class GridRowDto
{
/// Client-generated UUID. Immutable once created.
public Guid RowGuid { get; set; }
/// Unchanged=0 is never sent to the server.
public RowState RowState { get; set; }
/// 0 for New rows. Real entity table PK for Modified/Deleted.
public int ServerRowId { get; set; }
/// Null for top-level rows. Points to parent row RowGuid for sub-details.
public Guid? ParentRowGuid { get; set; }
/// 0 when parent is New. Real parent PK after parent is saved.
public int ParentServerId { get; set; }
/// Display order in the grid, independent of insert sequence.
public int SortOrder { get; set; }
}
}