(code: string)
| 124 | } |
| 125 | |
| 126 | export async function getReferralCode(code: string): Promise<ReferralCode | null> { |
| 127 | const result = await query<ReferralCode>( |
| 128 | 'SELECT * FROM referral_codes WHERE code = $1', |
| 129 | [code.toUpperCase()] |
| 130 | ); |
| 131 | return result.rows[0] || null; |
| 132 | } |
| 133 | |
| 134 | export async function listReferralCodes(referrerOrgId: string): Promise<ReferralDashboardRow[]> { |
| 135 | const result = await query<ReferralDashboardRow>( |
no outgoing calls
no test coverage detected