public static string GetFormStatusFieldName(this EFosteringHomeVisitForm value) { switch (value) { case EFosteringHomeVisitForm.ChildrenLivingAwayFromYourHome: return("childrenlivingawayfromyourhomestatus"); case EFosteringHomeVisitForm.LanguageSpokenInYourHome: return("languagespokeninyourhomestatus"); case EFosteringHomeVisitForm.TellUsAboutYourInterestInFostering: return("tellusaboutyourinterestinfosteringstatus"); case EFosteringHomeVisitForm.TellUsAboutYourself: return("tellusaboutyourselfstatus"); case EFosteringHomeVisitForm.YourEmploymentDetails: return("youremploymentdetailsstatus"); case EFosteringHomeVisitForm.YourFosteringHistory: return("yourfosteringhistorystatus"); case EFosteringHomeVisitForm.YourHealth: return("yourhealthstatus"); case EFosteringHomeVisitForm.YourHousehold: return("yourhouseholdstatus"); case EFosteringHomeVisitForm.YourPartnership: return("yourpartnershipstatus"); default: throw new Exception("EFosteringFormExtensions: GetFormStatusFieldName - home visit form status field name missing"); } }
public async Task UpdateStatus(string caseId, ETaskStatus status, EFosteringHomeVisitForm form) { var formStatusFieldName = form.GetFormStatusFieldName(); var formFields = new FormFieldBuilder() .AddField(formStatusFieldName, status.GetTaskStatus()); var updateModel = new IntegrationFormFieldsUpdateModel { IntegrationFormName = _integrationFormName, CaseReference = caseId, IntegrationFormFields = formFields.Build() }; var response = await _verintServiceGateway .UpdateCaseIntegrationFormField(updateModel); if (response.StatusCode != HttpStatusCode.OK) { throw new Exception("Passive update-status failure"); } }
public void GetFormStatusFieldName_ShouldReturnCorrectFieldNames(string expected, EFosteringHomeVisitForm fosteringHomeVisitForm) { Assert.Equal(expected, fosteringHomeVisitForm.GetFormStatusFieldName()); }