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
This commit is contained in:
1 parent
e30d9493ff
commit
8b5817e8ca
2 files changed
+4
-4
No files matched your search
@@ -75,7 +75,7 @@ export const donationTierSchema = z.enum(
|
||||
// Schema para valor customizado
|
||||
export const customAmountSchema = z
|
||||
.number()
|
||||
.min(0.01, "Valor mínimo é R$ 0,01")
|
||||
.min(5, "Valor mínimo é R$ 5,00")
|
||||
.max(100000, "Valor máximo é R$ 100.000,00");
|
||||
|
||||
// Schema completo para criação de doação
|
||||
@@ -116,12 +116,12 @@ export const createDonationSchema = z
|
||||
(data) => {
|
||||
// Se tier for custom, customAmount deve estar no range válido
|
||||
if (data.tier === "custom" && data.customAmount) {
|
||||
return data.customAmount >= 0.01 && data.customAmount <= 100000;
|
||||
return data.customAmount >= 5 && data.customAmount <= 100000;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
{
|
||||
message: "Valor deve estar entre R$ 0,01 e R$ 100.000,00",
|
||||
message: "Valor deve estar entre R$ 5,00 e R$ 100.000,00",
|
||||
path: ["customAmount"],
|
||||
}
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user