import type { ZodType } from 'zod' import type { UiGridColumn, UiGridFilter, UiGridSort } from '../ui/adapter/contracts' export type CrudPermission = 'read' | 'create' | 'update' | 'delete' | 'export' | 'review' | 'publish' export interface CrudListQuery { page: number pageSize: number search?: string sorts: UiGridSort[] filters: UiGridFilter[] } export interface CrudPageResult { items: T[] total: number asOf: string projectionVersion: string watermark?: string stale: boolean } export interface CrudMutationContext { idempotencyKey: string ifMatch?: string reason?: string correlationId?: string } export interface CrudResourceContract { resourceCode: string routeBase: string queryKey: readonly string[] columns: UiGridColumn[] formSchema: ZodType permissions: Partial> defaultQuery: CrudListQuery parseListResponse(payload: unknown): CrudPageResult parseDetailResponse(payload: unknown): TItem }