package com.trade.service.contract.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.trade.common.core.domain.BizBaseEntity;
import com.trade.service.contract.util.esign.entity.ESignOrganAccount;
import com.trade.service.contract.util.esign.entity.ESignPersonAccount;
import lombok.*;

@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName("e_sign_account")
public class ESignAccount extends BizBaseEntity {

    private static final long serialVersionUID = 7419273670164417904L;
    private String name;
    private String idType;
    private String idNo;
    private String phone;
    private String email;
    private String eAccountId;

    public ESignAccount(ESignPersonAccount personAccount, String personAccountId){
        setName(personAccount.getName());
        setIdType(personAccount.getIdType());
        setIdNo(personAccount.getIdNumber());
        setPhone(personAccount.getMobile());
        setEmail(personAccount.getEmail());
        setEAccountId(personAccountId);
    }

    public ESignAccount(ESignOrganAccount organAccount, String organAccountId) {
        setName(organAccount.getName());
        setIdType(organAccount.getIdType());
        setIdNo(organAccount.getIdNumber());
        setEAccountId(organAccountId);
    }
}
