Exemple #1
0
        private static async Task <string> StringifySubmission(FormEntry formEntry)
        {
            var questionnaire = QuestionnaireExtensions.QuestionnaireValueMapper(formEntry, false);

            // the data snapshot and PDF will record EST...the database will still record the archive record as UTC
            questionnaire.SubmissionDate = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(formEntry.SubmissionDate.GetValueOrDefault(), "Eastern Standard Time");
            var stringPayload = await Task.Run(() => JsonSerializer.Serialize(questionnaire, new JsonSerializerOptions {
                PropertyNamingPolicy = JsonNamingPolicy.CamelCase
            }));

            return(stringPayload);
        }
        public virtual async Task <IActionResult> GetFormById(Guid id)
        {
            var entry = await _formService.GetFormEntryAsync(_accessLevel, id);

            return(Ok(QuestionnaireExtensions.QuestionnaireValueMapper(entry, true)));
        }