Files
gridpilot.gg/apps/website/lib/contracts/page-queries/PageQuery.ts
2026-01-12 01:01:49 +01:00

26 lines
854 B
TypeScript

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>>;
}