import type { PostgresJsDatabase } from "drizzle-orm/postgres-js"; import { type FunctionSpace, type FunctionSpaceCapacity } from "./schema-function-spaces.js"; export interface CreateFunctionSpaceInput { facilityId: string; name: string; parentSpaceId?: string; code?: string; description?: string; areaSqm?: number; divisible?: boolean; defaultLayout?: FunctionSpace["defaultLayout"]; sortOrder?: number; } export type CreateFunctionSpaceOutcome = { status: "ok"; space: FunctionSpace; } | { status: "facility_not_found"; } | { status: "parent_not_found"; }; export declare function createFunctionSpace(db: PostgresJsDatabase, input: CreateFunctionSpaceInput): Promise; export declare function getFunctionSpace(db: PostgresJsDatabase, id: string): Promise<(FunctionSpace & { capacities: FunctionSpaceCapacity[]; }) | null>; export declare function listFunctionSpaces(db: PostgresJsDatabase, query: { facilityId?: string; parentSpaceId?: string; limit: number; offset: number; }): Promise<{ data: FunctionSpace[]; limit: number; offset: number; }>; export declare function updateFunctionSpace(db: PostgresJsDatabase, id: string, input: Partial & { active?: boolean; }): Promise; export interface FunctionSpaceCapacityInput { layout: FunctionSpaceCapacity["layout"]; capacity: number; } /** * Replace the per-layout capacity matrix for a space. This is a full replace: * layouts omitted from the payload are deleted (an empty payload clears all), * so the stored matrix always matches what the caller submitted. */ export declare function setFunctionSpaceCapacities(db: PostgresJsDatabase, spaceId: string, capacities: FunctionSpaceCapacityInput[]): Promise; export declare const functionSpaceService: { createFunctionSpace: typeof createFunctionSpace; getFunctionSpace: typeof getFunctionSpace; listFunctionSpaces: typeof listFunctionSpaces; updateFunctionSpace: typeof updateFunctionSpace; setFunctionSpaceCapacities: typeof setFunctionSpaceCapacities; };