rename to core
This commit is contained in:
24
core/shared/domain/Service.ts
Normal file
24
core/shared/domain/Service.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type { Result } from '../result/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;
|
||||
}
|
||||
Reference in New Issue
Block a user