diff --git a/Database/Models/Cars.cs b/Database/Models/Cars.cs new file mode 100644 index 0000000..fb12387 --- /dev/null +++ b/Database/Models/Cars.cs @@ -0,0 +1,19 @@ +using System.ComponentModel.DataAnnotations; + +namespace Renis.Database.Models; + +public class Cars +{ + [Key] + public long Id { get; set; } + [Required] + public string Number { get; set; } = null!; + [Required] + Polis Polis { get; set; } = null!; + [Required] + long PolisId { get; set; } + [Required] + User Resp { get; set; } = null!; + [Required] + long RespId { get; set; } +} \ No newline at end of file diff --git a/Database/Models/Polis.cs b/Database/Models/Polis.cs new file mode 100644 index 0000000..442227c --- /dev/null +++ b/Database/Models/Polis.cs @@ -0,0 +1,11 @@ +using System.ComponentModel.DataAnnotations; + +namespace Renis.Database.Models; + +public class Polis +{ + [Key] + public long Id { get; set; } + [Required] + public string Number { get; set; } = null!; +} \ No newline at end of file diff --git a/Database/Models/User.cs b/Database/Models/User.cs new file mode 100644 index 0000000..328271c --- /dev/null +++ b/Database/Models/User.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; + +namespace Renis.Database.Models; + +public class User +{ + [Key] + public long Id { get; set; } + [Required] + public string Name { get; set; } = null!; + [Phone] + [Required] + public string Phone { get; set; } = null!; + [Required] + public string Password { get; set; } = null!; +} \ No newline at end of file diff --git a/Database/Models/UserPolis.cs b/Database/Models/UserPolis.cs new file mode 100644 index 0000000..0fda2e7 --- /dev/null +++ b/Database/Models/UserPolis.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; + +namespace Renis.Database.Models; + +public class UserPolis +{ + [Key] + public long Id { get; set; } + [Required] + public long UserId { get; set; } + public User User { get; set; } = null!; + [Required] + public long PolisId { get; set; } + public Polis Polis { get; set; } = null!; + public bool IsOwner { get; set; } +} \ No newline at end of file