feat: chat — group chat creation (create-group view, backend endpoint, group room display)

This commit is contained in:
2026-04-14 17:36:04 +03:00
parent b91a75c89f
commit 8353eb7c7f
4 changed files with 176 additions and 11 deletions

View File

@@ -356,6 +356,8 @@ export const api = {
req<{ ok: boolean }>('PATCH', `/api/hotels/${slug}/chat/rooms/${roomId}/read`),
openDirect: (slug: string, otherUserId: string) =>
req<{ roomId: string }>('POST', `/api/hotels/${slug}/chat/direct/${otherUserId}`),
createGroup: (slug: string, name: string, memberIds: string[]) =>
req<{ roomId: string }>('POST', `/api/hotels/${slug}/chat/group`, { name, memberIds }),
editMessage: (slug: string, roomId: string, msgId: string, text: string) =>
req<ChatMessage>('PATCH', `/api/hotels/${slug}/chat/rooms/${roomId}/messages/${msgId}`, { text }),
deleteMessage: (slug: string, roomId: string, msgId: string) =>
@@ -1335,7 +1337,7 @@ export interface LoyaltyTransaction {
export interface ChatRoom {
id: string
type: 'general' | 'direct' | 'notifications'
type: 'general' | 'direct' | 'notifications' | 'group'
name: string | null
unreadCount: number
lastMessage: string | null
@@ -1345,6 +1347,8 @@ export interface ChatRoom {
otherUserRole: string | null
otherUserId: string | null
otherUserLastRead: string | null
memberCount: number
memberNames: string[] | null
}
export interface ChatReaction {