mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-26 08:31:08 -05:00
Approve database migration
This commit is contained in:
86
src/types/timeline.ts
Normal file
86
src/types/timeline.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user