package tech.easyflow.chatlog.domain.command;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;

public class ChatSessionSummaryCommand implements Serializable {

    private BigInteger sessionId;
    private BigInteger userId;
    private BigInteger lastSenderId;
    private String lastSenderName;
    private String lastMessagePreview;
    private Date lastMessageAt = new Date();
    private Date accessAt = new Date();
    private Date modifiedAt = new Date();
    private BigInteger operatorId;
    private int messageIncrement = 1;
    private boolean forceOverwrite;

    public BigInteger getSessionId() {
        return sessionId;
    }

    public void setSessionId(BigInteger sessionId) {
        this.sessionId = sessionId;
    }

    public BigInteger getUserId() {
        return userId;
    }

    public void setUserId(BigInteger userId) {
        this.userId = userId;
    }

    public BigInteger getLastSenderId() {
        return lastSenderId;
    }

    public void setLastSenderId(BigInteger lastSenderId) {
        this.lastSenderId = lastSenderId;
    }

    public String getLastSenderName() {
        return lastSenderName;
    }

    public void setLastSenderName(String lastSenderName) {
        this.lastSenderName = lastSenderName;
    }

    public String getLastMessagePreview() {
        return lastMessagePreview;
    }

    public void setLastMessagePreview(String lastMessagePreview) {
        this.lastMessagePreview = lastMessagePreview;
    }

    public Date getLastMessageAt() {
        return lastMessageAt;
    }

    public void setLastMessageAt(Date lastMessageAt) {
        this.lastMessageAt = lastMessageAt;
    }

    public Date getAccessAt() {
        return accessAt;
    }

    public void setAccessAt(Date accessAt) {
        this.accessAt = accessAt;
    }

    public Date getModifiedAt() {
        return modifiedAt;
    }

    public void setModifiedAt(Date modifiedAt) {
        this.modifiedAt = modifiedAt;
    }

    public BigInteger getOperatorId() {
        return operatorId;
    }

    public void setOperatorId(BigInteger operatorId) {
        this.operatorId = operatorId;
    }

    public int getMessageIncrement() {
        return messageIncrement;
    }

    public void setMessageIncrement(int messageIncrement) {
        this.messageIncrement = Math.max(messageIncrement, 0);
    }

    public boolean isForceOverwrite() {
        return forceOverwrite;
    }

    public void setForceOverwrite(boolean forceOverwrite) {
        this.forceOverwrite = forceOverwrite;
    }
}
