This commit is contained in:
2025-12-16 18:21:41 +01:00
parent ec7c0b8f2a
commit f61e3a4e5a
3 changed files with 17 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
import type { SponsorableEntityType } from '../../domain/entities/SponsorshipRequest';
import type { SponsorshipSlotDTO } from '../use-cases/SponsorshipSlotDTO';
import type { SponsorshipSlotDTO } from './SponsorshipSlotDTO';
export interface GetEntitySponsorshipPricingResultDTO {
entityType: SponsorableEntityType;

View File

@@ -1,14 +1,17 @@
/**
* @deprecated Use error codes in Result instead of throwing ApplicationError.
* @deprecated Use ApplicationErrorCode in Result instead of throwing ApplicationError.
*/
export type CommonApplicationErrorKind =
| 'not_found'
| 'forbidden'
| 'conflict'
| 'validation'
| 'unknown'
| string;
| 'not_found'
| 'forbidden'
| 'conflict'
| 'validation'
| 'unknown'
| string;
/**
* @deprecated Use ApplicationErrorCode in Result instead of throwing ApplicationError.
*/
export interface IApplicationError<K extends string = CommonApplicationErrorKind, D = unknown> extends Error {
readonly type: 'application';
readonly context: string;

View File

@@ -0,0 +1,6 @@
export type ApplicationErrorCode<
Code extends string,
Details = undefined
> = Details extends undefined
? { code: Code }
: { code: Code; details: Details };