narasiahli-be/app/module/chat/response/chat.response.go

57 lines
2.0 KiB
Go

package response
import (
"time"
)
// Chat Session Response
type ChatSessionResponse struct {
ID uint `json:"id"`
Name *string `json:"name"`
Type string `json:"type"`
CreatedBy uint `json:"createdBy"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Creator *UserBasicInfo `json:"creator,omitempty"`
Participants []*ChatParticipantResponse `json:"participants,omitempty"`
LastMessage *ChatMessageResponse `json:"lastMessage,omitempty"`
UnreadCount int `json:"unreadCount"`
}
// Chat Message Response
type ChatMessageResponse struct {
ID uint `json:"id"`
ChatSessionID uint `json:"chatSessionId"`
SenderID uint `json:"senderId"`
Message string `json:"message"`
MessageType string `json:"messageType"`
IsEdited bool `json:"isEdited"`
EditedAt *time.Time `json:"editedAt"`
IsDeleted bool `json:"isDeleted"`
DeletedAt *time.Time `json:"deletedAt"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Sender *UserBasicInfo `json:"sender,omitempty"`
}
// Chat Participant Response
type ChatParticipantResponse struct {
ID uint `json:"id"`
ChatSessionID uint `json:"chatSessionId"`
UserID uint `json:"userId"`
JoinedAt time.Time `json:"joinedAt"`
LeftAt *time.Time `json:"leftAt"`
IsActive bool `json:"isActive"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
User *UserBasicInfo `json:"user,omitempty"`
}
// User Basic Info (reused from work_history)
type UserBasicInfo struct {
ID uint `json:"id"`
Username string `json:"username"`
Fullname string `json:"fullname"`
Email string `json:"email"`
}