website refactor

This commit is contained in:
2026-01-12 01:45:19 +01:00
parent fefd8d1cd6
commit 61db9116f6
11 changed files with 375 additions and 3 deletions

View File

@@ -0,0 +1,37 @@
/**
* Service contract
*
* Orchestration boundary for server-side operations.
* Returns API DTOs or Page DTOs only.
* Must be stateless.
*
* Based on WEBSITE_CONTRACT.md:
* - Services orchestrate IO and composition
* - They do not prepare UI
* - They return ApiDto or PageDto only
*/
/**
* Base service interface for orchestration operations
*/
export interface Service<TApiDto = unknown, TPageDto = unknown> {
/**
* Execute a service operation
* Returns either API Transport DTO or Page DTO
*/
execute(...args: unknown[]): Promise<TApiDto | TPageDto>;
}
/**
* Service that returns API Transport DTOs
*/
export interface ApiService<TApiDto = unknown> extends Service<TApiDto, never> {
execute(...args: unknown[]): Promise<TApiDto>;
}
/**
* Service that returns Page DTOs
*/
export interface PageService<TPageDto = unknown> extends Service<never, TPageDto> {
execute(...args: unknown[]): Promise<TPageDto>;
}