package com.snack.server.module.chat.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 客服会话 VO
 */
@Data
@Schema(description = "客服会话")
public class ChatSessionVO implements Serializable {

    @Schema(description = "会话 ID")
    private Long id;

    @Schema(description = "会话编号")
    private String sessionNo;

    @Schema(description = "用户 ID")
    private Long userId;

    @Schema(description = "用户名称")
    private String username;

    @Schema(description = "用户昵称")
    private String nickname;

    @Schema(description = "用户头像")
    private String avatar;

    @Schema(description = "客服 ID")
    private Long adminId;

    @Schema(description = "客服名称")
    private String adminName;

    @Schema(description = "状态：0-待处理 1-处理中 2-已解决 3-已关闭")
    private Integer status;

    @Schema(description = "状态文本")
    private String statusText;

    /** 视角相关：管理端读 adminUnread，用户端读 userUnread */
    @Schema(description = "未读数（根据调用方视角填充）")
    private Integer unreadCount;

    @Schema(description = "最后一条消息摘要")
    private String lastMessage;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "最后消息时间")
    private LocalDateTime lastTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;
}
