dev add reason entity
Test Workflow / test (push) Successful in 2s

This commit is contained in:
vladp
2026-03-27 14:20:09 +07:00
parent 57dcc12cf2
commit 4e0579c952
9 changed files with 494 additions and 3 deletions
@@ -0,0 +1,17 @@
package ru.soune.nocopy.exception;
import lombok.Getter;
@Getter
public class ModerationReasonInUseException extends RuntimeException {
private final Long reasonId;
private final Long usageCount;
public ModerationReasonInUseException(Long reasonId, Long usageCount) {
super(String.format("Cannot delete moderation reason %d because it is used by %d files",
reasonId, usageCount));
this.reasonId = reasonId;
this.usageCount = usageCount;
}
}
@@ -0,0 +1,7 @@
package ru.soune.nocopy.exception;
public class ModerationReasonNotFoundException extends RuntimeException {
public ModerationReasonNotFoundException(Long id) {
super("Moderation reason not found with id: " + id);
}
}