package com.zcloud.primeport.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.primeport.api.VehicleAuditServiceI;
import com.zcloud.primeport.command.VehicleAuditAddExe;
import com.zcloud.primeport.command.VehicleAuditRemoveExe;
import com.zcloud.primeport.command.VehicleAuditUpdateExe;
import com.zcloud.primeport.command.query.VehicleAuditQueryExe;
import com.zcloud.primeport.dto.VehicleAuditAddCmd;
import com.zcloud.primeport.dto.VehicleAuditPageQry;
import com.zcloud.primeport.dto.VehicleAuditUpdateCmd;
import com.zcloud.primeport.dto.clientobject.VehicleAuditCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author makejava
 * @Date 2026-03-05 11:33:25
 */
@Service
@AllArgsConstructor
public class VehicleAuditServiceImpl implements VehicleAuditServiceI {
    private final VehicleAuditAddExe vehicleAuditAddExe;
    private final VehicleAuditUpdateExe vehicleAuditUpdateExe;
    private final VehicleAuditRemoveExe vehicleAuditRemoveExe;
    private final VehicleAuditQueryExe vehicleAuditQueryExe;

    @Override
    public PageResponse<VehicleAuditCO> listPage(VehicleAuditPageQry qry) {

        return vehicleAuditQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(VehicleAuditAddCmd cmd) {

        vehicleAuditAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(VehicleAuditUpdateCmd vehicleAuditUpdateCmd) {
        vehicleAuditUpdateExe.execute(vehicleAuditUpdateCmd);
    }

    @Override
    public void remove(Long id) {
        vehicleAuditRemoveExe.execute(id);
    }

    @Override
    public void removeBatch(Long[] ids) {
        vehicleAuditRemoveExe.execute(ids);
    }

    @Override
    public PageResponse<VehicleAuditCO> carApprovalLogByvehicleApplyIdList(VehicleAuditPageQry qry) {
        return vehicleAuditQueryExe.carApprovalLogByvehicleApplyIdList(qry);
    }

    @Override
    public void audit(VehicleAuditUpdateCmd cmd) {
        vehicleAuditUpdateExe.audit(cmd);
    }

    @Override
    public VehicleAuditCO getInfoById(Long id) {
        return vehicleAuditQueryExe.getInfoById(id);
    }
}

