seed data changes for answers and new survey

This commit is contained in:
uppuv 2023-10-05 15:42:41 -04:00
parent bac2eef4fb
commit 2aca01c8b4
4 changed files with 25 additions and 12 deletions

View File

@ -191,8 +191,8 @@ namespace DamageAssesment.Api.Answers.Providers
{
if (!answerDbContext.Answers.Any())
{
answerDbContext.Answers.Add(new Db.Answer() { AnswerText = "Yes", Comment = "Comment test 4", QuestionId = 1, SurveyResponseId = 1 });
answerDbContext.Answers.Add(new Db.Answer() { AnswerText = "No", Comment = "Comment test 5", QuestionId = 2, SurveyResponseId = 1 });
answerDbContext.Answers.Add(new Db.Answer() { Id = 1, AnswerText = "Yes", Comment = "Comment test 4", QuestionId = 1, SurveyResponseId = 1 });
answerDbContext.Answers.Add(new Db.Answer() { Id = 2, AnswerText = "No", Comment = "Comment test 5", QuestionId = 2, SurveyResponseId = 1 });
//answerDbContext.Answers.Add(new Db.Answer() { Id = 3, AnswerText = "No", Comment = "No Comment", QuestionId = 3, SurveyResponseId = 1 });
//answerDbContext.Answers.Add(new Db.Answer() { Id = 4, AnswerText = "Yes", Comment = "No Comment", QuestionId = 1, SurveyResponseId = 2 });
//answerDbContext.Answers.Add(new Db.Answer() { Id = 5, AnswerText = "No", Comment = "No Comment", QuestionId = 2, SurveyResponseId = 2 });

View File

@ -29,20 +29,25 @@ namespace DamageAssesment.Api.Questions.Providers
{
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 1, QuestionText = "Can You Open ?", Language = "en" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 1, QuestionText = "Peux-tu ouvrir ?", Language = "fr" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 1, QuestionText = "Puedes abrir ?", Language = "es" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 2, QuestionText = "Are the grounds flodded ?", Language = "en" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 2, QuestionText = "Les terrains sont-ils inondés ?", Language = "fr" });
//questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { Id = 5, QuestionId = 3, QuestionText = "Is the access blocked by flooding ?", Language = "en" });
//questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { Id = 6, QuestionId = 3, QuestionText = "L'accès est-il bloqué par les inondations ?", Language = "fr" });
//questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { Id = 7, QuestionId = 1, QuestionText = "Puedes abrir ?", Language = "es" });
//questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { Id = 8, QuestionId = 2, QuestionText = "¿Están inundados los terrenos?", Language = "es" });
//questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { Id = 9, QuestionId = 3, QuestionText = "¿El acceso está bloqueado por inundaciones?", Language = "es" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 2, QuestionText = "¿Están inundados los terrenos?", Language = "es" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 3, QuestionText = "Is the access blocked by flooding ?", Language = "en" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 3, QuestionText = "L'accès est-il bloqué par les inondations ?", Language = "fr" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 3, QuestionText = "¿El acceso está bloqueado por inundaciones?", Language = "es" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 4, QuestionText = "Are the grounds flodded ?", Language = "en" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 4, QuestionText = "Les terrains sont-ils inondés ?", Language = "fr" });
questionDbContext.QuestionsTranslations.Add(new Db.QuestionsTranslation() { QuestionId = 4, QuestionText = "¿Están inundados los terrenos?", Language = "es" });
questionDbContext.SaveChanges();
}
if (!questionDbContext.Questions.Any())
{
questionDbContext.Questions.Add(new Db.Question() { QuestionTypeId = 2, SurveyId = 1, QuestionNumber = 1, IsRequired = true, Comment = false, Key = true, CategoryId=1 });
questionDbContext.Questions.Add(new Db.Question() { QuestionTypeId = 1, SurveyId = 1, QuestionNumber = 1, IsRequired = true, Comment = false, Key = true, CategoryId=1 });
questionDbContext.Questions.Add(new Db.Question() { QuestionTypeId = 1, SurveyId = 1, QuestionNumber = 2, IsRequired = false, Comment = true, Key = false, CategoryId = 1 });
//questionDbContext.Questions.Add(new Db.Question() { Id = 3, QuestionTypeId = 1, SurveyId = 1, QuestionNumber = 3, IsRequired = true, Comment = false, Key = true, CategoryId = 2 });
questionDbContext.Questions.Add(new Db.Question() { QuestionTypeId = 1, SurveyId = 2, QuestionNumber = 1, IsRequired = true, Comment = false, Key = true, CategoryId = 1 });
questionDbContext.Questions.Add(new Db.Question() { QuestionTypeId = 1, SurveyId = 2, QuestionNumber = 2, IsRequired = false, Comment = true, Key = false, CategoryId = 1 });
//questionDbContext.Questions.Add(new Db.Question() { QuestionTypeId = 1, SurveyId = 2, QuestionNumber = 3, IsRequired = true, Comment = false, Key = true, CategoryId = 2 });
questionDbContext.SaveChanges();
}
if (!questionDbContext.QuestionTypes.Any())

View File

@ -7,7 +7,15 @@
},
"AllowedHosts": "*",
//"EndPointSettings": {
// "AnswerUrlBase": "http://localhost:5200",
// "LocationUrlBase": "http://localhost:5213",
// "RegionUrlBase": "http://localhost:5211",
// "QuestionUrlBase": "http://localhost:5133",
// "EmployeeUrlBase": "http://localhost:5135",
// "AttachmentUrlBase": "http://localhost:5243",
// "SurveyUrlBase": "http://localhost:5009"
//},
"EndPointSettings": {
"AnswerUrlBase": "http://damageassesment.api.answers:80",
"LocationUrlBase": "http://damageassesment.api.locations:80",

View File

@ -26,7 +26,7 @@ namespace DamageAssesment.Api.Surveys.Providers
if (!surveyDbContext.Surveys.Any())
{
surveyDbContext.Surveys.Add(new Db.Survey {IsEnabled = true, StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(90), CreatedDate = DateTime.Now });
surveyDbContext.Surveys.Add(new Db.Survey { IsEnabled = false, StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(90), CreatedDate = DateTime.Now });
surveyDbContext.Surveys.Add(new Db.Survey { IsEnabled = true, StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(90), CreatedDate = DateTime.Now });
//surveyDbContext.Surveys.Add(new Db.Survey { Id = 2, IsEnabled = true, StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(90), CreatedDate = DateTime.Now });
//surveyDbContext.Surveys.Add(new Db.Survey { Id = 3, IsEnabled = true, StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(90), CreatedDate = DateTime.Now });
surveyDbContext.SaveChangesAsync();