feat: Complete platform enhancement with multi-tenant architecture
Major additions: - Territory manager system with application workflow - Custom pricing and page builder with Craft.js - Enhanced Stripe Connect onboarding - CodeReadr QR scanning integration - Kiosk mode for venue sales - Super admin dashboard and analytics - MCP integration for AI-powered operations Infrastructure improvements: - Centralized API client and routing system - Enhanced authentication with organization context - Comprehensive theme management system - Advanced event management with custom tabs - Performance monitoring and accessibility features Database schema updates: - Territory management tables - Custom pages and pricing structures - Kiosk PIN system - Enhanced organization profiles - CodeReadr integration tables 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
---
|
||||
import Layout from '../../layouts/Layout.astro';
|
||||
import Navigation from '../../components/Navigation.astro';
|
||||
import { verifyAuth } from '../../lib/auth';
|
||||
|
||||
// Enable server-side rendering for auth checks
|
||||
export const prerender = false;
|
||||
|
||||
// Server-side authentication check
|
||||
const auth = await verifyAuth(Astro.request);
|
||||
if (!auth) {
|
||||
return Astro.redirect('/login');
|
||||
}
|
||||
---
|
||||
|
||||
<Layout title="Create Event - Black Canyon Tickets">
|
||||
@@ -308,9 +318,9 @@ import Navigation from '../../components/Navigation.astro';
|
||||
const existingVenueSection = document.getElementById('existing-venue-section');
|
||||
const customVenueSection = document.getElementById('custom-venue-section');
|
||||
|
||||
let currentOrganizationId = null;
|
||||
let selectedAddons = [];
|
||||
let eventImageUrl = null;
|
||||
let currentOrganizationId: string | null = null;
|
||||
// let selectedAddons: any[] = []; // TODO: Implement addons functionality
|
||||
let eventImageUrl: string | null = null;
|
||||
|
||||
// Check authentication
|
||||
async function checkAuth() {
|
||||
@@ -347,6 +357,8 @@ import Navigation from '../../components/Navigation.astro';
|
||||
|
||||
// Load available venues
|
||||
async function loadVenues() {
|
||||
if (!currentOrganizationId) return;
|
||||
|
||||
try {
|
||||
const { data: venues, error } = await supabase
|
||||
.from('venues')
|
||||
@@ -376,14 +388,14 @@ import Navigation from '../../components/Navigation.astro';
|
||||
|
||||
// Handle venue option change
|
||||
function handleVenueOptionChange() {
|
||||
const venueOption = document.querySelector('input[name="venue_option"]:checked')?.value;
|
||||
const venueOption = (document.querySelector('input[name="venue_option"]:checked') as HTMLInputElement)?.value;
|
||||
|
||||
if (venueOption === 'existing') {
|
||||
existingVenueSection.classList.remove('hidden');
|
||||
customVenueSection.classList.add('hidden');
|
||||
existingVenueSection?.classList.remove('hidden');
|
||||
customVenueSection?.classList.add('hidden');
|
||||
} else {
|
||||
existingVenueSection.classList.add('hidden');
|
||||
customVenueSection.classList.remove('hidden');
|
||||
existingVenueSection?.classList.add('hidden');
|
||||
customVenueSection?.classList.remove('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,7 +410,7 @@ import Navigation from '../../components/Navigation.astro';
|
||||
const title = formData.get('title') as string;
|
||||
const eventDate = formData.get('event_date') as string;
|
||||
const eventTime = formData.get('event_time') as string;
|
||||
const timezone = formData.get('timezone') as string;
|
||||
// const timezone = formData.get('timezone') as string; // TODO: Use timezone in future
|
||||
const description = formData.get('description') as string;
|
||||
const seatingType = formData.get('seating_type') as string;
|
||||
const venueOption = formData.get('venue_option') as string;
|
||||
@@ -416,7 +428,7 @@ import Navigation from '../../components/Navigation.astro';
|
||||
const { data: { user } } = await supabase.auth.getUser();
|
||||
if (!user) throw new Error('Not authenticated');
|
||||
|
||||
let organizationId = currentOrganizationId;
|
||||
let organizationId: string | null = currentOrganizationId;
|
||||
|
||||
if (!organizationId) {
|
||||
// Create a default organization for the user
|
||||
@@ -511,14 +523,14 @@ import Navigation from '../../components/Navigation.astro';
|
||||
const addonsChevron = document.getElementById('addons-chevron');
|
||||
|
||||
addonsToggle?.addEventListener('click', () => {
|
||||
const isHidden = addonsSection.classList.contains('hidden');
|
||||
const isHidden = addonsSection?.classList.contains('hidden');
|
||||
|
||||
if (isHidden) {
|
||||
addonsSection.classList.remove('hidden');
|
||||
addonsChevron.classList.add('rotate-180');
|
||||
addonsSection?.classList.remove('hidden');
|
||||
addonsChevron?.classList.add('rotate-180');
|
||||
} else {
|
||||
addonsSection.classList.add('hidden');
|
||||
addonsChevron.classList.remove('rotate-180');
|
||||
addonsSection?.classList.add('hidden');
|
||||
addonsChevron?.classList.remove('rotate-180');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user