namespace QMSDAL.DTO
{
// ─────────────────────────────────────────────────────────────────────────
// MatrixGenerationResultDTO
// Returned by GenerateMatrixLots (preview) and ActivateMatrix (save).
// Supports Set View + FG View UI.
// Does NOT replace ActivationResultDTO — both coexist.
// ─────────────────────────────────────────────────────────────────────────
public class MatrixGenerationResultDTO
{
// ── Header banner ─────────────────────────────────────────────────────
/// "52 serial numbers ready"
public string HeaderTitle { get; set; } = string.Empty;
/// "4 sets · SO-2024-0031 · Hull Panel Set · Review and save below"
public string HeaderSubtitle { get; set; } = string.Empty;
/// Top-right counter: 4 SETS
public int TotalSets { get; set; }
/// Top-right counter: 52 SERIALS
public int TotalSerials { get; set; }
/// Top-right counter: 5 FG TYPES
public int TotalFGTypes { get; set; }
// ── Footer save bar ───────────────────────────────────────────────────
/// "52 serial numbers ready to save"
public string FooterTitle { get; set; } = string.Empty;
/// "SO-2024-0031 · Hull Panel Set · Sets 1–4"
public string FooterSubtitle { get; set; } = string.Empty;
// ── Context ───────────────────────────────────────────────────────────
/// Raw DB MatrixId — populated after ActivateMatrix
public int MatrixId { get; set; }
/// Matrix code e.g. "MAT2026-15/6"
public string MatrixCode { get; set; } = string.Empty;
/// SO number e.g. "SO000034/2627"
public string SONumber { get; set; } = string.Empty;
/// FG item name e.g. "REAR MIDDLE NACELLE COVER"
public string ProductName { get; set; } = string.Empty;
/// "Sets 1–4"
public string SetRange { get; set; } = string.Empty;
// ── Counts for success screen ─────────────────────────────────────────
/// SET lots + FG serial lots — shown as "44 TLOT RECORDS"
public int TLotRecords { get; set; }
/// System reference e.g. "SER-2026-54598"
public string Reference { get; set; } = string.Empty;
// ── Set View ──────────────────────────────────────────────────────────
/// One entry per set — used for Set View tab
public List Sets { get; set; } = [];
// ── FG View ───────────────────────────────────────────────────────────
/// One entry per FG item type — used for FG View tab
public List FGItems { get; set; } = [];
// ── Composition dashboard ────────────────────────────────────────────
/// Product Composition & Next Serial Numbers dashboard (MBOM/TLOT-only).
public MatrixCompositionDTO? Composition { get; set; }
}
// ─────────────────────────────────────────────────────────────────────────
// Set View — one set block
// UI: Set 1 [SET-000001] 13 serials PLANNED
// ─────────────────────────────────────────────────────────────────────────
public class GeneratedSetDTO
{
/// Set number: 1, 2, 3, 4
public int SetNumber { get; set; }
/// Display code: "SET-000001"
public string SetCode { get; set; } = string.Empty;
/// Raw DB SET lot ID — used for internal DB operations
public int SetLotId { get; set; }
/// Total FG serials in this set: 13
public int TotalSerials { get; set; }
/// "PLANNED"
public string Status { get; set; } = "PLANNED";
/// FG items with their serials for this set
public List FGItems { get; set; } = [];
}
// ─────────────────────────────────────────────────────────────────────────
// Set View — one FG item row inside a set
// UI: Outer Hull Panel FG-011 2× [01 OHP-0011] [02 OHP-0012]
// ─────────────────────────────────────────────────────────────────────────
public class GeneratedSetFGItemDTO
{
public string FGItemName { get; set; } = string.Empty;
public string FGItemCode { get; set; } = string.Empty;
/// Qty per set: 2×, 4×, 1×. Can be large (e.g. 2600 for bulk/weight items).
public int QtyPerSet { get; set; }
///
/// Slot-numbered serials for this FG item in this set — capped at a display
/// limit (see MatrixBLL.MAX_SERIAL_TILES_PER_ITEM). Use TotalSerialsForItem /
/// SerialRangeFrom / SerialRangeTo for the true full count and range when
/// QtyPerSet exceeds the cap.
///
public List Serials { get; set; } = [];
/// True serial count for this item in this set (== QtyPerSet). May exceed Serials.Count.
public int TotalSerialsForItem { get; set; }
/// First serial number for this item in this set (always populated, even if capped).
public string SerialRangeFrom { get; set; } = string.Empty;
/// Last serial number for this item in this set (always populated, even if capped).
public string SerialRangeTo { get; set; } = string.Empty;
}
// ─────────────────────────────────────────────────────────────────────────
// Set View — one serial tile inside a set's FG item
// UI tile: 01 OHP-0011
// ─────────────────────────────────────────────────────────────────────────
public class GeneratedSerialDTO
{
/// Slot number within this set: 01, 02, 03
public int SlotNumber { get; set; }
///
/// Global running sequence per FG item across all sets.
/// Frontend uses: FGItemPrefix + RunningNumber → "OHP-0011"
/// e.g. RunningNumber=11 + prefix "OHP" → "OHP-0011"
///
public int RunningNumber { get; set; }
/// Raw DB lot ID — used for internal DB operations
public int LotId { get; set; }
/// Raw lot number string from DB e.g. "-1499999717"
public string LotNumber { get; set; } = string.Empty;
}
// ─────────────────────────────────────────────────────────────────────────
// FG View — one FG item block
// UI: Outer Hull Panel FG-011 8 serials ▼
// S1 OHP-0011 S1 OHP-0012 S2 OHP-0013 ...
// ─────────────────────────────────────────────────────────────────────────
public class GeneratedFGItemDTO
{
public int RowNumber { get; set; }
public string FGItemName { get; set; } = string.Empty;
public string FGItemCode { get; set; } = string.Empty;
/// True total serials across all requested sets for this FG type — may exceed Serials.Count when capped.
public int TotalSerials { get; set; }
/// All serials with set label — S1, S2, S3... Capped at a display limit; see TotalSerials for the true count.
public List Serials { get; set; } = [];
/// First serial number for this item across the whole run (always populated, even if capped).
public string SerialRangeFrom { get; set; } = string.Empty;
/// Last serial number for this item across the whole run (always populated, even if capped).
public string SerialRangeTo { get; set; } = string.Empty;
}
// ─────────────────────────────────────────────────────────────────────────
// FG View — one serial tile
// UI tile: S1 OHP-0011
// ─────────────────────────────────────────────────────────────────────────
public class GeneratedFGSerialDTO
{
/// Set label: "S1", "S2", "S3", "S4"
public string SetLabel { get; set; } = string.Empty;
///
/// Global running sequence per FG item.
/// Frontend uses: FGItemPrefix + RunningNumber → "OHP-0011"
///
public int RunningNumber { get; set; }
/// Raw DB lot ID — used for internal DB operations
public int LotId { get; set; }
/// Raw lot number string from DB
public string LotNumber { get; set; } = string.Empty;
}
// ─────────────────────────────────────────────────────────────────────────
// ActivationConfirmDTO — Returned by ActivateMatrix (YES, SAVE button)
// Simple success confirmation shown on the success screen
// ─────────────────────────────────────────────────────────────────────────
public class ActivationConfirmDTO
{
/// "40 serial numbers saved"
public string Title { get; set; } = string.Empty;
/// "Sets 1–4 · SO000034/2627 · REAR MIDDLE NACELLE COVER"
public string Subtitle { get; set; } = string.Empty;
/// Reference: "SER-2026-54598"
public string Reference { get; set; } = string.Empty;
/// Total SET lots created
public int SetLots { get; set; }
/// Total FG serial lots created
public int Serials { get; set; }
/// Total TLOT records = SetLots + Serials
public int TLotRecords { get; set; }
/// "Sets 1–4"
public string SetRange { get; set; } = string.Empty;
/// First lot number generated e.g. "ML00047/2526"
public string FirstLotNumber { get; set; } = string.Empty;
/// Last lot number generated e.g. "ML00086/2526"
public string LastLotNumber { get; set; } = string.Empty;
/// Status: "PLANNED"
public string Status { get; set; } = "PLANNED";
}
}