namespace NTP.Application.Common; public sealed class NotFoundException(string entity, object key) : Exception($"{entity} '{key}' was not found."); /// Raised when an UPDATE/DELETE affects 0 rows because ROW_VERSION changed. public sealed class ConcurrencyException(string entity, object key) : Exception($"{entity} '{key}' was modified by another user. Reload and retry."); /// /// A business-rule violation ported from legacy code (HTTP 422). message is the user-facing text /// (keep the legacy Arabic wording); code is a stable machine-readable code returned to the client /// as the ProblemDetails extension "code". /// public class BusinessException(string code, string message) : Exception(message) { public string Code { get; } = code; } /// Credentials / account state rejected (HTTP 401). Same shape as . public sealed class AuthenticationFailedException(string code, string message) : BusinessException(code, message); /// Authenticated but the role/rules do not allow the action (HTTP 403). public sealed class ForbiddenException(string code, string message) : BusinessException(code, message);