MCPcopy
hub / github.com/CodebuffAI/codebuff / getOrganizationSettings

Function getOrganizationSettings

packages/billing/src/auto-topup.ts:327–343  ·  view source on GitHub ↗
(organizationId: string)

Source from the content-addressed store, hash-verified

325}
326
327async function getOrganizationSettings(organizationId: string) {
328 const organization = await db.query.org.findFirst({
329 where: eq(schema.org.id, organizationId),
330 columns: {
331 auto_topup_enabled: true,
332 auto_topup_threshold: true,
333 auto_topup_amount: true,
334 stripe_customer_id: true,
335 },
336 })
337
338 if (!organization) {
339 throw new Error(`Organization ${organizationId} not found`)
340 }
341
342 return organization
343}
344
345/**
346 * Gets and selects the appropriate payment method for an organization.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected