V13-FE-011: finalize search list layout slice
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user