package com.style24.persistence.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.style24.core.support.util.CryptoUtils;
import com.style24.persistence.TscBaseDomain;
import com.style24.persistence.TscPageRequest;
import lombok.Data;

/**
 * 회원 검색조건 Admin - Domain
 *
 * @author jsshin
 * @since 2020. 01. 12
 */
@SuppressWarnings("serial")
@Data
public class CustomerSearch extends TscBaseDomain {

	// 검색조건
	private String searchDateGb;
	private String searchGb;
	private String searchTxt;
	private String stDate;
	private String edDate;

	private String siteCd;
	private String cellPhnno;
	private String custGb;
	private String custGrade;
	private String managedRsn;
	private String smsAgreeYn;
	private String emailAgreeYn;
	private String appAgreeYn;
	private String mkAgreeYn;
	private String secedeRsn;
	private String custNm;
	private String email;
	private String custId;
	private Integer custNo;
	private String snsType;

	// 쿠폰발행팝업
	private String cpnPubPopYn;		// 쿠폰발행팝업

	private String condition; // 키워드 종류
	private String search; // 검색어
	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
	private String[] conditionList;
	private String[] conditions;

	private TscPageRequest pageable;
	private int pageNo = 1;
	private int pageSize = 50;
	private int pageUnit = 10;

	// 암호화 대상 데이터 암호화 처리
	public void encryptData () {
		this.custNm = CryptoUtils.encryptAES(this.custNm);
		this.cellPhnno = CryptoUtils.encryptAES(this.cellPhnno);
		this.email = CryptoUtils.encryptAES(this.email);
	}

}
