feat: quotas

This commit is contained in:
2026-10-07 02:21:43 +04:00
parent bcf985c17d
commit c1b052e2c7
7 changed files with 49 additions and 1 deletions
@@ -0,0 +1,15 @@
namespace MemeVault.Domain.Exceptions;
/// <summary>
/// Пользователь достиг лимита пользовательских коллекций (Owner).
/// </summary>
public sealed class CollectionQuotaExceededException : DomainException
{
public int Limit { get; }
public CollectionQuotaExceededException(int limit)
: base($"Cannot create more than {limit} collections.")
{
Limit = limit;
}
}
@@ -1,6 +1,6 @@
namespace MemeVault.Domain.Exceptions;
public sealed class DomainException : Exception
public class DomainException : Exception
{
public DomainException(string message) : base(message) { }
public DomainException(string message, Exception inner) : base(message, inner) { }
@@ -0,0 +1,15 @@
namespace MemeVault.Domain.Exceptions;
/// <summary>
/// Коллекция достигла лимита медиа-элементов.
/// </summary>
public sealed class MediaInCollectionQuotaExceededException : DomainException
{
public int Limit { get; }
public MediaInCollectionQuotaExceededException(int limit)
: base($"Collection has reached the limit of {limit} items.")
{
Limit = limit;
}
}