import { type PlanRequest } from "./ladder.js"; import type { Notify } from "./notifications/index.js"; import { type PlanCatalog } from "./plan-model.js"; import type { BillingAdapter } from "./types.js"; export { defaultSeatOf, isSatisfied, isTopSeat, nextSeatUp, nextUsageAsk, seatLadder, seatRank, seatTypeExists, usageAction, type PlanRequest, type UsageAction, } from "./ladder.js"; /** Every request, newest first. */ export declare function listPlanRequests(adapter: BillingAdapter, orgId: string): Promise; /** * That member's open ask, or null — where "open" means still UNMET. * * A request whose plan the workspace has since reached is satisfied whether or not anybody * marked it so, which is what stops a stale want sitting in an owner's list forever. */ export declare function pendingPlanRequest(adapter: BillingAdapter, orgId: string, memberId: string, opts: { plans: PlanCatalog; currentPlan?: string | null; currentSeatType?: string | null; }): Promise; /** * Ask to move up a SEAT — the answer when a better seat exists. * * This is the ask a Standard-seat member should be offered, not a top-up: their pack is what * their seat includes, and the way to have more of it permanently is a bigger seat. A top-up * is the answer only once they are on the best seat there is, where nothing else remains. * Same queue, same one-open-ask rule, same "answers itself" behaviour. */ export declare function requestSeatChange(adapter: BillingAdapter, orgId: string, input: { memberId: string; plans: PlanCatalog; /** Say that they asked. See `notifications/`. */ notify?: Notify; currentPlan?: string | null; currentSeatType?: string | null; /** Defaults to the next seat up. */ seatType?: string; note?: string; id?: string; now?: number; }): Promise<{ ok: boolean; id?: string; seatType?: string; pending?: PlanRequest; reason?: "no_upgrade" | "unknown_plan" | "already_pending" | "already_on_it" | "queue_full"; }>; /** * Ask to move up a tier. * * `plan` defaults to the next one up (`planActions().upgradeTo`) — the member is saying "I * need more", not choosing a SKU, and making them pick from a catalogue they may not be able * to price is the same mistake as making them name a credit amount. */ export declare function requestPlanChange(adapter: BillingAdapter, orgId: string, input: { memberId: string; plans: PlanCatalog; /** Say that they asked. See `notifications/`. */ notify?: Notify; currentPlan?: string | null; /** Defaults to the next plan up. */ plan?: string; note?: string; /** Whatever the consumer's form collected. See `PlanRequest["metadata"]`. */ metadata?: Record; /** Who to answer. Taken from the signed-in user by the consumer, never typed. */ contact?: PlanRequest["contact"]; id?: string; now?: number; }): Promise<{ ok: boolean; id?: string; plan?: string; pending?: PlanRequest; reason?: "no_upgrade" | "unknown_plan" | "already_pending" | "already_on_it" | "queue_full"; }>; /** * Price an open ask — the operator's half, and the only place a per-credit rate is set. * * Per CREDIT rather than a total, because that is what a negotiation is actually about: * "we can do 0.7¢" survives the customer changing how much they want, and a total does not. * The total is arithmetic and is computed here, so the number the customer accepts and the * number they are charged cannot drift. */ export declare function quotePlanRequest(adapter: BillingAdapter, orgId: string, input: { requestId: string; credits: number; /** Minor units per credit. Fractions are allowed: 0.7 is 0.7¢. */ unitPriceMinor: number; validUntil?: string; note?: string; now?: number; notify?: Notify; }): Promise<{ ok: true; request: PlanRequest; } | { ok: false; reason: "not_found" | "invalid_amount" | "queue_full"; }>; /** Mark a quoted ask as accepted, once the money half has been arranged. */ export declare function markPlanQuoteAccepted(adapter: BillingAdapter, orgId: string, input: { requestId: string; accepted: PlanRequest["accepted"]; now?: number; }): Promise; /** * Mark an ask handled. * * `done` records that somebody acted on it; it does NOT move the plan, and nothing here * touches Stripe. The upgrade itself is `change_plan`, which takes a payment — an approval * that silently charged a workspace because a member asked would be the worst possible * reading of "approve". */ export declare function resolvePlanRequest(adapter: BillingAdapter, orgId: string, requestId: string, status: "done" | "denied"): Promise; //# sourceMappingURL=plan-request.d.ts.map