Example #1
0
        public async Task <HfeaForm> Create(CreateHfeaFormInput input)
        {
            var publisher = await SessionService.GetPublisherAsync();

            var hfeaClassification = input.HfeaClassification.MapTo <HfeaClassification>();

            var hfeaForm = HfeaForm.Create(
                name: input.Name,
                versionNumber: input.VersionNumber,
                formCode: input.FormCode,
                shortDescription: input.ShortDescription,
                publisher: publisher,
                hfeaFormFile: input.FormFile,
                hfeaClassification: hfeaClassification,
                hfeaDescriptionVideo: input.DescriptionVideo,
                priority: input.Priority,
                useDefaultPriority: input.UseDefaultPriority);

            await _hfeaRepository.CreateItemAsync(hfeaForm);

            return(hfeaForm);
        }
 public void Validate(CreateHfeaFormInput input)
 {
     // Complex logic to make sure we are good - since we are not returning true false in case of issues throw on of the exceptions like:
     // throw new ResponsibleSystemUserFriendlyException($"Clinic with given HFEA centre reference number already exists.");
 }