public async Task <ResponseTOCContractDTO> GenerateDocumentTOC(InvestorInfo investorInfo)
        {
            if (investorInfo == null)
            {
                throw new ArgumentNullException(nameof(investorInfo));
            }

            GeneratePDF generatePDF = new GeneratePDF();

            string newDocumentFileName = generatePDF.GenerateInvestorDocument(investorInfo);

            ResponseTOCContractDTO response = new ResponseTOCContractDTO();

            if (!string.IsNullOrWhiteSpace(newDocumentFileName))
            {
                ContractInvestor contractInvestor = new ContractInvestor()
                {
                    FileName  = newDocumentFileName,
                    Email     = investorInfo.Email,
                    FullName  = string.Concat(investorInfo.FirstName, " ", investorInfo.LastName),
                    DocNumber = investorInfo.DocumentNumber
                };

                response = await _tocLogic.CreateContract(contractInvestor);
            }

            return(response);
        }
Exemplo n.º 2
0
        public IActionResult GenerateDocumentKeyNUA(ContractInfo contractInfo)
        {
            if (contractInfo == null)
            {
                throw new ArgumentNullException(nameof(contractInfo));
            }

            GeneratePDF generatePDF = new GeneratePDF();

            string newDocumentFileName = generatePDF.GenerateInvestorDocument(contractInfo);

            if (string.IsNullOrWhiteSpace(newDocumentFileName))
            {
                return(BadRequest("Un error ocurrió al crear el archivo."));
            }

            return(Ok(newDocumentFileName));
        }