package com.bcxin.tenant.open.domains.criterias;

import com.bcxin.tenant.open.infrastructures.criterias.CriteriaAbstract;
import com.bcxin.tenant.open.infrastructures.enums.DeskType;
import lombok.Getter;

import java.util.Collection;
import java.util.Date;

@Getter
public class DispatchLogSearchCriteria extends CriteriaAbstract {
    private Collection<DeskType> deskTypes;
    private final String callerName;
    private final String calledCompanyName;
    private final Date dispatchedDateFrom;
    private final Date dispatchedDateTo;
    private final Collection<String> superviseDepartIds;
    private final Collection<String> callerDeviceNos;

    private final String projectName;

    public DispatchLogSearchCriteria(
            int pageIndex,
            int pageSize,
            Collection<DeskType> deskTypes,
            Collection<String> superviseDepartIds,
            String callerName, String calledCompanyName,
                                     Date dispatchedDateFrom, Date dispatchedDateTo,
                                     Collection<String> callerDeviceNos,
            String projectName) {
        super(pageIndex, pageSize);
        this.superviseDepartIds = superviseDepartIds;
        this.callerName = callerName;
        this.calledCompanyName = calledCompanyName;
        this.dispatchedDateFrom = dispatchedDateFrom;
        this.dispatchedDateTo = dispatchedDateTo;
        this.callerDeviceNos = callerDeviceNos;
        this.deskTypes = deskTypes;
        this.projectName = projectName;
    }

    public static DispatchLogSearchCriteria create(
            int pageIndex,
            int pageSize,
            Collection<DeskType> deskTypes,
            Collection<String> superviseDepartIds,
            String callerName,
                                                   String calledCompanyName,
                                                   Date dispatchedDateFrom,
                                                   Date dispatchedDateTo,
                                                   Collection<String> callerDeviceNos,
            String projectName) {
        return new DispatchLogSearchCriteria(
                pageIndex, pageSize,
                deskTypes,
                superviseDepartIds,
                callerName, calledCompanyName,
                dispatchedDateFrom, dispatchedDateTo, callerDeviceNos,projectName
        );
    }
}
