diff --git a/services/Directory/FilterLists.Directory.Application/Commands/CreateList.cs b/services/Directory/FilterLists.Directory.Application/Commands/CreateList.cs index a3a211dd8..772d82ccc 100644 --- a/services/Directory/FilterLists.Directory.Application/Commands/CreateList.cs +++ b/services/Directory/FilterLists.Directory.Application/Commands/CreateList.cs @@ -56,7 +56,7 @@ public async Task Handle(Command request, CancellationToken cancellati .WhereIsDefaultForFilterList() .SingleAsync(cancellationToken); - var filterList = FilterList.Create( + var filterList = FilterList.CreatePendingApproval( request.Name, request.Description, license, diff --git a/services/Directory/FilterLists.Directory.Domain/Aggregates/Changes/IRequireChangeApproval.cs b/services/Directory/FilterLists.Directory.Domain/Aggregates/Changes/IRequireChangeApproval.cs index 72f553143..699b48b59 100644 --- a/services/Directory/FilterLists.Directory.Domain/Aggregates/Changes/IRequireChangeApproval.cs +++ b/services/Directory/FilterLists.Directory.Domain/Aggregates/Changes/IRequireChangeApproval.cs @@ -6,6 +6,5 @@ public interface IRequireChangeApproval where TChange : Change public IReadOnlyCollection PendingChanges => (IReadOnlyCollection)Changes.Where(c => c.ApprovedAt == null && c.RejectedAt == null); public IReadOnlyCollection ApprovedChanges => (IReadOnlyCollection)Changes.Where(c => c.ApprovedAt != null); public IReadOnlyCollection RejectedChanges => (IReadOnlyCollection)Changes.Where(c => c.RejectedAt != null); - public bool IsLegacyApproved => Changes.Count == 0; - public bool IsApproved => IsLegacyApproved || ApprovedChanges.Count > 0; + public bool IsApproved { get; } } diff --git a/services/Directory/FilterLists.Directory.Domain/Aggregates/FilterLists/FilterList.cs b/services/Directory/FilterLists.Directory.Domain/Aggregates/FilterLists/FilterList.cs index 54479a315..5f3cbc71c 100644 --- a/services/Directory/FilterLists.Directory.Domain/Aggregates/FilterLists/FilterList.cs +++ b/services/Directory/FilterLists.Directory.Domain/Aggregates/FilterLists/FilterList.cs @@ -23,8 +23,9 @@ protected FilterList() { } public string? EmailAddress { get; private init; } public Uri? DonateUrl { get; private init; } public virtual IReadOnlyCollection Changes => (IReadOnlyCollection)_changes; + public bool IsApproved { get; private init; } - public static FilterList Create( + public static FilterList CreatePendingApproval( string name, string? description, License license, @@ -61,7 +62,8 @@ public static FilterList Create( ChatUrl = chatUrl, EmailAddress = emailAddress, DonateUrl = donateUrl, - ViewUrls = urls + ViewUrls = urls, + IsApproved = false }; list._changes = new HashSet(new[] { FilterListChange.Create(list, createReason) }); return list;