Phase 0 WP-0.2–0.9: Implement Commons (types, entities, interfaces, messages, protocol, tests)
- WP-0.2: Namespace/folder skeleton (26 directories) - WP-0.3: Shared data types (6 enums, RetryPolicy, Result<T>) - WP-0.4: 24 domain entity POCOs across 10 domain areas - WP-0.5: 7 repository interfaces with full CRUD signatures - WP-0.6: IAuditService cross-cutting interface - WP-0.7: 26 message contract records across 8 concern areas - WP-0.8: IDataConnection protocol abstraction with batch ops - WP-0.9: 8 architectural constraint enforcement tests All 40 tests pass, zero warnings.
This commit is contained in:
15
src/ScadaLink.Commons/Entities/InboundApi/ApiKey.cs
Normal file
15
src/ScadaLink.Commons/Entities/InboundApi/ApiKey.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
namespace ScadaLink.Commons.Entities.InboundApi;
|
||||
|
||||
public class ApiKey
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string KeyValue { get; set; }
|
||||
public bool IsEnabled { get; set; }
|
||||
|
||||
public ApiKey(string name, string keyValue)
|
||||
{
|
||||
Name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
KeyValue = keyValue ?? throw new ArgumentNullException(nameof(keyValue));
|
||||
}
|
||||
}
|
||||
18
src/ScadaLink.Commons/Entities/InboundApi/ApiMethod.cs
Normal file
18
src/ScadaLink.Commons/Entities/InboundApi/ApiMethod.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
namespace ScadaLink.Commons.Entities.InboundApi;
|
||||
|
||||
public class ApiMethod
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Script { get; set; }
|
||||
public string? ApprovedApiKeyIds { get; set; }
|
||||
public string? ParameterDefinitions { get; set; }
|
||||
public string? ReturnDefinition { get; set; }
|
||||
public int TimeoutSeconds { get; set; }
|
||||
|
||||
public ApiMethod(string name, string script)
|
||||
{
|
||||
Name = name ?? throw new ArgumentNullException(nameof(name));
|
||||
Script = script ?? throw new ArgumentNullException(nameof(script));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user