import type { Result } from './Result';
import type { ApplicationError } 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 = ApplicationError
> extends IApplicationService {
  execute(input: Input): Promise<Result<Output, Error>>;
}