-
Notifications
You must be signed in to change notification settings - Fork 0
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 #129 from Tech-Fabric/feature/2027/update-ES-nugets
Feature/2027/update es nugets
- Loading branch information
Showing
18 changed files
with
739 additions
and
249 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
namespace CloudFabric.EAV.Domain.GeneratedValues; | ||
|
||
public class Counter : IGeneratedValueInfo | ||
{ | ||
public long NextValue { get; set; } | ||
|
||
private int? _lastIncrement; | ||
public int? LastIncrement | ||
{ | ||
get { return _lastIncrement; } | ||
init { _lastIncrement = value; } | ||
} | ||
|
||
private DateTime _timestamp; | ||
public DateTime Timestamp | ||
{ | ||
get { return _timestamp; } | ||
init { _timestamp = value; } | ||
} | ||
|
||
public Guid AttributeConfidurationId { get; init; } | ||
|
||
// Used for Json deserialization | ||
public Counter() | ||
{ | ||
} | ||
|
||
public Counter(long nextValue, DateTime timestamp, Guid attributeConfigurationId, int? lastIncrement = null) | ||
{ | ||
NextValue = nextValue; | ||
Timestamp = timestamp; | ||
AttributeConfidurationId = attributeConfigurationId; | ||
LastIncrement = lastIncrement; | ||
} | ||
|
||
public void SetTimestamp(DateTime timestamp) | ||
{ | ||
_timestamp = timestamp; | ||
} | ||
|
||
public long Step(int increment) | ||
{ | ||
_lastIncrement = increment; | ||
return NextValue += increment; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
CloudFabric.EAV.Domain/GeneratingValues/IGeneratedValueInfo.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,8 @@ | ||
namespace CloudFabric.EAV.Domain.GeneratedValues; | ||
|
||
public interface IGeneratedValueInfo | ||
{ | ||
public Guid AttributeConfidurationId { get; init; } | ||
|
||
public DateTime Timestamp { get; init; } | ||
} |
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,10 @@ | ||
namespace CloudFabric.EAV.Enums; | ||
|
||
public enum GeneratedValueActionStatus | ||
{ | ||
|
||
NoAction, | ||
Saved, | ||
Conflict, | ||
Failed | ||
} |
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,20 @@ | ||
using CloudFabric.EAV.Enums; | ||
|
||
namespace CloudFabric.EAV.Models; | ||
|
||
public class GeneratedValueActionResponse | ||
{ | ||
public GeneratedValueActionResponse(Guid entityConfiguration, Guid attributeConfigurationId) | ||
{ | ||
EntityConfigurationId = entityConfiguration; | ||
AttributeConfigurationId = attributeConfigurationId; | ||
} | ||
|
||
public Type? GeneratedValueType { get; set; } | ||
|
||
public GeneratedValueActionStatus Status { get; set; } | ||
|
||
public Guid EntityConfigurationId { get; } | ||
|
||
public Guid AttributeConfigurationId { get; } | ||
} |
2 changes: 1 addition & 1 deletion
2
CloudFabric.EAV.Models/RequestModels/Attributes/SerialAttributeConfigurationUpdateRequest.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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace CloudFabric.EAV.Options; | ||
|
||
public class ValueAttributeServiceOptions | ||
{ | ||
public int ActionMaxCountAttempts { get; set; } = 4; | ||
} |
14 changes: 14 additions & 0 deletions
14
CloudFabric.EAV.Service/Abstractions/IGeneratedValueService.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,14 @@ | ||
using CloudFabric.EAV.Domain.GeneratedValues; | ||
using CloudFabric.EAV.Models; | ||
using CloudFabric.EAV.Models.ViewModels.Attributes; | ||
|
||
namespace CloudFabric.EAV.Service.Abstractions; | ||
|
||
public interface IGeneratedValueService<T> where T : IGeneratedValueInfo | ||
{ | ||
Task<T?> Create(Guid entityConfigurationId, AttributeConfigurationViewModel attributeConfiguration); | ||
|
||
Task<T?> Load(Guid entityConfigurationId, Guid attributeConfigurationId); | ||
|
||
Task<GeneratedValueActionResponse> Save(Guid entityConfigurationId, Guid attributeConfigurationId, T generatedValueInfo); | ||
} |
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.