package com.eactive.httpmockserver.user.dto;

import com.eactive.httpmockserver.common.search.BaseSearch;
import com.eactive.httpmockserver.common.search.ColumnSearchModel;
import com.eactive.httpmockserver.common.search.SearchCondition;
import com.eactive.httpmockserver.common.search.SearchModel;
import com.eactive.httpmockserver.user.entity.StaffUser;
import com.eactive.httpmockserver.user.entity.UserStatus;

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

public class UserSearch implements BaseSearch<StaffUser> {

    private String username;

    private List<String> checkedIdForDel;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public List<String> getCheckedIdForDel() {
        return checkedIdForDel;
    }

    public void setCheckedIdForDel(List<String> checkedIdForDel) {
        this.checkedIdForDel = checkedIdForDel;
    }

    @Override
    public List<SearchModel> buildSearchCondition() {
        List<SearchModel> models = new ArrayList<>();
        models.add(new ColumnSearchModel("username", SearchCondition.LIKE, username));
        models.add(new ColumnSearchModel("status", SearchCondition.NOT_EQUAL, UserStatus.DELETED));

        return models;
    }
}
