Fix submission_items foreign keys

This commit is contained in:
gpt-engineer-app[bot]
2025-11-04 14:57:58 +00:00
parent 9d2c418649
commit 80aa033e70
10 changed files with 311 additions and 30 deletions

View File

@@ -124,7 +124,6 @@ export type SubmissionItemData =
export interface SubmissionItem {
id: string;
item_type: string;
item_data_id: string | null;
action_type: 'create' | 'edit' | 'delete';
status: string;
order_index: number;
@@ -132,6 +131,14 @@ export interface SubmissionItem {
approved_entity_id: string | null;
rejection_reason: string | null;
// Typed foreign key columns (one will be populated based on item_type)
park_submission_id?: string | null;
ride_submission_id?: string | null;
photo_submission_id?: string | null;
company_submission_id?: string | null;
ride_model_submission_id?: string | null;
timeline_event_submission_id?: string | null;
// Entity data from dynamic join (pre-loaded from view)
entity_data?: {
id: string;