/** * @startsimpli/ui/collection — shared entity-collection review workspaces. * * These are the "system-of-record" review surfaces for a Foundry-templated * tenant: a topic-review triage list and a draft-review compare/approve board. * They are client-INJECTED — the consuming app passes a CollectionClient (its * own authed tenant API) so the workspace owns all the react-query logic and the * app wrapper stays ~10 LOC. Nothing here is OGMC-specific; the controlled-vocab * markets + the optional record-detail drawer are props. */ export type DataType = 'text' | 'longtext' | 'number' | 'integer' | 'boolean' | 'date' | 'enum' | 'json'; export interface AttributeDef { id: string | number; name: string; dataType: DataType; required: boolean; config: Record; } export interface EntityTypeDef { id: string | number; key: string; label: string; attributes: AttributeDef[]; } export interface EntityRecord { id: number; entityType: string; externalId: string | null; name: string; data: Record; createdAt: string; } export interface Paginated { count: number; next: string | null; previous: string | null; results: T[]; } /** * The tenant-API surface a review workspace needs. The app implements this over * its authed same-origin client (keys are camel/snake-normalized by that client; * PATCH replaces the whole data blob, so callers send the full merged data). */ export interface CollectionClient { listTypes(): Promise>; listAllEntities(type: string): Promise; updateEntity(id: number | string, input: { name?: string; data?: Record }): Promise; }