-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
3f1463c
commit 3bcc7ed
Showing
36 changed files
with
431 additions
and
74 deletions.
There are no files selected for viewing
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
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,17 @@ | ||
using Domain.Common; | ||
using Domain.Common.ValueObjects; | ||
using JetBrains.Annotations; | ||
|
||
namespace Domain.Events.Shared.Subscriptions; | ||
|
||
public sealed class Deleted : TombstoneDomainEvent | ||
{ | ||
public Deleted(Identifier id, Identifier deletedById) : base(id, deletedById) | ||
{ | ||
} | ||
|
||
[UsedImplicitly] | ||
public Deleted() | ||
{ | ||
} | ||
} |
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,53 @@ | ||
using Common; | ||
using Common.Extensions; | ||
using Domain.Common.ValueObjects; | ||
using Domain.Interfaces; | ||
|
||
namespace Domain.Shared.Subscriptions; | ||
|
||
public sealed class BillingSubscriber : ValueObjectBase<BillingSubscriber> | ||
{ | ||
public static Result<BillingSubscriber, Error> Create(string subscriptionId, string subscriberId) | ||
{ | ||
if (subscriptionId.IsNotValuedParameter(nameof(subscriptionId), out var error1)) | ||
{ | ||
return error1; | ||
} | ||
|
||
if (subscriberId.IsNotValuedParameter(nameof(subscriberId), out var error2)) | ||
{ | ||
return error2; | ||
} | ||
|
||
return new BillingSubscriber(subscriptionId, subscriberId); | ||
} | ||
|
||
private BillingSubscriber(string subscriptionId, string subscriberId) | ||
{ | ||
SubscriptionId = subscriptionId; | ||
SubscriberId = subscriberId; | ||
} | ||
|
||
public string SubscriberId { get; } | ||
|
||
public string SubscriptionId { get; } | ||
|
||
public static ValueObjectFactory<BillingSubscriber> Rehydrate() | ||
{ | ||
return (property, container) => | ||
{ | ||
var parts = RehydrateToList(property, false); | ||
return new BillingSubscriber(parts[0]!, parts[1]!); | ||
}; | ||
} | ||
|
||
protected override IEnumerable<object?> GetAtomicValues() | ||
{ | ||
return new object[] { SubscriptionId, SubscriberId }; | ||
} | ||
|
||
public BillingSubscriber ChangeSubscriber(Identifier subscriberId) | ||
{ | ||
return new BillingSubscriber(SubscriptionId, subscriberId); | ||
} | ||
} |
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
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.