package com.ruoyi.ss.riskInfo.service.impl;

import com.ruoyi.ss.riskInfo.domain.RiskInfo;
import com.ruoyi.ss.riskInfo.domain.dto.RiskInfoSubmitDTO;
import com.ruoyi.ss.riskInfo.domain.enums.RiskInfoStatus;
import com.ruoyi.ss.riskInfo.service.RiskInfoConverter;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * @author wjh
 * 2024/11/25
 */
@Service
public class RiskInfoConverterImpl implements RiskInfoConverter {
    @Override
    public RiskInfo toPoByAppCreate(RiskInfoSubmitDTO dto) {
        if (dto == null) {
            return null;
        }
        RiskInfo po = new RiskInfo();
        po.setStatus(RiskInfoStatus.WAIT_SUBMIT.getStatus());
        po.setRiskId(dto.getRiskId());
        po.setIdCardFront(dto.getIdCardFront());
        po.setIdCardBack(dto.getIdCardBack());
        po.setIdCardHand(dto.getIdCardHand());
        po.setVideo(dto.getVideo());
        po.setDutyVideo(dto.getDutyVideo());
        po.setBusinessLicence(dto.getBusinessLicence());
        return po;
    }

    @Override
    public RiskInfo toPoByAppUpdate(RiskInfoSubmitDTO dto) {
        if (dto == null) {
            return null;
        }
        RiskInfo po = new RiskInfo();
        po.setInfoId(dto.getInfoId());
        po.setIdCardFront(dto.getIdCardFront());
        po.setIdCardBack(dto.getIdCardBack());
        po.setIdCardHand(dto.getIdCardHand());
        po.setVideo(dto.getVideo());
        po.setDutyVideo(dto.getDutyVideo());
        po.setBusinessLicence(dto.getBusinessLicence());
        return po;
    }
}
