simplify: zakat yes/no per campaign, remove 5 fund types, add I've Donated button for external pledges

- Event.zakatEligible (boolean) replaces Organization.zakatEnabled + 5 fund types
- Pledge.isZakat (boolean) replaces Pledge.fundType enum
- Removed fundAllocation from Event (campaign IS the allocation)
- Identity step: simple checkbox instead of 5-option grid
- Campaign creation: Zakat toggle + optional external URL for self-payment
- External redirect step: 'I've Donated' button calls /api/pledges/[id]/mark-initiated
- Landing page: simplified Zakat section (toggle preview, not 5 fund descriptions)
- Settings: removed org-level Zakat toggle (it's per campaign now)
- Migration: ALTER TABLE adds zakatEligible/isZakat, drops fundAllocation
This commit is contained in:
2026-03-03 07:19:52 +08:00
parent f87aec7beb
commit fc80a43a89
14 changed files with 131 additions and 179 deletions

View File

@@ -26,7 +26,6 @@ export async function GET(request: NextRequest) {
gcAccessToken: org.gcAccessToken ? "••••••••" : "",
gcEnvironment: org.gcEnvironment,
orgType: org.orgType || "charity",
zakatEnabled: org.zakatEnabled || false,
})
} catch (error) {
console.error("Settings GET error:", error)
@@ -90,8 +89,7 @@ export async function PATCH(request: NextRequest) {
data[key] = body[key]
}
}
// Boolean fields
if ("zakatEnabled" in body) data.zakatEnabled = !!body.zakatEnabled
// (boolean fields can be added here as needed)
const org = await prisma.organization.update({
where: { id: orgId },