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

@@ -24,7 +24,6 @@ model Organization {
gcAccessToken String?
gcEnvironment String @default("sandbox")
whatsappConnected Boolean @default(false)
zakatEnabled Boolean @default(false) // enables Zakat / Sadaqah / Lillah fund type picker
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@ -63,7 +62,7 @@ model Event {
paymentMode String @default("self") // self = we show bank details, external = redirect to URL
externalUrl String? // e.g. https://launchgood.com/my-campaign
externalPlatform String? // launchgood, enthuse, justgiving, gofundme, other
fundAllocation String? // e.g. "Mosque Building Fund" — tracks which fund this event raises for
zakatEligible Boolean @default(false) // is this campaign Zakat-eligible?
organizationId String
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
createdAt DateTime @default(now())
@@ -104,7 +103,7 @@ model Pledge {
donorEmail String?
donorPhone String?
giftAid Boolean @default(false)
fundType String? // null=general, zakat, sadaqah, lillah, fitrana
isZakat Boolean @default(false) // donor marked this as Zakat
iPaidClickedAt DateTime?
notes String?