ai / types.ts
Lianjx's picture
Upload 75 files
8fb4cca verified
// Import React to support React.ReactNode type usage
import React from 'react';
export type Language = 'en' | 'zh' | 'ja' | 'ko' | 'es' | 'fr';
export type CompositionMode = 'classic' | 'dynamic' | 'cinematic';
export type Resolution = 'standard' | 'high' | 'ultra';
export type SubjectType = 'female' | 'male' | 'couple' | 'child' | 'family';
export interface WeddingStyle {
id: string;
name: string; // Fallback name
prompt: string;
promptKeywords?: string[]; // New: Synonyms or related terms for improved AI understanding
description: string; // Fallback description
coverColor: string;
previewImage?: string; // New: Optional preview image for the style card
category?: string;
icon?: React.ReactNode;
isCustom?: boolean;
tags?: ('hot' | 'new' | 'recommend')[];
isLocked?: boolean; // New: VIP Lock status
groupCount?: number; // PDD: How many people joining
}
export interface GenerationConfig {
customInstruction?: string;
filter: string;
blurAmount: number;
compositionMode: CompositionMode;
resolution: Resolution;
subjectType?: SubjectType;
}
export interface GeneratedResult {
styleId: string;
imageUrl: string;
timestamp: number;
config?: GenerationConfig;
}
export type GenerationStatus = 'idle' | 'generating' | 'success' | 'error' | 'partial';
// --- NEW TYPES FOR ADMIN & USER CENTER ---
export interface LeadData {
id: string;
userId?: string; // Linked User Account ID
name: string;
phone: string;
wechat?: string;
service?: string;
budget?: string;
date?: string;
timestamp: number;
status: 'new' | 'contacted' | 'booked';
// CRM Intelligence Fields
preferredStyle?: string; // e.g., 'Korean Minimalist'
generationCount?: number; // How many times they generated (Intent Score)
syncStatus?: 'pending' | 'synced' | 'failed'; // CRM Sync Status
crmId?: string; // External ID
}
export interface GenerationLog {
styleId: string;
styleName: string;
userId: string;
timestamp: number;
ip: string;
location: string;
device: string;
}
export interface AdminConfig {
promoText: string;
promoEnds: string; // ISO Date string
contactPhone: string;
showBanner: boolean;
footerAddress: string;
// Custom Branding
logoUrl?: string; // NEW: Custom App Logo
// Marketing / Share
shareTitle?: string;
shareDesc?: string;
shareImage?: string;
redPacketMax?: number;
slashDifficulty?: number;
shareConfig?: any;
// Custom Content (About Us & Contact)
aboutStory?: string;
aboutPhilosophy?: string;
aboutLocation?: string;
qrCodeUrl?: string; // Custom Booking QR Code
// Membership Mechanics
pointsShare?: number;
pointsInvite?: number;
pointsBook?: number;
pointsVipCost?: number; // Cost to redeem VIP
// CRM & System Config
crmApiUrl?: string;
crmApiKey?: string;
geminiApiKey?: string; // Dynamic API Key
geminiApiUrl?: string; // Dynamic API Base URL (Proxy)
}
export interface PointHistory {
id: string;
action: 'share' | 'invite' | 'book' | 'redeem' | 'admin_adjust' | 'slash_help';
points: number;
timestamp: number;
desc: string;
}
export interface StaffPermissions {
canExportLeads: boolean;
canDeleteLeads: boolean;
canManageSettings: boolean;
canManageUsers: boolean;
canManageStaff: boolean;
}
export interface UserAccount {
id: string;
name: string;
phone?: string; // NEW: For login
password?: string; // NEW: Mock password
avatar?: string;
points: number;
isVip: boolean;
joinDate: number;
history: PointHistory[];
role: 'user' | 'staff' | 'admin'; // NEW: Role based access
permissions?: StaffPermissions; // NEW: Granular permissions
favorites?: string[]; // NEW: Persisted favorites
// BI Analytics
styleStats?: Record<string, number>; // { 'korean': 5, 'chinese': 2 }
// PDD Mechanics
redPacketBalance?: number; // e.g. 1980
slashProgress?: Record<string, number>; // styleId -> percentage (0-100)
}
export type VideoTemplate = 'default' | 'flash' | 'slow' | 'story';
export interface FeedbackItem {
id: string;
userId?: string;
type: 'bug' | 'suggestion' | 'other';
rating: number;
content: string;
timestamp: number;
contact?: string;
}