package com.jeequan.jeepay.converter;

import com.jeequan.jeepay.core.entity.IsvInfo;
import com.jeequan.jeepay.core.entity.SysUser;
import com.jeequan.jeepay.core.model.applyment.ApplymentSignInfo;
import com.jeequan.jeepay.core.model.applyment.PaywayFee;
import com.jeequan.jeepay.db.entity.IsvInfoEntity;
import com.jeequan.jeepay.db.entity.SysUserEntity;
import org.mapstruct.*;

import java.util.Map;

@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface BaseConverter {

    @BeanMapping(builder = @Builder(disableBuilder = true))
    SysUser toModel(SysUserEntity sysUserEntity);

    @BeanMapping(builder = @Builder(disableBuilder = true))
    SysUserEntity toDbEntity(SysUser model);

    @BeanMapping(builder = @Builder(disableBuilder = true))
    IsvInfo toModel(IsvInfoEntity entity);
    @BeanMapping(builder = @Builder(disableBuilder = true))
    IsvInfoEntity toDbEntity(IsvInfo model);

    @BeanMapping(builder = @Builder(disableBuilder = true))
    void cp(ApplymentSignInfo src, @MappingTarget ApplymentSignInfo dist);

    @BeanMapping(builder = @Builder(disableBuilder = true))
    PaywayFee cp(PaywayFee paywayFee);

    @BeanMapping(builder = @Builder(disableBuilder = true))
    Map<String, PaywayFee> newPaywayFeeMap(Map<String, PaywayFee> paywayFee);
}
