Add series management and ticketing features: Introduce series event functionality in event creation, enhance event display with series information, and implement ticketing options for public events. Update layouts and improve form handling for better user experience.

This commit is contained in:
Jennie Robinson Faber 2025-08-27 20:40:54 +01:00
parent c3a29fa47c
commit a88aa62198
24 changed files with 2897 additions and 44 deletions

View file

@ -39,6 +39,41 @@ const eventSchema = new mongoose.Schema({
isCancelled: { type: Boolean, default: false },
cancellationMessage: String, // Custom message for cancelled events
membersOnly: { type: Boolean, default: false },
// Series information - embedded approach for better performance
series: {
id: String, // Simple string ID to group related events
title: String, // Series title (e.g., "Cooperative Game Development Workshop Series")
description: String, // Series description
type: {
type: String,
enum: ['workshop_series', 'recurring_meetup', 'multi_day', 'course', 'tournament'],
default: 'workshop_series'
},
position: Number, // Order within the series (e.g., 1 = first event, 2 = second, etc.)
totalEvents: Number, // Total planned events in the series
isSeriesEvent: { type: Boolean, default: false } // Flag to identify series events
},
// Event pricing for public attendees (deprecated - use tickets instead)
pricing: {
isFree: { type: Boolean, default: true },
publicPrice: { type: Number, default: 0 }, // Price for non-members
currency: { type: String, default: 'CAD' },
paymentRequired: { type: Boolean, default: false }
},
// Ticket configuration
tickets: {
enabled: { type: Boolean, default: false },
public: {
available: { type: Boolean, default: false },
name: { type: String, default: 'Public Ticket' },
description: String,
price: { type: Number, default: 0 },
quantity: Number, // null = unlimited
sold: { type: Number, default: 0 },
earlyBirdPrice: Number,
earlyBirdDeadline: Date
}
},
// Circle targeting
targetCircles: [{
type: String,
@ -58,6 +93,14 @@ const eventSchema = new mongoose.Schema({
name: String,
email: String,
membershipLevel: String,
isMember: { type: Boolean, default: false },
paymentStatus: {
type: String,
enum: ['pending', 'completed', 'failed', 'not_required'],
default: 'not_required'
},
paymentId: String, // Helcim transaction ID
amountPaid: { type: Number, default: 0 },
registeredAt: { type: Date, default: Date.now }
}],
createdBy: { type: String, required: true },