/** * Types for the bare `vk_tenants` CRUD module. * * The tenancy package owns the lean parent row (`id`, `slug`, * `display_name`, `status`, `primary_domain`, lifecycle + `metadata`). * Consuming apps may ALTER the table to add their own columns (e.g. the * CMS adds `branding` / `settings` / `additional_domains`). The CRUD here * is deliberately **column-agnostic**: reads `SELECT *` (the data client * auto-maps every column, app-added ones included) and writes accept a * camelCase field bag so app columns flow through without the package * enumerating them. */ /** Lifecycle status — mirrors the DB enum `tenant_status`. */ export type TenantStatus = 'pending' | 'active' | 'suspended' | 'archived' | 'deleted'; /** * A `vk_tenants` row, post-mapping (snake_case → camelCase). The package * guarantees the base columns; app-added columns appear too at runtime * (the data client maps them) — consumers cast to a wider row type. */ export interface TenantRecord { id: string; slug: string; displayName: string; status: TenantStatus; primaryDomain: string | null; metadata: Record; createdAt: Date; updatedAt: Date; /** App-added columns (branding, settings, …) surface here at runtime. */ [column: string]: unknown; } /** * A camelCase field bag for create / update. Base columns plus any * app-added columns the consumer ALTERed onto `vk_tenants`. Object / * array values are written as `jsonb`; `status` is cast to the * `tenant_status` enum; everything else binds as a plain param. */ export type TenantWriteFields = Record; /** * Querier — same shape as the rest of the workspace. Declared locally so * the package carries no hard dependency on `@venturekit/data`. */ export type Querier = []>(sql: string, params?: unknown[]) => Promise; //# sourceMappingURL=types.d.ts.map