Approve database migration

This commit is contained in:
gpt-engineer-app[bot]
2025-10-15 19:29:06 +00:00
parent 359a156260
commit 444634dc85
9 changed files with 1020 additions and 0 deletions

86
src/types/timeline.ts Normal file
View File

@@ -0,0 +1,86 @@
/**
* Timeline Event Types
*
* Type definitions for entity timeline/historical milestone system.
* All timeline events flow through moderation queue before being stored.
*/
export type TimelineEventType =
| 'name_change'
| 'operator_change'
| 'owner_change'
| 'location_change'
| 'status_change'
| 'closure'
| 'reopening'
| 'renovation'
| 'expansion'
| 'acquisition'
| 'milestone'
| 'other';
export type EntityType = 'park' | 'ride' | 'company';
export type DatePrecision = 'day' | 'month' | 'year';
/**
* Timeline event stored in database after approval
*/
export interface TimelineEvent {
id: string;
entity_id: string;
entity_type: EntityType;
event_type: TimelineEventType;
event_date: string;
event_date_precision: DatePrecision;
title: string;
description?: string;
// Type-specific relational data
from_value?: string;
to_value?: string;
from_entity_id?: string;
to_entity_id?: string;
from_location_id?: string;
to_location_id?: string;
// Metadata
is_public: boolean;
display_order: number;
created_by?: string;
approved_by?: string;
submission_id?: string;
created_at: string;
updated_at: string;
}
/**
* Form data for creating/editing timeline events
*/
export interface TimelineEventFormData {
event_type: TimelineEventType;
event_date: Date;
event_date_precision: DatePrecision;
title: string;
description?: string;
// Conditional fields based on event_type
from_value?: string;
to_value?: string;
from_entity_id?: string;
to_entity_id?: string;
from_location_id?: string;
to_location_id?: string;
is_public?: boolean;
}
/**
* Complete submission data for timeline events
* Includes entity reference and all form data
*/
export interface TimelineSubmissionData extends TimelineEventFormData {
entity_id: string;
entity_type: EntityType;
}