Add notification preferences and alternate dues payment options
Notification preferences (migration 048): - Per-member opt-out of muteable categories (bookings, classes, forms, admin alerts); billing is always-on. Opt-out model, default on. - Dispatcher reads prefs and marks muted outbox rows 'skipped' instead of sending; pure isMuted logic, fail-open on a prefs lookup error. - notification_preferences table (default-deny RLS); /me toggles and self-view via validated service-client actions. Alternate dues payment methods (migration 049): - Admin sets external pay-here URLs per platform (PayPal/Zeffy/Venmo) in /settings; members see active ones on /me and pay off-platform; the treasurer reconciles manually (platform pre-tagged). https-only. - dues_payment_methods table (SELECT space member, write admin/board). /me visual pass: - Restore the chip/preset profile editor (skills/interests/willing-to/ affiliations); promote ChipInput and presets to shared modules. - Gate the Stripe pay-dues button on whether the space has Stripe configured; show external links or a contact-admin note otherwise.
This commit is contained in:
+13
-8
@@ -220,20 +220,25 @@ export async function getMyBilling() {
|
||||
if (!auth.ok) return { error: auth.error }
|
||||
const { member } = auth
|
||||
|
||||
const { data } = await createAdminClient()
|
||||
const admin = createAdminClient()
|
||||
// Whether the space has Stripe dues set up at all, so the /me UI can hide the
|
||||
// "Pay dues" (Stripe Checkout) button when there is no Stripe to check out to.
|
||||
const cfg = await getStripeConfig(admin, member.space_id)
|
||||
const configured = isStripeConfigured(cfg ?? {})
|
||||
|
||||
const { data } = await admin
|
||||
.from('member_billing')
|
||||
.select('subscription_status, current_period_end, stripe_customer_id')
|
||||
.eq('space_id', member.space_id)
|
||||
.eq('member_id', member.id)
|
||||
.maybeSingle()
|
||||
return {
|
||||
data: data
|
||||
? {
|
||||
status: (data.subscription_status as string | null) ?? null,
|
||||
currentPeriodEnd: (data.current_period_end as string | null) ?? null,
|
||||
hasCustomer: !!data.stripe_customer_id,
|
||||
}
|
||||
: null,
|
||||
data: {
|
||||
status: (data?.subscription_status as string | null) ?? null,
|
||||
currentPeriodEnd: (data?.current_period_end as string | null) ?? null,
|
||||
hasCustomer: !!data?.stripe_customer_id,
|
||||
configured,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user