diff --git a/src/Application.Interfaces/Audits.Designer.cs b/src/Application.Interfaces/Audits.Designer.cs
index 6948483a..06673bb2 100644
--- a/src/Application.Interfaces/Audits.Designer.cs
+++ b/src/Application.Interfaces/Audits.Designer.cs
@@ -149,6 +149,15 @@ public static string EndUsersApplication_User_Registered_TermsAccepted {
}
}
+ ///
+ /// Looks up a localized string similar to Organization.Deleted.
+ ///
+ public static string OrganizationApplication_OrganizationDeleted {
+ get {
+ return ResourceManager.GetString("OrganizationApplication_OrganizationDeleted", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Authentication.Failed.AccountLocked.
///
diff --git a/src/Application.Interfaces/Audits.resx b/src/Application.Interfaces/Audits.resx
index 17cc153a..0b67894f 100644
--- a/src/Application.Interfaces/Audits.resx
+++ b/src/Application.Interfaces/Audits.resx
@@ -81,4 +81,7 @@
Subscription.BuyerTransferred
+
+ Organization.Deleted
+
\ No newline at end of file
diff --git a/src/Application.Services.Shared/IOwningEntityService.cs b/src/Application.Services.Shared/ISubscriptionOwningEntityService.cs
similarity index 97%
rename from src/Application.Services.Shared/IOwningEntityService.cs
rename to src/Application.Services.Shared/ISubscriptionOwningEntityService.cs
index 5754fbd3..f45f9b4d 100644
--- a/src/Application.Services.Shared/IOwningEntityService.cs
+++ b/src/Application.Services.Shared/ISubscriptionOwningEntityService.cs
@@ -6,7 +6,7 @@ namespace Application.Services.Shared;
///
/// Defines a service for asserting the permissions of an owning entity of a billing subscription.
///
-public interface IOwningEntityService
+public interface ISubscriptionOwningEntityService
{
///
/// Whether the subscription can be cancelled by the
diff --git a/src/Domain.Common/ValueObjects/SingleValueObjectBase.cs b/src/Domain.Common/ValueObjects/SingleValueObjectBase.cs
index 716152ca..7a6bbba4 100644
--- a/src/Domain.Common/ValueObjects/SingleValueObjectBase.cs
+++ b/src/Domain.Common/ValueObjects/SingleValueObjectBase.cs
@@ -29,6 +29,7 @@ protected SingleValueObjectBase(TValue value)
TValue ISingleValueObject.Value => Value;
+ [DebuggerStepThrough]
public static implicit operator TValue(SingleValueObjectBase valueObject)
{
return valueObject.NotExists() || valueObject.Value.NotExists()
diff --git a/src/Domain.Events.Shared/Organizations/BillingSubscribed.cs b/src/Domain.Events.Shared/Organizations/BillingSubscribed.cs
index b9aad0c3..24dbb3ae 100644
--- a/src/Domain.Events.Shared/Organizations/BillingSubscribed.cs
+++ b/src/Domain.Events.Shared/Organizations/BillingSubscribed.cs
@@ -17,4 +17,5 @@ public BillingSubscribed()
public required string SubscriberId { get; set; }
+ public required string SubscriptionId { get; set; }
}
\ No newline at end of file
diff --git a/src/Domain.Events.Shared/Subscriptions/Deleted.cs b/src/Domain.Events.Shared/Subscriptions/Deleted.cs
new file mode 100644
index 00000000..bf22dc0f
--- /dev/null
+++ b/src/Domain.Events.Shared/Subscriptions/Deleted.cs
@@ -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()
+ {
+ }
+}
\ No newline at end of file
diff --git a/src/Domain.Shared/Subscriptions/BillingSubscriber.cs b/src/Domain.Shared/Subscriptions/BillingSubscriber.cs
new file mode 100644
index 00000000..31b45e3c
--- /dev/null
+++ b/src/Domain.Shared/Subscriptions/BillingSubscriber.cs
@@ -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
+{
+ public static Result 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 Rehydrate()
+ {
+ return (property, container) =>
+ {
+ var parts = RehydrateToList(property, false);
+ return new BillingSubscriber(parts[0]!, parts[1]!);
+ };
+ }
+
+ protected override IEnumerable