Files
KArtSell.Aegis/docs/Design/kbx-foundation-v60-status-canonical-contract-hardening/backend/Shared/Excel/ImportFieldDefinitionFactory.cs
T
kjh2064 3f293d8aa8
deploy / deploy (push) Successful in 1m52s
deploy / notify (push) Successful in 1s
V13-FE-006: consolidate approved UI and contract hardening
2026-08-13 02:41:00 +09:00

27 lines
878 B
C#

using Kbx.Contracts.Generated;
namespace Shared.Excel;
public static class ImportFieldDefinitionFactory
{
public static ImportFieldDefinition FromKbxField(string key, bool? required = null, string? label = null)
{
var field = KbxFieldCatalog.Get(key);
if (!field.Importable)
throw new InvalidOperationException($"KBX field '{key}' is not importable.");
return new ImportFieldDefinition(
Key: field.Key,
Label: label ?? field.Label,
Aliases: field.Aliases,
DataType: field.DataType,
Required: required ?? field.Required,
MaxLength: field.MaxLength,
Precision: field.Precision,
Scale: field.Scale,
LookupEntity: field.LookupEntity,
Importable: field.Importable,
Exportable: field.Exportable);
}
}