mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 12:11:17 -05:00
feat: Implement full type safety plan
This commit is contained in:
77
supabase/functions/_shared/types.ts
Normal file
77
supabase/functions/_shared/types.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* Shared type definitions for edge functions
|
||||
* Provides type safety across all backend operations
|
||||
*/
|
||||
|
||||
export interface SubmissionUpdateData {
|
||||
status?: 'approved' | 'rejected' | 'pending';
|
||||
reviewer_id?: string;
|
||||
reviewed_at?: string;
|
||||
reviewer_notes?: string;
|
||||
}
|
||||
|
||||
export interface PhotoSubmissionUpdateData {
|
||||
status?: 'approved' | 'rejected' | 'pending';
|
||||
reviewed_by?: string;
|
||||
reviewed_at?: string;
|
||||
reviewer_notes?: string;
|
||||
}
|
||||
|
||||
export interface ReviewUpdateData {
|
||||
is_approved?: boolean;
|
||||
approved_by?: string;
|
||||
approved_at?: string;
|
||||
reviewer_notes?: string;
|
||||
}
|
||||
|
||||
export interface EntityData {
|
||||
id?: string;
|
||||
name?: string;
|
||||
slug?: string;
|
||||
description?: string;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface LocationData {
|
||||
country?: string;
|
||||
state_province?: string;
|
||||
city?: string;
|
||||
latitude?: number;
|
||||
longitude?: number;
|
||||
}
|
||||
|
||||
export interface SubscriberData {
|
||||
subscriberId: string;
|
||||
email?: string;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
phone?: string;
|
||||
avatar?: string;
|
||||
data?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface NotificationPayload {
|
||||
workflowId: string;
|
||||
subscriberId?: string;
|
||||
topicKey?: string;
|
||||
payload: Record<string, unknown>;
|
||||
overrides?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface ApprovalRequest {
|
||||
submissionId: string;
|
||||
itemIds: string[];
|
||||
action: 'approve' | 'reject';
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
export interface ValidationResult {
|
||||
valid: boolean;
|
||||
errors: string[];
|
||||
}
|
||||
|
||||
export interface StrictValidationResult {
|
||||
valid: boolean;
|
||||
blockingErrors: string[];
|
||||
warnings: string[];
|
||||
}
|
||||
Reference in New Issue
Block a user