refactor
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import type { SponsorableEntityType } from '../../domain/entities/SponsorshipRequest';
|
import type { SponsorableEntityType } from '../../domain/entities/SponsorshipRequest';
|
||||||
import type { SponsorshipSlotDTO } from '../use-cases/SponsorshipSlotDTO';
|
import type { SponsorshipSlotDTO } from './SponsorshipSlotDTO';
|
||||||
|
|
||||||
export interface GetEntitySponsorshipPricingResultDTO {
|
export interface GetEntitySponsorshipPricingResultDTO {
|
||||||
entityType: SponsorableEntityType;
|
entityType: SponsorableEntityType;
|
||||||
|
|||||||
@@ -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 =
|
export type CommonApplicationErrorKind =
|
||||||
| 'not_found'
|
| 'not_found'
|
||||||
| 'forbidden'
|
| 'forbidden'
|
||||||
| 'conflict'
|
| 'conflict'
|
||||||
| 'validation'
|
| 'validation'
|
||||||
| 'unknown'
|
| 'unknown'
|
||||||
| string;
|
| string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use ApplicationErrorCode in Result instead of throwing ApplicationError.
|
||||||
|
*/
|
||||||
export interface IApplicationError<K extends string = CommonApplicationErrorKind, D = unknown> extends Error {
|
export interface IApplicationError<K extends string = CommonApplicationErrorKind, D = unknown> extends Error {
|
||||||
readonly type: 'application';
|
readonly type: 'application';
|
||||||
readonly context: string;
|
readonly context: string;
|
||||||
|
|||||||
6
core/shared/errors/ApplicationErrorCode.ts
Normal file
6
core/shared/errors/ApplicationErrorCode.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export type ApplicationErrorCode<
|
||||||
|
Code extends string,
|
||||||
|
Details = undefined
|
||||||
|
> = Details extends undefined
|
||||||
|
? { code: Code }
|
||||||
|
: { code: Code; details: Details };
|
||||||
Reference in New Issue
Block a user