2
0
forked from jmug/cactoide

feat: add option to link Google Maps to events

This commit is contained in:
Levente Orban
2025-09-24 21:15:31 +02:00
parent 69a760d3f1
commit cc3c868f7d
14 changed files with 353 additions and 93 deletions

View File

@@ -17,6 +17,7 @@ import type { InferInsertModel, InferSelectModel } from 'drizzle-orm';
// --- Enums (matching the SQL CHECK constraints)
export const eventTypeEnum = pgEnum('event_type', ['limited', 'unlimited']);
export const visibilityEnum = pgEnum('visibility', ['public', 'private']);
export const locationTypeEnum = pgEnum('location_type', ['text', 'maps']);
// --- Events table
export const events = pgTable(
@@ -27,6 +28,8 @@ export const events = pgTable(
date: date('date', { mode: 'string' }).notNull(), // ISO 'YYYY-MM-DD'
time: time('time', { withTimezone: false }).notNull(), // 'HH:MM:SS'
location: varchar('location', { length: 200 }).notNull(),
locationType: locationTypeEnum('location_type').notNull().default('text'),
locationUrl: varchar('location_url', { length: 500 }),
type: eventTypeEnum('type').notNull(),
attendeeLimit: integer('attendee_limit'), // nullable in SQL
userId: varchar('user_id', { length: 100 }).notNull(),

View File

@@ -14,6 +14,13 @@
"date": "Date",
"time": "Time",
"location": "Location",
"locationType": "Location Type",
"locationText": "Text",
"locationMaps": "Google Maps",
"locationTextDescription": "Enter location as plain text.",
"locationMapsDescription": "Enter Google Maps link.",
"googleMapsUrl": "Google Maps URL",
"googleMapsUrlPlaceholder": "https://maps.google.com/...",
"type": "Type",
"visibility": "Visibility",
"public": "Public",
@@ -134,6 +141,13 @@
"timeLabel": "Time",
"locationLabel": "Location",
"locationPlaceholder": "Enter location",
"locationTypeLabel": "Location Type",
"locationTextOption": "Plain Text",
"locationMapsOption": "Google Maps",
"locationTextDescription": "Enter location as plain text",
"locationMapsDescription": "Enter Google Maps link",
"googleMapsUrlLabel": "Google Maps URL",
"googleMapsUrlPlaceholder": "https://maps.google.com/...",
"typeLabel": "Type",
"unlimitedOption": "Unlimited",
"limitedOption": "Limited",

View File

@@ -1,6 +1,7 @@
export type EventType = 'limited' | 'unlimited';
export type EventVisibility = 'public' | 'private';
export type ActionType = 'add' | 'remove';
export type LocationType = 'text' | 'maps';
export interface Event {
id: string;
@@ -8,6 +9,8 @@ export interface Event {
date: string;
time: string;
location: string;
location_type: LocationType;
location_url?: string;
type: EventType;
attendee_limit?: number;
visibility: EventVisibility;
@@ -29,6 +32,8 @@ export interface CreateEventData {
date: string;
time: string;
location: string;
location_type: LocationType;
location_url?: string;
type: EventType;
attendee_limit?: number;
visibility: EventVisibility;
@@ -40,6 +45,8 @@ export interface DatabaseEvent {
date: string;
time: string;
location: string;
location_type: LocationType;
location_url?: string;
type: EventType;
attendee_limit?: number;
visibility: EventVisibility;