Пример #1
0
        public async Task <DeleteStepVariableResponse> Delete(DeleteStepVariableRequest request)
        {
            if (!await batchRepository.DoesBatchExist(request.BatchId))
            {
                throw Err.BatchNotFound(request.BatchId);
            }

            var step = await stepRepository.Get(request.BatchId, request.StepName);

            if (step == null)
            {
                throw Err.StepNotFound(request.StepName);
            }

            var existingStepVariable =
                await stepRepository.GetStepVariable(step.Id, request.VariableName);

            if (existingStepVariable == null)
            {
                throw Err.StepVariableNotFound(request.VariableName);
            }

            await stepRepository.DeleteStepVariable(existingStepVariable.Id);

            return(new DeleteStepVariableResponse());
        }