package com.style24.persistence.domain;

import java.util.Collection;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.style24.persistence.TscBaseDomain;
import com.style24.persistence.TscPageRequest;
import com.style24.core.support.session.TscSession;
import com.style24.core.support.util.CryptoUtils;
import com.style24.core.support.util.MaskingUtils;

import lombok.Data;

/**
 * 상품 Domain
 *
 * @author moon
 * @since 2020. 11. 05
 */
@SuppressWarnings("serial")
@Data
public class Delivery extends TscBaseDomain {

	
	/* 아래로 작성 (.. ) ( ..) */
	
	private String brandCd;
	private String brandKnm;
	private String delvLocNm;
	private String imgType;
	private String imgPath1;
	private String goodsNm;
	private String goodsCd;
	private String sizeCd;
	private String goodsStat;
	private String delvBanStdt;
	private String delvBanEddt;   
	private String goodsStatNm;
	private String supplyCompCd;
	private String searchTxt;
	private String colorCd;
	private String sysImgNm;
	private String delvAddrNm;
	private String defaultYn;
	private String recipNm;
	private String recipTelno;
	private String recipPhnno;
	private String recipZipcode;
	private String recipBaseAddr;
	private String recipDtlAddr;
	private String delvMemo;
	private String delYn;
	private String goodsType;
	private String goodsTypeNm;
	private String sellStoreCd;
	private String sellStoreNm;
	private String mallGbNm;
	private String ordDtlStatNm;
	private String ordDtlStat;
	private String itemCd; 
	private String optCd1; 
	private String optCd2; 
	private String itemPrice; 	
	private String shipCompCd;
	private String invoiceNo;
	private String brandList;
	private String supplyCompList;
	private String delvLocClsf;
	private String siteCd;
	private String mallGb;
	private String orderNm;
	private String orderPhnno;
	private String search;
	private String condition;			// 키워드 검색
	private String delvLocCd;
	private String soldoutYn;
	private String termGb;
	private String stDate;
	private String edDate;
	private String stDate2;
	private String edDate2;
	private String stDate3;
	private String edDate3;
	private String ordDt;       	// 주문일시
	private String payDt;       	// 결제일시
	private String extmallId;   	// 외부몰
	private String optCd;       	// 옵션 
	private String ordExchGb; 	// 주문교환 
	private String siteNm;
	private String delvGb;
	private String delvGbNm;         // 지시구분명
	private String sendYn;           // 전송여부
	private String ordNm;            // 주문자명
	private String ordPhnno;         // 주문자휴대전화번호
	private String ordTelno;         // 주문자전화번호
	private String ordEmail;         // 주문자이메일
	private String extmallOrderId;
	private String delvAssignStat;
	private String mallNm;
	private String ordExchNm;
	private String extmallNm;
	private String useGb;
	private String formalGb; 
	private String delvArGb;
	private String vendorId;
	private String rejectReason;
	private String goodsGb;
	private String supplyCompNm;
	private String agentOrderId;
	private String productCode;
	private String shotDelvYn;    // 총알배송여부 
	private String pgGb;
	private String payMeans;
	private String bankCd;
	private String accountNm;
	private String accountNo;
	private String invcTracking;
	private String orgInvoiceNo;
	private String soldoutMemo;
	private String soldoutRegNo;
	
	
	private Integer ordDtlNo;
	private Integer ordNo;
	private Integer custNo;
	private Integer custDelvAddrSq;
	private Integer delvBanGoodsSq;
	private Integer productNo;
	private Integer delvAssignSq;
	private Integer delvAssignHstSq;
	
	private int delvDelayDays;
	private int ordQty; 		// 주문수량
	private int currStockQty; 	// 현재고
	private int baseStockQty; 	// 안전재고
	private int ordAmt; 		// 주문금액
	private int ordDtlQty;
	private int locQty;
	private int goodsLocSetCnt;
	private int goodsLocCnt;
	private int saleQty;
	private int itemQty; 
	private int currPrice;
	private int saleAmt;
	private int realOrdAmt;
	private int stockQty;
	
	private Double delvFeeRate;
	
	private String[] conditions = null;
	
	
	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
	private String[] multiOrdDtlStat = null;
	
	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
	private String[] multiBrand;
	
	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
	private String[] multiSupplyCompCd;
	
	private String pageingYn;

	// Pagination
	private int startRow;
	private int endRow;
	
	private TscPageRequest pageable;
	private int pageNo = 1;
	private int pageSize = 50;
	private int pageUnit = 10;
	
	private int exchangeDelvFailSq;
	private int ordChgSq;
	private String delvCnclYn;
	private String delvCnclYnNm;
	private int cnclRtnQty;
	private String delvFailReason;
	private String delvFeeCd;
	private String delvFeeCdGrp;
	
	
	// Masking

	public String getMaskingOrdNm() {
		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.name(this.ordNm) : this.ordNm;

	}

	public String getMaskingRecipNm() {
		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.name(this.recipNm) : this.recipNm;

	}

	public String getMaskingOrdPhnno() {
		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.phoneNo(this.ordPhnno) : this.ordPhnno;
	}

	public String getMaskingRecipDtlAddr() {
		return TscSession.getAttribute("maskingYn").equals("Y") ? MaskingUtils.address(this.recipDtlAddr) : this.recipDtlAddr;
	}

	
	
	
}
