-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from data-solution-automation-engine/dev-2024-06
Dev 2024 06 - 2.1.0 version
- Loading branch information
Showing
35 changed files
with
837 additions
and
1,011 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/Cardinality.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
namespace DataWarehouseAutomation.DwaModel; | ||
|
||
/// <summary> | ||
/// This object captures the cardinality and ordinality of a relationship. | ||
/// Cardinality refers to the uniqueness of data values contained in a column (attribute) of a database table. | ||
/// It defines the number of occurrences of one entity that are associated with the number of occurrences of another entity through a relationship. | ||
/// </summary> | ||
public class Cardinality | ||
{ | ||
/// <summary> | ||
/// Optional identifier as a string value to allow various identifier approaches. | ||
/// </summary> | ||
[JsonPropertyName("id")] | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] | ||
public string? Id { get; set; } | ||
|
||
/// <summary> | ||
/// Optional information to name a certain cardinality construct. | ||
/// For example one-to-one, one-to-many, or many-to-many. | ||
/// E.g. one-to-one could be defined as {"fromRange": {"min": "1", "max": "1"}, "toRange": {"min": "1", "max": "1"}}. | ||
/// </summary> | ||
[JsonPropertyName("name")] | ||
public string? Name { get; set; } | ||
|
||
/// <summary> | ||
/// The 'from' component in the cardinality, e.g. the '1' in 1 to many. | ||
/// </summary> | ||
[JsonPropertyName("fromRange")] | ||
public CardinalityRange? FromRange { get; set; } = new CardinalityRange { Min = "1", Max = "1" }; | ||
|
||
/// <summary> | ||
/// The 'to' component in the cardinality, e.g. the 'many' in 1 to many. | ||
/// </summary> | ||
[JsonPropertyName("toRange")] | ||
public CardinalityRange? ToRange { get; set; } = new CardinalityRange { Min = "1", Max = "N" }; | ||
|
||
/// <summary> | ||
/// Free-form and optional classification for the Cardinality for use in generation logic (evaluation). | ||
/// </summary> | ||
[JsonPropertyName("classifications")] | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] | ||
public List<DataClassification>? Classifications { get; set; } | ||
|
||
/// <summary> | ||
/// The collection of extension Key/Value pairs. | ||
/// </summary> | ||
[JsonPropertyName("extensions")] | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] | ||
public List<Extension>? Extensions { get; set; } | ||
|
||
/// <summary> | ||
/// Free-format notes. | ||
/// </summary> | ||
[JsonPropertyName("notes")] | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] | ||
public string? Notes { get; set; } | ||
|
||
#region Methods | ||
/// <summary> | ||
/// Use this method to assert if two Cardinalities are the same, based on their Ids. | ||
/// </summary> | ||
/// <param name="obj"></param> | ||
/// <returns>True if the Cardinalities are the same, based on their Ids</returns> | ||
public override bool Equals(object? obj) | ||
{ | ||
var other = obj as Cardinality; | ||
return other?.Id == Id; | ||
} | ||
|
||
/// <summary> | ||
/// Override to get a hash value that represents the identifier. | ||
/// </summary> | ||
/// <returns>A 32-bit signed integer hash code</returns> | ||
public override int GetHashCode() => (Id?.GetHashCode()) ?? 0; | ||
|
||
/// <summary> | ||
/// String override so that the object returns its value ('Name'). | ||
/// When an instance of this class is passed to a method that expects a string, the ToString() method will be called implicitly to convert the object to a string, and the value of the "Name" property will be returned. | ||
/// </summary> | ||
/// <returns>The Name</returns> | ||
public override string ToString() | ||
{ | ||
return Name ?? string.Empty; | ||
} | ||
#endregion | ||
} |
15 changes: 15 additions & 0 deletions
15
DataWarehouseAutomation/DataWarehouseAutomation/DwaModel/CardinalityRange.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace DataWarehouseAutomation.DwaModel; | ||
|
||
/// <summary> | ||
/// The possible range for a from/to component for the cardinality. | ||
/// For example "min": "1", "max": "N" | ||
/// This way, you can define "at least 1 to many". Or "0 or 1 to 1". | ||
/// </summary> | ||
public class CardinalityRange | ||
{ | ||
[JsonPropertyName("min")] | ||
public string? Min { get; set; } | ||
|
||
[JsonPropertyName("max")] | ||
public string? Max { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.