Skip to content

Commit

Permalink
Fix the report versioning of the template (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
pallvigrover authored Sep 17, 2024
1 parent f76f2d6 commit dffdc79
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ public string ReportTemplateVersionRequestUri
<attribute name="statuscode" />
<attribute name="statecode" />
<order attribute="ofm_version" descending="true" />
<filter>
<condition attribute="statecode" operator="eq" value="0" />
</filter>
</entity>
</fetch>
""";
Expand Down Expand Up @@ -807,10 +810,10 @@ public async Task<bool> CreateBusinessRule(Guid? _sectionId, ID365AppUserService

deserializedDataBR?.ForEach(br =>
{
var parentQuestionId = deserializedQuestiondata.FirstOrDefault(q => q.ofm_source_question_id == br.brSourceQuestion && q.surveyStatecode == (int)ofm_survey_statecode.Active)?.ofm_questionid;
var trueQuestionId = deserializedQuestiondata.FirstOrDefault(q => q.ofm_source_question_id == br.TrueSourcequestionIdentifier && q.surveyStatecode == (int)ofm_survey_statecode.Active)?.ofm_questionid;
var falseQuestionId = deserializedQuestiondata.FirstOrDefault(q => q.ofm_source_question_id == br.FalseSourcequestionIdentifier && q.surveyStatecode == (int)ofm_survey_statecode.Active)?.ofm_questionid;
var hasResponseQuestionId = deserializedQuestiondata.FirstOrDefault(q => q.ofm_source_question_id == br.childSourcequestionIdentifier && q.surveyStatecode == (int)ofm_survey_statecode.Active)?.ofm_questionid;
var parentQuestionId = deserializedQuestiondata.FirstOrDefault(q => q.ofm_source_question_id == br.brSourceQuestion && q.surveyStatecode == (int)ofm_survey_statecode.Active && q.surveyVersion == latestVersion.ToString())?.ofm_questionid;
var trueQuestionId = deserializedQuestiondata.FirstOrDefault(q => q.ofm_source_question_id == br.TrueSourcequestionIdentifier && q.surveyStatecode == (int)ofm_survey_statecode.Active && q.surveyVersion == latestVersion.ToString())?.ofm_questionid;
var falseQuestionId = deserializedQuestiondata.FirstOrDefault(q => q.ofm_source_question_id == br.FalseSourcequestionIdentifier && q.surveyStatecode == (int)ofm_survey_statecode.Active && q.surveyVersion == latestVersion.ToString())?.ofm_questionid;
var hasResponseQuestionId = deserializedQuestiondata.FirstOrDefault(q => q.ofm_source_question_id == br.childSourcequestionIdentifier && q.surveyStatecode == (int)ofm_survey_statecode.Active && q.surveyVersion == latestVersion.ToString())?.ofm_questionid;
requestsQuestionBRCreation.Add(new CreateRequest($"{entitySetNameQuestionBR}",
new JsonObject()
{
Expand Down

0 comments on commit dffdc79

Please sign in to comment.