Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the CMS data model and API surface by adding a room field to event requests (and linking event requests to draft events), and also introduces Stripe-backed memberships plus new user-related endpoints and middleware.
Changes:
- Add
roomenumeration support to event-request intake (form mapping + schema/types) and persist it on created event-request records. - Introduce a new
membershipcontent type with Stripe Checkout/Portal endpoints and a webhook handler, plus a raw-body middleware for Stripe signature verification. - Extend the users-permissions user model with
stripeCustomerId,userType, andmemberships, and add newme/volunteerApplycontroller actions + route.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| cms/types/generated/contentTypes.d.ts | Regenerated Strapi typings reflecting new/updated schemas (event-request room/status, membership/project, user fields). |
| cms/src/middlewares/stripe-webhook.ts | Adds middleware to preserve raw request body for Stripe webhook signature verification. |
| cms/src/extensions/users-permissions/strapi-server.ts | Extends user schema (stripeCustomerId, userType, memberships) and wires new controller actions. |
| cms/src/extensions/users-permissions/routes/custom-routes.ts | Adds /volunteer/apply route. |
| cms/src/extensions/users-permissions/controllers/user.ts | Adds me + volunteerApply; changes updateProfile output sanitation; adjusts FCM token handling. |
| cms/src/api/membership/services/membership.ts | Adds core service for the new membership content type. |
| cms/src/api/membership/routes/membership.ts | Adds membership endpoints: me, checkout, portal, webhook. |
| cms/src/api/membership/controllers/membership.ts | Implements Stripe integration (checkout/portal/webhook) and membership lifecycle updates. |
| cms/src/api/membership/content-types/membership/schema.json | Defines new membership collection type schema and relation to user. |
| cms/src/api/event-request/routes/event-request.ts | Replaces core router with empty routes array (disables default event-request Content API routes). |
| cms/src/api/event-request/routes/custom-event-request.ts | Removes the custom approve route. |
| cms/src/api/event-request/controllers/form.ts | Maps room from submitted form data, persists it, and includes it in confirmation emails. |
| cms/src/api/event-request/controllers/event-request.ts | Removes custom approve controller and reverts to core controller. |
| cms/src/api/event-request/content-types/event-request/schema.json | Adds room enumeration field to the event-request schema. |
| cms/config/middlewares.ts | Registers the new global Stripe webhook middleware (before body parsing). |
| cms/.env.example | Adds Stripe environment variable placeholders/URLs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+58
to
+61
| const user = await strapi.documents('plugin::users-permissions.user').findOne({ | ||
| documentId: ctx.state.user.documentId, | ||
| populate: ['role', 'profilePicture', 'memberships'], | ||
| }); |
Comment on lines
141
to
144
| <p><strong>Organization:</strong> ${eventRequest.organization}</p> | ||
| <p><strong>Event type</strong>: ${eventRequest.eventType}</p> | ||
| <p><strong>Room</strong>: ${eventRequest.room}</p> | ||
| <p><strong>Event name</strong>: ${eventRequest.eventName}</p> |
Comment on lines
+38
to
+40
| if (user.stripeCustomerId) { | ||
| return user.stripeCustomerId; | ||
| } |
Comment on lines
+166
to
+169
| try { | ||
| const stripe = getStripe(); | ||
| const event = stripe.webhooks.constructEvent(rawBody, sig, webhookSecret); | ||
| const eventId = event.id; |
Comment on lines
1
to
+5
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| export default factories.createCoreRouter('api::event-request.event-request'); No newline at end of file | ||
| export default { | ||
| routes: [], | ||
| }; |
Comment on lines
+171
to
+177
| html: `<p>An error occurred while sending volunteer application emails.</p> | ||
| <p><strong>Error:</strong> ${error.message || String(error)}</p> | ||
| <p><strong>Stack:</strong></p> | ||
| <pre>${error.stack || 'No stack trace available'}</pre> | ||
| <p><strong>Applicant name:</strong> ${escapeHtml(applicantName)}</p> | ||
| <p><strong>Applicant email:</strong> ${escapeHtml(applicantEmail)}</p> | ||
| `, |
Comment on lines
+1
to
+7
| import { factories } from '@strapi/strapi'; | ||
|
|
||
| const UID = 'api::membership.membership'; | ||
| let stripeInstance: any = null; | ||
|
|
||
| const USER_UID = 'plugin::users-permissions.user'; | ||
|
|
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.
Created a foom field for every event request/event. This can be used in the future to cross-refrence which rooms are free.