Files
pagodera/types/donation.ts
Evandro Fonseca Junior 8b5817e8ca feat(donation): increase minimum custom donation amount to R$ 5.00
- Updated customAmountSchema min value from 0.01 to 5
- Adjusted validation logic and error messages to reflect new minimum
- Modified DONATION_PRODUCTS minAmount for custom tier to 5
- Ensures donations meet the new minimum threshold for processing
2025-10-26 23:31:06 -03:00

98 lines
1.8 KiB
TypeScript

export interface DonationTier {
id: string;
amount?: number;
title: string;
description: string;
icon: "coffee" | "pizza" | "heart";
badge?: string;
highlighted?: boolean;
}
export interface DonationData {
amount: number;
donorName?: string;
donorEmail?: string;
message?: string;
}
export const DONATION_PRODUCTS = {
coffee: {
id: "prod_6ryJmhfZGNJGjNaYaA1YqhDn",
name: "Doação Café",
amount: 5,
price: 500, // centavos
},
snack: {
id: "prod_FpLxKWgmHXbj2Ghwxa0BsFph",
name: "Doação Lanche",
amount: 10,
price: 1000,
},
lunch: {
id: "prod_czgg0YjKBp3GpsFYpSp3M1TZ",
name: "Doação Almoço",
amount: 25,
price: 2500,
},
custom: {
id: "custom",
name: "Valor Personalizado",
amount: 0,
price: 0,
minAmount: 5, // R$ 5,00
maxAmount: 100000, // R$ 100.000,00
},
} as const;
export type DonationTierId = keyof typeof DONATION_PRODUCTS;
export interface DonorData {
name: string;
phone: string;
email?: string;
message?: string;
}
export interface DonationResponse {
success: boolean;
pixId?: string;
brCode?: string;
brCodeBase64?: string;
expiresAt?: string;
error?: string;
}
export interface BillingStatus {
id: string;
amount: number;
status: "PENDING" | "PAID" | "EXPIRED" | "CANCELLED";
pixCode: string;
pixQrCode: string;
expiresAt: string;
createdAt: string;
}
export interface DonationStats {
totalSupporters: number;
totalRaised: number;
monthsOnline: number;
uptime: number;
}
export interface TransparencyData {
hosting: number;
development: number;
support: number;
emergency: number;
}
export interface Supporter {
id: string;
name: string;
avatar?: string;
amount: number;
message?: string;
createdAt: string;
anonymous?: boolean;
}