24 lines
740 B
TypeScript
24 lines
740 B
TypeScript
import type { Result } from '../application/Result';
|
|
import type { IDomainError } from '../errors/DomainError';
|
|
|
|
export interface IDomainService {
|
|
readonly serviceName?: string;
|
|
}
|
|
|
|
export interface IDomainCalculationService<Input, Output> extends IDomainService {
|
|
calculate(input: Input): Output;
|
|
}
|
|
|
|
export interface IResultDomainCalculationService<Input, Output, Error = IDomainError>
|
|
extends IDomainService {
|
|
calculate(input: Input): Result<Output, Error>;
|
|
}
|
|
|
|
export interface IDomainValidationService<Input, Output, Error = IDomainError>
|
|
extends IDomainService {
|
|
validate(input: Input): Result<Output, Error>;
|
|
}
|
|
|
|
export interface IDomainFactoryService<Input, Output> extends IDomainService {
|
|
create(input: Input): Output;
|
|
} |