Unify donation flows#92
Closed
petehayes wants to merge 2 commits into
Closed
Conversation
* feat: add EVENT campaign type with line items New campaign type supporting multiple purchasable items grouped by category (e.g., dinner plates, gifts). Each item has its own price, capacity limit, and can be marked as required. Data model: - CampaignItem: items with price, category, capacity, required flag - DonationLineItem: snapshot of purchased items per donation Backend: - Campaign CRUD extended for EVENT type with item management - Validation: item capacity, per-order limits, required items, amount matching - Donation creation creates line item records - Stripe checkout supports multi-line-item sessions - Webhook recreates line items from metadata - Auto-complete when all capped items are sold out Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: add EVENT campaign UI — form, donor item selector, public page, tests - CampaignForm: EVENT type option with item editor (name, category, price, capacity, required flag) - NewPledgeFormClient: EVENT item selector with quantity controls, category grouping, running total - PublicCampaignPage: EVENT items display with category grouping and pricing - Campaign API: EVENT type in Zod schema, items passthrough to service, items in list response - Donate page: serialize campaign items for public display - Tests: 14 new tests for EVENT validation, capacity, auto-complete, API contract (42 total) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: add @Map annotations for DonationLineItem columns unitPrice and subtotal columns were missing @Map('unit_price') and @Map('subtotal') annotations, causing Prisma to look for camelCase column names instead of the snake_case columns in the database. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: enable campaign type-specific editing for TIERED tiers and EVENT items - Show campaign type as read-only label when editing (type cannot be changed) - Remove isEditing gate from TIERED tiers and EVENT items sections - Include tiers/items in PATCH body when editing campaigns - Add tiers and items to campaign update API schema with upsert logic - TIERED: upsert tiers by id, delete removed tiers (only if no donations reference them) - EVENT: upsert items by id, soft-delete removed items (preserve FK references) - Return tiers and items in PATCH response - Include items in GET single campaign response - Add items to CampaignList Campaign interface Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* feat: add EVENT campaign type with line items New campaign type supporting multiple purchasable items grouped by category (e.g., dinner plates, gifts). Each item has its own price, capacity limit, and can be marked as required. Data model: - CampaignItem: items with price, category, capacity, required flag - DonationLineItem: snapshot of purchased items per donation Backend: - Campaign CRUD extended for EVENT type with item management - Validation: item capacity, per-order limits, required items, amount matching - Donation creation creates line item records - Stripe checkout supports multi-line-item sessions - Webhook recreates line items from metadata - Auto-complete when all capped items are sold out Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: add EVENT campaign UI — form, donor item selector, public page, tests - CampaignForm: EVENT type option with item editor (name, category, price, capacity, required flag) - NewPledgeFormClient: EVENT item selector with quantity controls, category grouping, running total - PublicCampaignPage: EVENT items display with category grouping and pricing - Campaign API: EVENT type in Zod schema, items passthrough to service, items in list response - Donate page: serialize campaign items for public display - Tests: 14 new tests for EVENT validation, capacity, auto-complete, API contract (42 total) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: add @Map annotations for DonationLineItem columns unitPrice and subtotal columns were missing @Map('unit_price') and @Map('subtotal') annotations, causing Prisma to look for camelCase column names instead of the snake_case columns in the database. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feat: enable campaign type-specific editing for TIERED tiers and EVENT items - Show campaign type as read-only label when editing (type cannot be changed) - Remove isEditing gate from TIERED tiers and EVENT items sections - Include tiers/items in PATCH body when editing campaigns - Add tiers and items to campaign update API schema with upsert logic - TIERED: upsert tiers by id, delete removed tiers (only if no donations reference them) - EVENT: upsert items by id, soft-delete removed items (preserve FK references) - Return tiers and items in PATCH response - Include items in GET single campaign response - Add items to CampaignList Campaign interface Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: public donation flow - support campaign types and unauthenticated donors Problem 1: Non-logged-in users get 'no payment methods' error because Clerk middleware blocks /api/organizations/[slug]/payment-methods for unauthenticated requests. Fix: Add payment-methods, donations/checkout, campaigns, and campaigns/[id] API routes to the public routes list in middleware.ts. Problem 2: Clicking 'Donate' from a campaign page shows generic donation form instead of campaign-type-specific UI (FIXED_UNIT, TIERED, EVENT). Fix: Enhance DonationFlow to accept full campaign data and render type-specific amount selection: - FIXED_UNIT: quantity selector with unit price - TIERED: tier picker with named levels and prices - EVENT: item selector with categories, quantities, required items - OPEN: original free-form amount input (unchanged) Pass full campaign data (type, tiers, items) from the donate page server component to DonationFlow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.