Skip to content

Commit 297bc33

Browse files
committed
import data tweaks, xml doc updates
1 parent 761fa8e commit 297bc33

22 files changed

+923
-573
lines changed

src/FluentCommand.Import/FieldDefinition.cs

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
namespace FluentCommand.Import;
44

55
/// <summary>
6-
/// Represents the definition and configuration of a field for import operations.
6+
/// Represents the definition and configuration of a field for import operations, including metadata, data type, mapping, and transformation options.
77
/// </summary>
88
public class FieldDefinition
99
{
1010
/// <summary>
11-
/// Gets or sets the display name of the field, used for UI or reporting purposes.
11+
/// Gets or sets the display name of the field, typically used for user interfaces or reporting.
1212
/// </summary>
1313
[JsonPropertyName("displayName")]
1414
public string? DisplayName { get; set; }
1515

1616
/// <summary>
17-
/// Gets or sets the unique name of the field.
17+
/// Gets or sets the unique identifier or name of the field.
1818
/// </summary>
1919
[JsonPropertyName("name")]
2020
public string Name { get; set; } = null!;
2121

2222
/// <summary>
23-
/// Gets or sets the data type of the field.
23+
/// Gets or sets the .NET <see cref="Type"/> representing the data type of the field.
2424
/// </summary>
2525
[JsonPropertyName("dataType")]
2626
[JsonConverter(typeof(Converters.TypeJsonConverter))]
2727
public Type? DataType { get; set; }
2828

2929
/// <summary>
30-
/// Gets or sets a value indicating whether this field is a key field.
30+
/// Gets or sets a value indicating whether this field is a key field, used to uniquely identify records.
3131
/// </summary>
3232
/// <value>
3333
/// <c>true</c> if this field is a key; otherwise, <c>false</c>.
@@ -36,7 +36,7 @@ public class FieldDefinition
3636
public bool IsKey { get; set; }
3737

3838
/// <summary>
39-
/// Gets or sets a value indicating whether this field can be inserted during import. The default is <c>true</c>.
39+
/// Gets or sets a value indicating whether this field can be inserted during import operations. The default is <c>true</c>.
4040
/// </summary>
4141
/// <value>
4242
/// <c>true</c> if this field can be inserted; otherwise, <c>false</c>.
@@ -45,7 +45,7 @@ public class FieldDefinition
4545
public bool CanInsert { get; set; } = true;
4646

4747
/// <summary>
48-
/// Gets or sets a value indicating whether this field can be updated during import. The default is <c>true</c>.
48+
/// Gets or sets a value indicating whether this field can be updated during import operations. The default is <c>true</c>.
4949
/// </summary>
5050
/// <value>
5151
/// <c>true</c> if this field can be updated; otherwise, <c>false</c>.
@@ -63,7 +63,7 @@ public class FieldDefinition
6363
public bool CanMap { get; set; } = true;
6464

6565
/// <summary>
66-
/// Gets or sets a value indicating whether this field is required for import.
66+
/// Gets or sets a value indicating whether this field is required for import. Required fields must be provided in the import data.
6767
/// </summary>
6868
/// <value>
6969
/// <c>true</c> if the field is required; otherwise, <c>false</c>.
@@ -72,10 +72,10 @@ public class FieldDefinition
7272
public bool IsRequired { get; set; }
7373

7474
/// <summary>
75-
/// Gets or sets the default value behavior for the field during import.
75+
/// Gets or sets the default value behavior for the field during import, as specified by <see cref="FieldDefault"/>.
7676
/// </summary>
7777
/// <value>
78-
/// The <see cref="FieldDefault"/> option specifying how the default value is determined.
78+
/// The <see cref="FieldDefault"/> option that determines how the default value is assigned.
7979
/// </value>
8080
[JsonPropertyName("default")]
8181
public FieldDefault? Default { get; set; }
@@ -84,35 +84,47 @@ public class FieldDefinition
8484
/// Gets or sets the static default value for the field, used when <see cref="Default"/> is set to <see cref="FieldDefault.Static"/>.
8585
/// </summary>
8686
/// <value>
87-
/// The static default value for the field.
87+
/// The static default value to assign to the field if no value is provided during import.
8888
/// </value>
8989
[JsonPropertyName("defaultValue")]
9090
public object? DefaultValue { get; set; }
9191

9292
/// <summary>
93-
/// Gets or sets the type of the field translator, used to transform or convert field values during import.
93+
/// Gets or sets the <see cref="Type"/> of the field translator, which is used to transform or convert field values during import.
94+
/// The type must implement <see cref="IFieldTranslator"/>.
9495
/// </summary>
9596
/// <value>
96-
/// The <see cref="Type"/> of the field translator.
97+
/// The <see cref="Type"/> implementing the translation logic for this field.
9798
/// </value>
9899
[JsonPropertyName("translator")]
99100
[JsonConverter(typeof(Converters.TypeJsonConverter))]
101+
[Obsolete("Use TranslatorKey instead. This property will be removed in a future version.")]
100102
public Type? Translator { get; set; }
101103

102104
/// <summary>
103-
/// Gets or sets the list of match expressions used for mapping or validation.
105+
/// Gets or sets the service key used to resolve the <see cref="IFieldTranslator"/> service from the dependency injection container.
106+
/// The service must be registered in the DI container with this key and implement <see cref="IFieldTranslator"/>.
104107
/// </summary>
105108
/// <value>
106-
/// A list of string expressions for matching or validation.
109+
/// The service key used to resolve the translator service from the dependency injection container.
110+
/// </value>
111+
[JsonPropertyName("translatorKey")]
112+
public string? TranslatorKey { get; set; }
113+
114+
/// <summary>
115+
/// Gets or sets the list of match or validation expressions associated with this field. These expressions can be used for mapping or validating field values during import.
116+
/// </summary>
117+
/// <value>
118+
/// A list of string expressions for matching or validation purposes.
107119
/// </value>
108120
[JsonPropertyName("expressions")]
109121
public List<string> Expressions { get; set; } = [];
110122

111123
/// <summary>
112-
/// Returns a string that represents the current <see cref="FieldDefinition"/> instance.
124+
/// Returns a string that represents the current <see cref="FieldDefinition"/> instance, including display name, field name, and data type.
113125
/// </summary>
114126
/// <returns>
115-
/// A <see cref="string"/> that contains the display name, field name, and data type.
127+
/// A <see cref="string"/> containing the display name, field name, and data type of the field.
116128
/// </returns>
117129
public override string ToString()
118130
{

0 commit comments

Comments
 (0)