using System; using System.Collections.Generic; namespace GB5Shared.ScanIdentifier { // Mirrors FM/FMDAL/DTO/ScanIdentifier/ScanIdentifierDTO.cs's confirmed MSCANIDENTIFIER shape, // plus the two print-lifecycle columns this platform adds (PrintCount/LastPrintedOn — FM's own // flow never needed them). EntityId stays string for the same reason FM's DTO documents: the // bridge spans mixed-key-type targets via EntityType+EntityId, not a hard FK. public sealed class GeneratedScanIdentifierDTO { public int ScanIdentifierId { get; set; } public byte IdentifierType { get; set; } public string IdentifierValue { get; set; } = string.Empty; public string EntityType { get; set; } = string.Empty; public string EntityId { get; set; } = string.Empty; public DateTime ValidFrom { get; set; } public DateTime? ValidTo { get; set; } public byte Status { get; set; } = 1; public int PrintCount { get; set; } public DateTime? LastPrintedOn { get; set; } public int TenantId { get; set; } = -1; } // MSCANTARGETCONFIG row — "details supplied as data" driving the generic engine's behavior // per EntityType, tenant-overridable (TenantId=-1 is the global default). public sealed class ScanTargetConfigDTO { public int ScanTargetConfigId { get; set; } public string EntityType { get; set; } = string.Empty; public byte DefaultIdentifierType { get; set; } = 2; // 2 = QR public byte ValueScheme { get; set; } // 0 EmbedId, 1 OpaqueCode public string? Prefix { get; set; } // used only when ValueScheme=0; null falls back to EntityType public bool AllowMultiQty { get; set; } public int? MaxQty { get; set; } public int? DefaultLabelTypeId { get; set; } public int? DefaultPrinterTypeId { get; set; } public int TenantId { get; set; } = -1; } public sealed class GenerateScanIdentifierRequestDTO { public required string EntityType { get; init; } public required string EntityId { get; init; } public int Quantity { get; init; } = 1; public byte? IdentifierType { get; init; } // null = use MSCANTARGETCONFIG default } public sealed class GenerateScanIdentifierResultDTO { public IReadOnlyList Generated { get; init; } = []; } // MGCM row (PRINTTYPE or BARLABEL) — read directly from MGCM, WI has no reason to own its own copy. public sealed class GcmPicklistDTO { public int GcmId { get; set; } public string Code { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; } // MLABELTEMPLATE row — the real physical dimensions a BARLABEL MGCM row doesn't itself carry. public sealed class LabelTemplateDTO { public int LabelTemplateId { get; set; } public int GcmId { get; set; } public decimal WidthMm { get; set; } public decimal HeightMm { get; set; } public short LabelsPerSheet { get; set; } = 1; } public sealed class PrintBatchRequestDTO { public required List ScanIdentifierIds { get; init; } public required int LabelTypeGcmId { get; init; } } }