package com.vote.system.domain.pojo;

import java.util.ArrayList;
import java.util.List;

/**
 * @author feng
 * @date 2024/8/29
 */
public class GroupedData {

    private int count;
    private List<Long> submissionIds;
    private Long eventId;
    private Long roundId;
    private Long workSettingsId;

    public GroupedData() {
        this.count = 0;
        this.submissionIds = new ArrayList<>();
    }

    public void add(Long submissionId, Long eventId, Long roundId, Long workSettingsId) {
        if (this.eventId == null) {
            this.eventId = eventId;
        }
        if (this.roundId == null) {
            this.roundId = roundId;
        }
        if (this.workSettingsId == null) {
            this.workSettingsId = workSettingsId;
        }
        count++;
        submissionIds.add(submissionId);
    }

    public int getCount() {
        return count;
    }

    public List<Long> getSubmissionIds() {
        return submissionIds;
    }

    public Long getEventId() {
        return eventId;
    }

    public Long getRoundId() {
        return roundId;
    }

    public Long getWorkSettingsId() {
        return workSettingsId;
    }

    @Override
    public String toString() {
        return "GroupedData{" +
                "count=" + count +
                ", submissionIds=" + submissionIds +
                ", eventId='" + eventId + '\'' +
                ", roundId=" + roundId +
                ", workSettingsId=" + workSettingsId +
                '}';
    }
}
