BREAKING CHANGES: - Refactored monolithic manage.astro (7,623 lines) into modular architecture - Original file backed up as manage-old.astro NEW ARCHITECTURE: ✅ 5 Utility Libraries: - event-management.ts: Event data operations & formatting - ticket-management.ts: Ticket CRUD operations & sales data - seating-management.ts: Seating map management & layout generation - sales-analytics.ts: Sales metrics, reporting & data export - marketing-kit.ts: Marketing asset generation & social media ✅ 5 Shared Components: - TicketTypeModal.tsx: Reusable ticket type creation/editing - SeatingMapModal.tsx: Advanced seating map editor with drag-and-drop - EmbedCodeModal.tsx: Widget embedding with customization - OrdersTable.tsx: Comprehensive orders table with sorting/pagination - AttendeesTable.tsx: Attendee management with export capabilities ✅ 11 Tab Components: - TicketsTab.tsx: Ticket management with card/list views - VenueTab.tsx: Seating map management & venue configuration - OrdersTab.tsx: Sales data & order management - AttendeesTab.tsx: Attendee check-in & management - PresaleTab.tsx: Presale code generation & tracking - DiscountTab.tsx: Discount code management - AddonsTab.tsx: Add-on product management - PrintedTab.tsx: Printed ticket barcode management - SettingsTab.tsx: Event configuration & custom fields - MarketingTab.tsx: Marketing kit with social media templates - PromotionsTab.tsx: Campaign & promotion management ✅ 4 Infrastructure Components: - TabNavigation.tsx: Responsive tab navigation system - EventManagement.tsx: Main orchestration component - EventHeader.astro: Event information header - QuickStats.astro: Statistics dashboard BENEFITS: - 98.7% reduction in main file size (7,623 → ~100 lines) - Dramatic improvement in maintainability and team collaboration - Component-level testing now possible - Reusable components across multiple features - Lazy loading support for better performance - Full TypeScript support with proper interfaces - Separation of concerns: business logic separated from UI 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
54 lines
1.9 KiB
SQL
54 lines
1.9 KiB
SQL
-- Add image_url column to events table
|
|
ALTER TABLE events ADD COLUMN image_url TEXT;
|
|
|
|
-- Create storage bucket for event images
|
|
INSERT INTO storage.buckets (id, name, public)
|
|
VALUES ('event-images', 'event-images', true);
|
|
|
|
-- Create storage policy for authenticated users to upload event images
|
|
CREATE POLICY "Users can upload event images" ON storage.objects
|
|
FOR INSERT WITH CHECK (
|
|
bucket_id = 'event-images' AND
|
|
auth.uid() IS NOT NULL
|
|
);
|
|
|
|
-- Create storage policy for public read access to event images
|
|
CREATE POLICY "Public read access to event images" ON storage.objects
|
|
FOR SELECT USING (bucket_id = 'event-images');
|
|
|
|
-- Create storage policy for users to delete their own event images
|
|
CREATE POLICY "Users can delete their own event images" ON storage.objects
|
|
FOR DELETE USING (
|
|
bucket_id = 'event-images' AND
|
|
auth.uid() IS NOT NULL
|
|
);
|
|
|
|
-- Update RLS policy for events to include image_url in SELECT
|
|
DROP POLICY IF EXISTS "Users can view events in their organization" ON events;
|
|
CREATE POLICY "Users can view events in their organization" ON events
|
|
FOR SELECT USING (
|
|
organization_id IN (
|
|
SELECT organization_id FROM users WHERE user_id = auth.uid()
|
|
)
|
|
);
|
|
|
|
-- Update RLS policy for events to include image_url in INSERT
|
|
DROP POLICY IF EXISTS "Users can create events in their organization" ON events;
|
|
CREATE POLICY "Users can create events in their organization" ON events
|
|
FOR INSERT WITH CHECK (
|
|
organization_id IN (
|
|
SELECT organization_id FROM users WHERE user_id = auth.uid()
|
|
)
|
|
);
|
|
|
|
-- Update RLS policy for events to include image_url in UPDATE
|
|
DROP POLICY IF EXISTS "Users can update events in their organization" ON events;
|
|
CREATE POLICY "Users can update events in their organization" ON events
|
|
FOR UPDATE USING (
|
|
organization_id IN (
|
|
SELECT organization_id FROM users WHERE user_id = auth.uid()
|
|
)
|
|
);
|
|
|
|
-- Add index on image_url for faster queries
|
|
CREATE INDEX IF NOT EXISTS idx_events_image_url ON events(image_url) WHERE image_url IS NOT NULL; |