Update Question and Survey to support multilingual functionnality and Make language optional in URL

This commit is contained in:
Reginald Cherenfant Jasmin
2023-08-25 08:55:11 -04:00
parent 22261f42ca
commit 47b0c7b202
16 changed files with 321 additions and 134 deletions

View File

@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace DamageAssesment.Api.Surveys.Db
{
@ -6,11 +7,6 @@ namespace DamageAssesment.Api.Surveys.Db
{
[Key]
public int Id { get; set; }
[StringLength(100)]
[Required]
public string Title { get; set; }
//[StringLength(1000)]
//public string Description { get; set; }
@ -20,9 +16,11 @@ namespace DamageAssesment.Api.Surveys.Db
public DateTime? EndDate { get; set; }
//public DateTime CreatedDate { get; set; }
//[StringLength(6)]
//public string EmployeeID { get; set; }
public DateTime CreatedDate { get; set; } = DateTime.Now;
/*
[StringLength(10)]
[ForeignKey("Employee")]
public string EmployeeId { get; set; }
*/
}
}

View File

@ -0,0 +1,23 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
namespace DamageAssesment.Api.Surveys.Db
{
public class SurveyTranslation
{
[Key]
public int Id { get; set; }
[ForeignKey("Survey")]
public int SurveyId { get; set; }
[StringLength(200)]
[Required]
public string Title { get; set; }
public string Language { get; set; }
}
}

View File

@ -9,6 +9,6 @@ namespace DamageAssesment.Api.Surveys.Db
}
public DbSet<Db.Survey> Surveys { get; set; }
public DbSet<Db.SurveyTranslation> SurveysTranslation { get; set; }
}
}