Exemplo n.º 1
0
        public async Task <(decimal submissionObjectId, Dictionary <string, List <string> > errors)> CreateReportAsync(FileUploadDto upload)
        {
            var(errors, submission) = await ValidateAndLogReportErrorAsync(upload);

            if (errors.Count > 0)
            {
                return(0, errors);
            }

            var submissionEntity = await _submissionRepo.CreateSubmissionObjectAsync(submission);

            _unitOfWork.Commit();

            return(submissionEntity.SubmissionObjectId, errors);
        }
Exemplo n.º 2
0
        public async Task <(decimal submissionObjectId, Dictionary <string, List <string> > errors)> CreateReportAsync(FileUploadDto upload)
        {
            var instance = Guid.NewGuid();

            _logger.LogInformation($"[Api] {instance} Creating report started.");

            var(errors, submission) = await ValidateAndLogReportErrorAsync(upload);

            if (errors.Count > 0)
            {
                _logger.LogInformation($"[Api] {instance} Creating report finished with errors.");
                return(0, errors);
            }

            var submissionEntity = await _submissionRepo.CreateSubmissionObjectAsync(submission);

            _unitOfWork.Commit();

            _logger.LogInformation($"[Api] {instance} Creating report finished - submission #: {submissionEntity.SubmissionObjectId}");

            return(submissionEntity.SubmissionObjectId, errors);
        }