-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b29e8cb
commit 08934db
Showing
23 changed files
with
88 additions
and
84 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
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
2 changes: 1 addition & 1 deletion
2
...ign/Fitnet.Contracts/Src/Fitnet.Contracts.Application/SignContract/SignContractCommand.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace EvolutionaryArchitecture.Fitnet.Contracts.Application.SignContract; | ||
|
||
public sealed record SignContractCommand(Guid Id, string SignatureText, DateTimeOffset SignedAt) : ICommand<ErrorOr<Guid>>; | ||
public sealed record SignContractCommand(Guid Id, string Signature, DateTimeOffset SignedAt) : ICommand<ErrorOr<Guid>>; |
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
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
4 changes: 3 additions & 1 deletion
4
...-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/GlobalUsings.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 |
---|---|---|
@@ -1 +1,3 @@ | ||
global using ErrorOr; | ||
global using System.Text.RegularExpressions; | ||
global using ErrorOr; | ||
global using EvolutionaryArchitecture.Fitnet.Contracts.Core.SignContract.Signatures.Exceptions; |
25 changes: 25 additions & 0 deletions
25
...gn/Fitnet.Contracts/Src/Fitnet.Contracts.Core/SignContract/Signatures/DigitalSignature.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,25 @@ | ||
namespace EvolutionaryArchitecture.Fitnet.Contracts.Core.SignContract.Signatures; | ||
|
||
public sealed partial class DigitalSignature | ||
{ | ||
private static readonly Regex SignaturePattern = SignatureAllowedCharacters(); | ||
public DateTimeOffset Date { get; } | ||
public string Signature { get; } | ||
|
||
private DigitalSignature(DateTimeOffset date, string signature) | ||
{ | ||
Date = date; | ||
if (!SignaturePattern.IsMatch(signature)) | ||
{ | ||
throw new DigitalSignatureNotValidException(signature); | ||
} | ||
|
||
Signature = signature; | ||
} | ||
|
||
public static DigitalSignature From(DateTimeOffset signedAt, string signature) => | ||
new(signedAt, signature); | ||
|
||
[GeneratedRegex(@"^[A-Za-z\s]+$")] | ||
private static partial Regex SignatureAllowedCharacters(); | ||
} |
3 changes: 3 additions & 0 deletions
3
...et.Contracts.Core/SignContract/Signatures/Exceptions/DigitalSignatureNotValidException.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,3 @@ | ||
namespace EvolutionaryArchitecture.Fitnet.Contracts.Core.SignContract.Signatures.Exceptions; | ||
|
||
public sealed class DigitalSignatureNotValidException(string signatureText) : InvalidOperationException($"Signature: '{signatureText}' contains invalid characters."); |
3 changes: 0 additions & 3 deletions
3
...rc/Fitnet.Contracts.Core/SignContract/Signatures/Exceptions/SignatureNotValidException.cs
This file was deleted.
Oops, something went wrong.
28 changes: 0 additions & 28 deletions
28
...en-design/Fitnet.Contracts/Src/Fitnet.Contracts.Core/SignContract/Signatures/Signature.cs
This file was deleted.
Oops, something went wrong.
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
8 changes: 4 additions & 4 deletions
8
...240908094351_AddSignatureText.Designer.cs → ...s/20241026082140_AddSignature.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.