import type { Result } from '../domain/Result';
import type { ApplicationError } from '../errors/ApplicationError';

export interface ApplicationService {
  readonly serviceName?: string;
}

export interface AsyncApplicationService<Input, Output> extends ApplicationService {
  execute(input: Input): Promise<Output>;
}

export interface AsyncResultApplicationService<
  Input,
  Output,
  Error = ApplicationError
> extends ApplicationService {
  execute(input: Input): Promise<Result<Output, Error>>;
}
