using System;
using System.Collections.Generic;
namespace PayRollDAL.DTO.GateEntry
{
///
/// Resolution result for one raw input row.
/// Contains fully-formed detail and header fields, plus any per-field errors.
///
public class GateEntryDetailResolveResultDTO
{
// ── Header-level resolved fields (for TGATEENTRY) ───────────────
/// Resolved from SupplierName. -1 if not found.
public int PartyId { get; set; } = -1;
public string PartyCode { get; set; }
public string PartyName { get; set; }
/// Invoice number passed through as-is for ReferenceNumber on the header.
public string InvoiceNumber { get; set; }
/// Invoice date passed through as-is for ReferenceDate on the header.
public DateOnly? InvoiceDate { get; set; }
// ── Detail row (for TGATEENTRYDETAIL) ───────────────────────────
/// Fully-formed detail row, ready to be added to GateEntryDTO.GateEntryDetailArray.
public GateEntryDetailDTO DetailRow { get; set; } = new GateEntryDetailDTO();
// ── Validation outcome ───────────────────────────────────────────
/// Per-field resolution errors. Empty means all lookups succeeded.
public List Errors { get; set; } = new List();
public bool IsValid => Errors.Count == 0;
}
// ── Internal Dapper mapping DTOs ─────────────────────────────────────
// These are only used inside GateEntryDAL for QuerySingleAsync calls.
internal class PartyLookupDTO
{
public int PartyId { get; set; }
public string PartyCode { get; set; }
public string PartyName { get; set; }
}
internal class ItemLookupDTO
{
public int ItemId { get; set; }
public string ItemCode { get; set; }
public string ItemName { get; set; }
}
internal class LotLookupDTO
{
public int LotId { get; set; }
public string LotNumber { get; set; }
}
internal class DocumentLookupDTO
{
public int DocumentId { get; set; }
public string DocumentNumber { get; set; }
}
internal class AllocationLookupDTO
{
public int AllocationId { get; set; }
}
internal class UOMLookupDTO
{
public int UOMId { get; set; }
public string UOMName { get; set; }
}
}