mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 05:31:13 -05:00
feat: Implement privacy modernization plan
This commit is contained in:
58
src/types/privacy.ts
Normal file
58
src/types/privacy.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
/**
|
||||
* Privacy Types
|
||||
*
|
||||
* Centralized type definitions for user privacy settings.
|
||||
*
|
||||
* Storage:
|
||||
* - ProfilePrivacySettings: stored in profiles table
|
||||
* - PrivacySettings: stored in user_preferences.privacy_settings (JSONB)
|
||||
*
|
||||
* Security:
|
||||
* - All privacy settings are validated with Zod before database writes
|
||||
* - Changes are logged to profile_audit_log for compliance
|
||||
* - RLS policies ensure users can only modify their own settings
|
||||
*/
|
||||
|
||||
/**
|
||||
* Privacy settings stored in user_preferences.privacy_settings
|
||||
*/
|
||||
export interface PrivacySettings {
|
||||
activity_visibility: 'public' | 'private';
|
||||
search_visibility: boolean;
|
||||
show_location: boolean;
|
||||
show_age: boolean;
|
||||
show_avatar: boolean;
|
||||
show_bio: boolean;
|
||||
show_activity_stats: boolean;
|
||||
show_home_park: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Profile-level privacy settings
|
||||
*/
|
||||
export interface ProfilePrivacySettings {
|
||||
privacy_level: 'public' | 'private';
|
||||
show_pronouns: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Combined form data for privacy tab
|
||||
*/
|
||||
export interface PrivacyFormData extends ProfilePrivacySettings, PrivacySettings {}
|
||||
|
||||
/**
|
||||
* User block information
|
||||
*/
|
||||
export interface UserBlock {
|
||||
id: string;
|
||||
blocker_id: string;
|
||||
blocked_id: string;
|
||||
reason?: string;
|
||||
created_at: string;
|
||||
blocked_profile?: {
|
||||
user_id: string;
|
||||
username: string;
|
||||
display_name?: string;
|
||||
avatar_url?: string;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user