(organizationId: string)
| 325 | } |
| 326 | |
| 327 | async 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. |
no outgoing calls
no test coverage detected