Exemple #1
0
        public async Task <ActionResult <CivilAppearanceDetail> > GetCivilAppearanceDetails(string fileId, string appearanceId)
        {
            if (User.IsVcUser())
            {
                if (!await _vcCivilFileAccessHandler.HasCivilFileAccess(User, fileId))
                {
                    return(Forbid());
                }

                var civilFileDetailResponse = await _civilFilesService.FileIdAsync(fileId);

                if (civilFileDetailResponse?.PhysicalFileId == null)
                {
                    throw new NotFoundException("Couldn't find civil file with this id.");
                }
                if (civilFileDetailResponse.SealedYN == "Y")
                {
                    return(Forbid());
                }
            }

            var civilAppearanceDetail = await _civilFilesService.DetailedAppearanceAsync(fileId, appearanceId);

            if (civilAppearanceDetail == null)
            {
                throw new NotFoundException("Couldn't find appearance detail with the provided file id and appearance id.");
            }
            return(Ok(civilAppearanceDetail));
        }
        public async Task <ActionResult <CivilAppearanceDetail> > GetCivilAppearanceDetails(string fileId, string appearanceId)
        {
            var civilAppearanceDetail = await _civilFilesService.DetailedAppearanceAsync(fileId, appearanceId);

            if (civilAppearanceDetail == null)
            {
                throw new NotFoundException("Couldn't find appearance detail with the provided file id and appearance id.");
            }
            return(Ok(civilAppearanceDetail));
        }