package com.zt.plat.module.erp.api;

import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.erp.api.dto.ErpElectronicInvoiceReversalReqDTO;
import com.zt.plat.module.erp.api.dto.ErpElectronicInvoiceSubmitReqDTO;
import com.zt.plat.module.erp.api.dto.ErpInvoiceticketSubmitReqDTO;
import com.zt.plat.module.erp.api.dto.ErpInvoiceticketSubmitRespDTO;
import com.zt.plat.module.erp.service.erp.ErpInvoiceticketService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

import static com.zt.plat.framework.common.pojo.CommonResult.success;

@RestController
@Validated
@Slf4j
public class InvoiceticketImpl implements InvoiceticketApi {
    @Resource
    private ErpInvoiceticketService erpInvoiceticketService;

    @Override
    public CommonResult<ErpInvoiceticketSubmitRespDTO> submitDataToErp(ErpInvoiceticketSubmitReqDTO reqDTO) {
        return success(erpInvoiceticketService.sbumitToErp020(reqDTO));
    }

    @Override
    public CommonResult<Map<String, String>> submitDataToErp098(Map<String, Object> reqDTO) {
        return success(erpInvoiceticketService.sbumitToErp098(reqDTO));
    }

    @Override
    public CommonResult<Map<String, String>> submitDataToErp096(ErpElectronicInvoiceSubmitReqDTO reqDTO) {
        return success(erpInvoiceticketService.sbumitToErp096(reqDTO));
    }

    @Override
    public CommonResult<Map<String, String>> submitDataToErp097(ErpElectronicInvoiceReversalReqDTO reqDTO) {
        return success(erpInvoiceticketService.sbumitToErp097(reqDTO));
    }
}
