website refactor
This commit is contained in:
@@ -1,24 +1,31 @@
|
||||
import type { Result } from '../application/Result';
|
||||
import type { IDomainError } from '../errors/DomainError';
|
||||
import { Result } from './Result';
|
||||
import type { DomainErrorProps } from '../errors/DomainError';
|
||||
|
||||
export interface IDomainService {
|
||||
export interface DomainService {
|
||||
readonly serviceName?: string;
|
||||
}
|
||||
|
||||
export interface IDomainCalculationService<Input, Output> extends IDomainService {
|
||||
export interface DomainCalculationService<Input, Output> extends DomainService {
|
||||
calculate(input: Input): Output;
|
||||
}
|
||||
|
||||
export interface IResultDomainCalculationService<Input, Output, Error = IDomainError>
|
||||
extends IDomainService {
|
||||
export interface ResultDomainCalculationService<Input, Output, Error = DomainErrorProps>
|
||||
extends DomainService {
|
||||
calculate(input: Input): Result<Output, Error>;
|
||||
}
|
||||
|
||||
export interface IDomainValidationService<Input, Output, Error = IDomainError>
|
||||
extends IDomainService {
|
||||
export interface DomainValidationService<Input, Output, Error = DomainErrorProps>
|
||||
extends DomainService {
|
||||
validate(input: Input): Result<Output, Error>;
|
||||
}
|
||||
|
||||
export interface IDomainFactoryService<Input, Output> extends IDomainService {
|
||||
export interface DomainFactoryService<Input, Output> extends DomainService {
|
||||
create(input: Input): Output;
|
||||
}
|
||||
}
|
||||
|
||||
// Alias for backward compatibility
|
||||
export type IDomainService = DomainService;
|
||||
export type IDomainCalculationService<Input, Output> = DomainCalculationService<Input, Output>;
|
||||
export type IResultDomainCalculationService<Input, Output, Error = DomainErrorProps> = ResultDomainCalculationService<Input, Output, Error>;
|
||||
export type IDomainValidationService<Input, Output, Error = DomainErrorProps> = DomainValidationService<Input, Output, Error>;
|
||||
export type IDomainFactoryService<Input, Output> = DomainFactoryService<Input, Output>;
|
||||
|
||||
Reference in New Issue
Block a user