import type { Selectable } from 'kysely'; import type * as Db from '../Db.js'; import type * as db_Schema from '../Schema.js'; /** Columns of the `billing_settings` table, derived from `Schema.BillingSettings`. */ export type Table = db_Schema.BillingSettings; /** A stored billing-settings row. */ export type Record = Selectable; /** Currencies limits may be denominated in; single-member today, widens without schema changes. */ export declare const currencies: readonly ["usd"]; /** Spend-limit windows; single-member today, widens without schema changes. */ export declare const periods: readonly ["month"]; /** * Reads an organization's billing settings. * * @param db - The database. * @param orgId - The organization id (`org_…`). * @param environment - The environment to read; defaults to `production`. * @returns The stored record, or `undefined` when the org has none. */ export declare function get(db: Db.Db, orgId: string, environment?: Record['environment']): Promise; /** * Upserts an organization's billing settings with PATCH semantics: absent * fields keep their stored value, `null` clears the limit. * * @param db - The database. * @param input - The settings to apply. * @returns The stored record. */ export declare function upsert(db: Db.Db, input: upsert.Input): Promise; export declare namespace upsert { /** Fields accepted when upserting billing settings; absent = unchanged, null = cleared. */ type Input = { /** Currency both limits are denominated in. */ currency?: Record['currency'] | undefined; /** Environment these settings apply to; defaults to `production`. */ environment?: Record['environment'] | undefined; /** Organization id (`org_…`) the settings belong to. */ orgId: string; /** Spend-limit window. */ period?: Record['period'] | undefined; /** Spend limit per period (decimal string in `currency` units), or null to clear. */ spendLimit?: string | null | undefined; /** Per-transaction fee cap (decimal string in `currency` units), or null to clear. */ txFeeLimit?: string | null | undefined; }; } /** * Deletes an organization's billing settings. * * @param db - The database. * @param orgId - The organization id (`org_…`). * @returns Whether a settings row existed and was deleted. */ export declare function deleteByOrg(db: Db.Db, orgId: string): Promise; //# sourceMappingURL=billingSettings.d.ts.map