website refactor
This commit is contained in:
26
apps/website/lib/contracts/page-queries/PageQuery.ts
Normal file
26
apps/website/lib/contracts/page-queries/PageQuery.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { PageQueryResult } from '@/lib/page-queries/PageQueryResult';
|
||||
|
||||
/**
|
||||
* PageQuery contract interface
|
||||
*
|
||||
* Defines the canonical contract for all server-side page queries.
|
||||
*
|
||||
* Based on WEBSITE_PAGE_QUERIES.md:
|
||||
* - Server-side composition classes
|
||||
* - Call services that call apps/api
|
||||
* - Assemble a Page DTO
|
||||
* - Return explicit result describing route outcome
|
||||
* - Do not implement business rules
|
||||
*
|
||||
* @template TPageDto - The Page DTO type this query produces
|
||||
* @template TParams - The parameters required to execute this query
|
||||
*/
|
||||
export interface PageQuery<TPageDto, TParams = void> {
|
||||
/**
|
||||
* Execute the page query
|
||||
*
|
||||
* @param params - Parameters required for query execution
|
||||
* @returns Promise resolving to a PageQueryResult discriminated union
|
||||
*/
|
||||
execute(params: TParams): Promise<PageQueryResult<TPageDto>>;
|
||||
}
|
||||
Reference in New Issue
Block a user