Files
gridpilot.gg/apps/website/lib/contracts/page-queries/PageQuery.ts
2026-01-13 00:16:14 +01:00

27 lines
775 B
TypeScript

import { Result } from "../Result";
/**
* 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
* - Explicit result describing route outcome
* - Do not implement business rules
*
* @template TApiDto - The API DTO type this query produces
* @template TParams - The parameters required to execute this query
*/
export interface PageQuery<TApiDto, TParams = void> {
/**
* Execute the page query
*
* @param params - Parameters required for query execution
* @returns Promise resolving to a Result
*/
execute(params: TParams): Promise<Result<TApiDto, string>>;
}