(
params: OrganizationCreditAlert & {
logger: Logger
},
)
| 195 | } |
| 196 | |
| 197 | async function handleLowBalanceAlert( |
| 198 | params: OrganizationCreditAlert & { |
| 199 | logger: Logger |
| 200 | }, |
| 201 | ): Promise<void> { |
| 202 | const { organizationId, currentBalance, logger } = params |
| 203 | |
| 204 | // TODO: Send email to organization owners about low balance |
| 205 | // TODO: Suggest auto-topup or manual credit purchase |
| 206 | logger.info( |
| 207 | { organizationId, balance: currentBalance }, |
| 208 | 'Low balance alert sent to organization owners', |
| 209 | ) |
| 210 | } |
| 211 | |
| 212 | async function handleHighUsageAlert( |
| 213 | params: OrganizationCreditAlert & { |
no outgoing calls
no test coverage detected