Exemple #1
0
        public async Task AddFormRecord(InputForm inputForm)
        {
            var formId = await _formRepository.GetNextFormId();

            var questionId = await _formRepository.GetNextQuestionId();

            var form = new FormApi()
            {
                FormId            = formId,
                FirstName         = inputForm.FirstName,
                Surname           = inputForm.Surname,
                IsSigned          = inputForm.IsSigned,
                DateSigned        = inputForm.DateSigned,
                CovidQuestionsApi = new CovidQuestionsApi()
                {
                    QuestionId      = questionId,
                    FormId          = formId,
                    CloseContact    = inputForm.CloseContact,
                    SymptomsInd     = inputForm.SymptomsInd,
                    DiagnosedInd    = inputForm.DiagnosedInd,
                    SelfIsolatedInd = inputForm.SelfIsolatedInd,
                    CocoonInd       = inputForm.CocoonInd,
                    AtRiskInd       = inputForm.AtRiskInd,
                },
                SectionCode = inputForm.ScoutSection != null ? inputForm.ScoutSection : "SS",
            };

            await _formRepository.AddFormRecord(form);
        }