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:
@@ -0,0 +1,7 @@
|
||||
-- Move Zakat to campaign level, simplify pledge
|
||||
ALTER TABLE "Event" ADD COLUMN IF NOT EXISTS "zakatEligible" BOOLEAN NOT NULL DEFAULT false;
|
||||
ALTER TABLE "Pledge" ADD COLUMN IF NOT EXISTS "isZakat" BOOLEAN NOT NULL DEFAULT false;
|
||||
-- Keep fundType column for backward compat but it's deprecated
|
||||
-- DROP fundAllocation — the campaign name IS the allocation
|
||||
ALTER TABLE "Event" DROP COLUMN IF EXISTS "fundAllocation";
|
||||
ALTER TABLE "Organization" DROP COLUMN IF EXISTS "zakatEnabled";
|
||||
@@ -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?
|
||||
|
||||
|
||||
Reference in New Issue
Block a user