Skip to content

Updated event with room field - #15

Open
dokicaaa wants to merge 8 commits into
mainfrom
release/final-polish
Open

dokicaaa wants to merge 8 commits into
mainfrom
release/final-polish

Conversation

@dokicaaa

Copy link
Copy Markdown
Contributor

Created a foom field for every event request/event. This can be used in the future to cross-refrence which rooms are free.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 room enumeration support to event-request intake (form mapping + schema/types) and persist it on created event-request records.
  • Introduce a new membership content 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, and memberships, and add new me / volunteerApply controller 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';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants