public async Task <JsonResult> PostGenerateBatchIcc(GenerateIccInputModel generateIccInputModel) { var iccBatch = await _IccService.GenerateBatch(generateIccInputModel.UserId); _DbContext.SaveAndCommit(); return(new JsonResult(new { ok = true, status = 200, length = _Configuration.GetSection("IccConfig:Code:Length").Value, iccBatch = iccBatch })); }
public async Task <FileContentResult> PostGenerateCsv(GenerateIccInputModel generateIccInputModel) { var iccBatch = await _IccService.GenerateBatch(generateIccInputModel.UserId); _DbContext.SaveAndCommit(); var content = GenerateCsv(iccBatch.Batch); return(new FileContentResult(content, "text/csv") { FileDownloadName = $"ICC_Batch#{iccBatch.Id}.csv" }); }
public async Task <JsonResult> PostGenerateIcc(GenerateIccInputModel generateIccInputModel) { var infectionConfirmationCodeEntity = await _IccService.GenerateIcc(generateIccInputModel.UserId, null !); _DbContext.SaveAndCommit(); return(new JsonResult(new { ok = true, status = 200, icc = infectionConfirmationCodeEntity, length = _Configuration.GetSection("IccConfig:Code:Length").Value })); }