rename to core
This commit is contained in:
3
core/shared/application/AsyncUseCase.ts
Normal file
3
core/shared/application/AsyncUseCase.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export interface AsyncUseCase<Input, Output> {
|
||||
execute(input: Input): Promise<Output>;
|
||||
}
|
||||
18
core/shared/application/Service.ts
Normal file
18
core/shared/application/Service.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { Result } from '../result/Result';
|
||||
import type { IApplicationError } from '../errors/ApplicationError';
|
||||
|
||||
export interface IApplicationService {
|
||||
readonly serviceName?: string;
|
||||
}
|
||||
|
||||
export interface IAsyncApplicationService<Input, Output> extends IApplicationService {
|
||||
execute(input: Input): Promise<Output>;
|
||||
}
|
||||
|
||||
export interface IAsyncResultApplicationService<
|
||||
Input,
|
||||
Output,
|
||||
Error = IApplicationError
|
||||
> extends IApplicationService {
|
||||
execute(input: Input): Promise<Result<Output, Error>>;
|
||||
}
|
||||
5
core/shared/application/UseCase.ts
Normal file
5
core/shared/application/UseCase.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { Presenter } from '../presentation';
|
||||
|
||||
export interface UseCase<Input, OutputDTO, ViewModel, P extends Presenter<OutputDTO, ViewModel>> {
|
||||
execute(input: Input, presenter: P): Promise<void> | void;
|
||||
}
|
||||
3
core/shared/application/index.ts
Normal file
3
core/shared/application/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './UseCase';
|
||||
export * from './AsyncUseCase';
|
||||
export * from './Service';
|
||||
Reference in New Issue
Block a user