| // Frontend-only type definitions for API payloads whose shapes live in | |
| // `frontend/api/*.ts` but aren't exported as TypeScript types. Adding these | |
| // lets us replace `any` in the page components without round-tripping the | |
| // Vercel serverless handlers. | |
| export interface DisbursementRecord { | |
| zone_id: string | |
| zone_name: string | |
| city: string | |
| settlement_type: string | |
| heat_vulnerability: string | |
| current_wbgt: number | |
| threshold: number | |
| triggers_payout: boolean | |
| workers: number | |
| payout_per_worker_usd: number | |
| payout_per_worker_tzs: number | |
| zone_total_usd: number | |
| zone_total_tzs: number | |
| provider: string | |
| status: 'pending' | 'no_trigger' | string | |
| past_disbursements: number | |
| past_total_usd: number | |
| } | |
| export interface DisbursementStats { | |
| total_usd: number | |
| total_tzs: number | |
| total_workers_paid: number | |
| zones_paying: number | |
| zones_total: number | |
| threshold_wbgt: number | |
| } | |
| export interface DisbursementsResponse { | |
| disbursements: DisbursementRecord[] | |
| stats: DisbursementStats | |
| } | |
| // ── Coverage recommendation: the extra fields the API returns that aren't | |
| // yet declared in lib/api.ts. We merge these with the existing | |
| // CoverageRecommendation type at the hook site. | |
| export interface CoverageRecommendationFinancials { | |
| weekly_cost_total: number | |
| annual_cost_total: number | |
| annual_cost_per_worker: number | |
| total_workers: number | |
| payout_threshold_wbgt: number | |
| } | |