Port modular features into boursecu and fix desktop login UX.
Add support chat, piggy funds, PWA banner, notification/SSE sync, and messenger legacy guards while keeping boursecu theme; also balance login panels and unblock login navigation. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+5
-2
@@ -1,16 +1,19 @@
|
||||
import type {Wallet} from '@/models/wallet';
|
||||
import type {Product} from '@/models/products';
|
||||
|
||||
export interface Fund {
|
||||
id?: number,
|
||||
title?: string,
|
||||
file_id?: number,
|
||||
customer_id?: number,
|
||||
product_id?: number,
|
||||
created_at?: string,
|
||||
updated_at?: string,
|
||||
deleted_at?: string,
|
||||
wallet?: Wallet[] | Wallet
|
||||
wallet?: Wallet[] | Wallet,
|
||||
product?: Product,
|
||||
}
|
||||
export interface FundTransaction {
|
||||
fund_id?: number
|
||||
value?: number
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,9 @@ export interface User {
|
||||
|
||||
finger_print: boolean
|
||||
gold: number;
|
||||
chat_room_id?: string | null
|
||||
chat_user_id?: string | null
|
||||
settings?: Array<{ key?: string; value?: string | number }>
|
||||
}
|
||||
|
||||
export interface Login {
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
export type ChatAttachmentType = 'image' | 'audio'
|
||||
|
||||
export type ChatMessageSender = 'user' | 'support' | 'admin'
|
||||
|
||||
export type ChatMessageStatus = 'sending' | 'sent' | 'seen' | 'failed'
|
||||
|
||||
export type ChatAttachment = {
|
||||
id: string
|
||||
type: 'image' | 'audio'
|
||||
url: string
|
||||
name?: string
|
||||
size?: number
|
||||
mimeType?: string
|
||||
durationMs?: number
|
||||
file?: File
|
||||
uploading?: boolean
|
||||
uploadProgress?: number
|
||||
}
|
||||
|
||||
export type ChatReplyPreview = {
|
||||
id: string
|
||||
sender: string
|
||||
text?: string
|
||||
attachment?: {
|
||||
type: 'image' | 'audio'
|
||||
url: string
|
||||
name?: string
|
||||
} | null
|
||||
}
|
||||
|
||||
export interface ChatMessage {
|
||||
id: string
|
||||
text?: string
|
||||
sender: 'user' | 'support'
|
||||
createdAt: string
|
||||
createdAtRaw?: string | number | Date | null
|
||||
status?: 'sending' | 'sent' | 'seen'
|
||||
attachments?: ChatAttachment[]
|
||||
|
||||
// reply
|
||||
reply?: string | null
|
||||
replyTo?: ChatReplyPreview | null
|
||||
}
|
||||
|
||||
export type ComposerSendPayload = {
|
||||
text: string
|
||||
attachments: ChatAttachment[]
|
||||
reply?: string | null
|
||||
replyTo?: ChatReplyPreview | null
|
||||
}
|
||||
|
||||
|
||||
export interface SupportMessage {
|
||||
id: string
|
||||
sender: 'user' | 'admin'
|
||||
text?: string
|
||||
createdAt: string
|
||||
createdAtRaw?: string | number | Date | null
|
||||
status?: ChatMessageStatus
|
||||
attachments?: ChatAttachment[]
|
||||
|
||||
// reply
|
||||
reply?: string | null
|
||||
replyTo?: ChatReplyPreview | null
|
||||
}
|
||||
|
||||
export interface SupportConversation {
|
||||
id: string
|
||||
userName: string
|
||||
avatar: string
|
||||
online: boolean
|
||||
unreadCount: number
|
||||
lastSeenText: string
|
||||
lastMessagePreview: string
|
||||
updatedAtText: string
|
||||
messages: SupportMessage[]
|
||||
}
|
||||
Reference in New Issue
Block a user