public async Task <IActionResult> GetCivilCourtSummaryReport(string appearanceId, string fileNameAndExtension, string vcCivilFileId = "") { if (User.IsVcUser()) { if (!await _vcCivilFileAccessHandler.HasCivilFileAccess(User, vcCivilFileId)) { return(Forbid()); } var civilFileDetailResponse = await _civilFilesService.FileIdAsync(vcCivilFileId); if (civilFileDetailResponse?.PhysicalFileId == null) { throw new NotFoundException("Couldn't find civil file with this id."); } if (civilFileDetailResponse.SealedYN == "Y" || civilFileDetailResponse.Appearances.ApprDetail.All(ad => ad.AppearanceId != appearanceId)) { return(Forbid()); } } var justinReportResponse = await _civilFilesService.CourtSummaryReportAsync(appearanceId, JustinReportName.CEISR035); if (justinReportResponse.ReportContent == null || justinReportResponse.ReportContent.Length <= 0) { throw new NotFoundException("Couldn't find CSR with this appearance id."); } return(BuildPdfFileResponse(justinReportResponse.ReportContent)); }
public async Task <IActionResult> GetCivilCourtSummaryReport(string appearanceId, string fileNameAndExtension, string vcCivilFileId = "") { if (User.IsVcUser()) { //Disable Court Summary Reports. return(Forbid()); } var justinReportResponse = await _civilFilesService.CourtSummaryReportAsync(appearanceId, JustinReportName.CEISR035); if (justinReportResponse.ReportContent == null || justinReportResponse.ReportContent.Length <= 0) { throw new NotFoundException("Couldn't find CSR with this appearance id."); } return(BuildPdfFileResponse(justinReportResponse.ReportContent)); }