package com.zcloud.zcGbsServicer.command.convertor;

import com.zcloud.zcGbsServicer.dto.clientobject.FireBrigadeMemberCO;
import com.zcloud.zcGbsServicer.persistence.dataobject.FireBrigadeUserDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Mapper(componentModel = "spring")
public interface FireBrigadeMemberCoConvertor {

    @Mapping(target = "fireBrigadeId", ignore = true)
    @Mapping(source = "fireBrigadeId", target = "fireBrigadeBizId")
    @Mapping(source = "userName", target = "name")
    @Mapping(source = "dutyName", target = "duty")
    @Mapping(source = "orgName", target = "org")
    List<FireBrigadeMemberCO> converDOsToCOs(List<FireBrigadeUserDO> fireBrigadeUserDOs);

    @Mapping(target = "fireBrigadeId", ignore = true)
    @Mapping(source = "fireBrigadeId", target = "fireBrigadeBizId")
    @Mapping(source = "userName", target = "name")
    @Mapping(source = "dutyName", target = "duty")
    @Mapping(source = "orgName", target = "org")
    FireBrigadeMemberCO converDOToCO(FireBrigadeUserDO fireBrigadeUserDO);
}
