diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5783547
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,14 @@
+.vs/
+.vscode/
+bin/
+obj/
+Properties/
+Scripts/
+Tests/TicketManager.Tests/UnitTests/ControllersTests/ControllerTests.cs
+Tests/TicketManager.Tests/UnitTests/ControllersTests/SeedDb.cs
+Tests/TicketManager.Tests/bin/
+Tests/TicketManager.Tests/obj/
+client/node_modules/
+client/src/authentication/config.json
+client/src/pages/TestPage.tsx
+
\ No newline at end of file
diff --git a/Migrations/20200312204707_Migration1.Designer.cs b/Migrations/20200312204707_Migration1.Designer.cs
new file mode 100644
index 0000000..1ca374e
--- /dev/null
+++ b/Migrations/20200312204707_Migration1.Designer.cs
@@ -0,0 +1,337 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using TicketManager.Data;
+
+namespace TicketManager.Migrations
+{
+ [DbContext(typeof(AppDbContext))]
+ [Migration("20200312204707_Migration1")]
+ partial class Migration1
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "3.1.1");
+
+ modelBuilder.Entity("TicketManager.Models.Activity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ActivityType")
+ .HasColumnType("INTEGER");
+
+ b.Property("AppUserId")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("ProjectId")
+ .HasColumnType("INTEGER");
+
+ b.Property("TaskId")
+ .HasColumnType("INTEGER");
+
+ b.Property("TicketId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UpdateDate")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AppUserId");
+
+ b.HasIndex("ProjectId");
+
+ b.HasIndex("TicketId");
+
+ b.ToTable("Activities");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.AppUser", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreationDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Email")
+ .HasColumnType("TEXT");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasMaxLength(50);
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasMaxLength(50);
+
+ b.Property("Phone")
+ .HasColumnType("TEXT");
+
+ b.Property("Picture")
+ .HasColumnType("TEXT");
+
+ b.Property("Presentation")
+ .HasColumnType("TEXT")
+ .HasMaxLength(200);
+
+ b.HasKey("Id");
+
+ b.ToTable("AppUsers");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Assignment", b =>
+ {
+ b.Property("ProjectId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ProjectId", "UserId");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Assignments");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.File", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("AddedById")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("FileName")
+ .HasColumnType("TEXT");
+
+ b.Property("Format")
+ .HasColumnType("TEXT");
+
+ b.Property("Location")
+ .HasColumnType("TEXT");
+
+ b.Property("ProjectId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Size")
+ .HasColumnType("INTEGER");
+
+ b.Property("TicketId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UserId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AddedById");
+
+ b.HasIndex("ProjectId");
+
+ b.HasIndex("TicketId");
+
+ b.ToTable("Files");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Note", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("CreationDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("TicketId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Title")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TicketId");
+
+ b.ToTable("Notes");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Project", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("CreationDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT")
+ .HasMaxLength(200);
+
+ b.Property("EndingDate")
+ .HasColumnType("TEXT");
+
+ b.Property("ManagerId")
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .HasColumnType("INTEGER");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasMaxLength(50);
+
+ b.HasKey("Id");
+
+ b.HasIndex("ManagerId");
+
+ b.ToTable("Projects");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Ticket", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("AppUserId")
+ .HasColumnType("TEXT");
+
+ b.Property("Category")
+ .HasColumnType("INTEGER");
+
+ b.Property("CreationDate")
+ .HasColumnType("TEXT");
+
+ b.Property("CreatorId")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT")
+ .HasMaxLength(100);
+
+ b.Property("Difficulty")
+ .HasColumnType("INTEGER");
+
+ b.Property("EndingDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Impact")
+ .HasColumnType("INTEGER");
+
+ b.Property("ProjectId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Status")
+ .HasColumnType("INTEGER");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasMaxLength(100);
+
+ b.HasKey("Id");
+
+ b.HasIndex("AppUserId");
+
+ b.HasIndex("ProjectId");
+
+ b.ToTable("Tickets");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Activity", b =>
+ {
+ b.HasOne("TicketManager.Models.AppUser", null)
+ .WithMany("Activities")
+ .HasForeignKey("AppUserId");
+
+ b.HasOne("TicketManager.Models.Project", null)
+ .WithMany("Activities")
+ .HasForeignKey("ProjectId");
+
+ b.HasOne("TicketManager.Models.Ticket", null)
+ .WithMany("Activities")
+ .HasForeignKey("TicketId");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Assignment", b =>
+ {
+ b.HasOne("TicketManager.Models.Project", "Project")
+ .WithMany("Assignments")
+ .HasForeignKey("ProjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("TicketManager.Models.AppUser", "User")
+ .WithMany("Assignments")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("TicketManager.Models.File", b =>
+ {
+ b.HasOne("TicketManager.Models.AppUser", "AddedBy")
+ .WithMany()
+ .HasForeignKey("AddedById");
+
+ b.HasOne("TicketManager.Models.Project", null)
+ .WithMany("Files")
+ .HasForeignKey("ProjectId");
+
+ b.HasOne("TicketManager.Models.Ticket", null)
+ .WithMany("Files")
+ .HasForeignKey("TicketId");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Note", b =>
+ {
+ b.HasOne("TicketManager.Models.Ticket", "Ticket")
+ .WithMany("Notes")
+ .HasForeignKey("TicketId");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Project", b =>
+ {
+ b.HasOne("TicketManager.Models.AppUser", "Manager")
+ .WithMany()
+ .HasForeignKey("ManagerId");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Ticket", b =>
+ {
+ b.HasOne("TicketManager.Models.AppUser", null)
+ .WithMany("Tickets")
+ .HasForeignKey("AppUserId");
+
+ b.HasOne("TicketManager.Models.Project", "Project")
+ .WithMany("Tickets")
+ .HasForeignKey("ProjectId");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Migrations/20200312204707_Migration1.cs b/Migrations/20200312204707_Migration1.cs
new file mode 100644
index 0000000..216e2dd
--- /dev/null
+++ b/Migrations/20200312204707_Migration1.cs
@@ -0,0 +1,289 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+namespace TicketManager.Migrations
+{
+ public partial class Migration1 : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "AppUsers",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false),
+ FirstName = table.Column(maxLength: 50, nullable: false),
+ LastName = table.Column(maxLength: 50, nullable: false),
+ Presentation = table.Column(maxLength: 200, nullable: true),
+ Email = table.Column(nullable: true),
+ Phone = table.Column(nullable: true),
+ CreationDate = table.Column(nullable: false),
+ Picture = table.Column(nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AppUsers", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Projects",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Title = table.Column(maxLength: 50, nullable: false),
+ Description = table.Column(maxLength: 200, nullable: true),
+ CreationDate = table.Column(nullable: false),
+ EndingDate = table.Column(nullable: false),
+ Status = table.Column(nullable: false),
+ ManagerId = table.Column(nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Projects", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Projects_AppUsers_ManagerId",
+ column: x => x.ManagerId,
+ principalTable: "AppUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Assignments",
+ columns: table => new
+ {
+ UserId = table.Column(nullable: false),
+ ProjectId = table.Column(nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Assignments", x => new { x.ProjectId, x.UserId });
+ table.ForeignKey(
+ name: "FK_Assignments_Projects_ProjectId",
+ column: x => x.ProjectId,
+ principalTable: "Projects",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_Assignments_AppUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AppUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Tickets",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Title = table.Column(maxLength: 100, nullable: false),
+ Description = table.Column(maxLength: 100, nullable: true),
+ CreationDate = table.Column(nullable: false),
+ EndingDate = table.Column(nullable: false),
+ Status = table.Column(nullable: false),
+ Impact = table.Column(nullable: false),
+ Difficulty = table.Column(nullable: false),
+ Category = table.Column(nullable: false),
+ CreatorId = table.Column(nullable: false),
+ ProjectId = table.Column(nullable: true),
+ AppUserId = table.Column(nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Tickets", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Tickets_AppUsers_AppUserId",
+ column: x => x.AppUserId,
+ principalTable: "AppUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_Tickets_Projects_ProjectId",
+ column: x => x.ProjectId,
+ principalTable: "Projects",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Activities",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Description = table.Column(nullable: true),
+ UpdateDate = table.Column(nullable: false),
+ ActivityType = table.Column(nullable: false),
+ TaskId = table.Column(nullable: false),
+ AppUserId = table.Column(nullable: true),
+ ProjectId = table.Column(nullable: true),
+ TicketId = table.Column(nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Activities", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Activities_AppUsers_AppUserId",
+ column: x => x.AppUserId,
+ principalTable: "AppUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_Activities_Projects_ProjectId",
+ column: x => x.ProjectId,
+ principalTable: "Projects",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_Activities_Tickets_TicketId",
+ column: x => x.TicketId,
+ principalTable: "Tickets",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Files",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ FileName = table.Column(nullable: true),
+ Location = table.Column(nullable: true),
+ Description = table.Column(nullable: true),
+ Size = table.Column(nullable: false),
+ Format = table.Column(nullable: true),
+ AddedById = table.Column(nullable: true),
+ UserId = table.Column(nullable: false),
+ ProjectId = table.Column(nullable: true),
+ TicketId = table.Column(nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Files", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Files_AppUsers_AddedById",
+ column: x => x.AddedById,
+ principalTable: "AppUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_Files_Projects_ProjectId",
+ column: x => x.ProjectId,
+ principalTable: "Projects",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ table.ForeignKey(
+ name: "FK_Files_Tickets_TicketId",
+ column: x => x.TicketId,
+ principalTable: "Tickets",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Notes",
+ columns: table => new
+ {
+ Id = table.Column(nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
+ Title = table.Column(nullable: true),
+ Description = table.Column(nullable: true),
+ CreationDate = table.Column(nullable: false),
+ TicketId = table.Column(nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Notes", x => x.Id);
+ table.ForeignKey(
+ name: "FK_Notes_Tickets_TicketId",
+ column: x => x.TicketId,
+ principalTable: "Tickets",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Activities_AppUserId",
+ table: "Activities",
+ column: "AppUserId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Activities_ProjectId",
+ table: "Activities",
+ column: "ProjectId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Activities_TicketId",
+ table: "Activities",
+ column: "TicketId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Assignments_UserId",
+ table: "Assignments",
+ column: "UserId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Files_AddedById",
+ table: "Files",
+ column: "AddedById");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Files_ProjectId",
+ table: "Files",
+ column: "ProjectId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Files_TicketId",
+ table: "Files",
+ column: "TicketId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Notes_TicketId",
+ table: "Notes",
+ column: "TicketId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Projects_ManagerId",
+ table: "Projects",
+ column: "ManagerId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Tickets_AppUserId",
+ table: "Tickets",
+ column: "AppUserId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_Tickets_ProjectId",
+ table: "Tickets",
+ column: "ProjectId");
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "Activities");
+
+ migrationBuilder.DropTable(
+ name: "Assignments");
+
+ migrationBuilder.DropTable(
+ name: "Files");
+
+ migrationBuilder.DropTable(
+ name: "Notes");
+
+ migrationBuilder.DropTable(
+ name: "Tickets");
+
+ migrationBuilder.DropTable(
+ name: "Projects");
+
+ migrationBuilder.DropTable(
+ name: "AppUsers");
+ }
+ }
+}
diff --git a/Migrations/AppDbContextModelSnapshot.cs b/Migrations/AppDbContextModelSnapshot.cs
new file mode 100644
index 0000000..b560646
--- /dev/null
+++ b/Migrations/AppDbContextModelSnapshot.cs
@@ -0,0 +1,335 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using TicketManager.Data;
+
+namespace TicketManager.Migrations
+{
+ [DbContext(typeof(AppDbContext))]
+ partial class AppDbContextModelSnapshot : ModelSnapshot
+ {
+ protected override void BuildModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "3.1.1");
+
+ modelBuilder.Entity("TicketManager.Models.Activity", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ActivityType")
+ .HasColumnType("INTEGER");
+
+ b.Property("AppUserId")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("ProjectId")
+ .HasColumnType("INTEGER");
+
+ b.Property("TaskId")
+ .HasColumnType("INTEGER");
+
+ b.Property("TicketId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UpdateDate")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AppUserId");
+
+ b.HasIndex("ProjectId");
+
+ b.HasIndex("TicketId");
+
+ b.ToTable("Activities");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.AppUser", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TEXT");
+
+ b.Property("CreationDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Email")
+ .HasColumnType("TEXT");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasMaxLength(50);
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasMaxLength(50);
+
+ b.Property("Phone")
+ .HasColumnType("TEXT");
+
+ b.Property("Picture")
+ .HasColumnType("TEXT");
+
+ b.Property("Presentation")
+ .HasColumnType("TEXT")
+ .HasMaxLength(200);
+
+ b.HasKey("Id");
+
+ b.ToTable("AppUsers");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Assignment", b =>
+ {
+ b.Property("ProjectId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("ProjectId", "UserId");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("Assignments");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.File", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("AddedById")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("FileName")
+ .HasColumnType("TEXT");
+
+ b.Property("Format")
+ .HasColumnType("TEXT");
+
+ b.Property("Location")
+ .HasColumnType("TEXT");
+
+ b.Property("ProjectId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Size")
+ .HasColumnType("INTEGER");
+
+ b.Property("TicketId")
+ .HasColumnType("INTEGER");
+
+ b.Property("UserId")
+ .HasColumnType("INTEGER");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AddedById");
+
+ b.HasIndex("ProjectId");
+
+ b.HasIndex("TicketId");
+
+ b.ToTable("Files");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Note", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("CreationDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT");
+
+ b.Property("TicketId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Title")
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("TicketId");
+
+ b.ToTable("Notes");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Project", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("CreationDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT")
+ .HasMaxLength(200);
+
+ b.Property("EndingDate")
+ .HasColumnType("TEXT");
+
+ b.Property("ManagerId")
+ .HasColumnType("TEXT");
+
+ b.Property("Status")
+ .HasColumnType("INTEGER");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasMaxLength(50);
+
+ b.HasKey("Id");
+
+ b.HasIndex("ManagerId");
+
+ b.ToTable("Projects");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Ticket", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("AppUserId")
+ .HasColumnType("TEXT");
+
+ b.Property("Category")
+ .HasColumnType("INTEGER");
+
+ b.Property("CreationDate")
+ .HasColumnType("TEXT");
+
+ b.Property("CreatorId")
+ .HasColumnType("TEXT");
+
+ b.Property("Description")
+ .HasColumnType("TEXT")
+ .HasMaxLength(100);
+
+ b.Property("Difficulty")
+ .HasColumnType("INTEGER");
+
+ b.Property("EndingDate")
+ .HasColumnType("TEXT");
+
+ b.Property("Impact")
+ .HasColumnType("INTEGER");
+
+ b.Property("ProjectId")
+ .HasColumnType("INTEGER");
+
+ b.Property("Status")
+ .HasColumnType("INTEGER");
+
+ b.Property("Title")
+ .IsRequired()
+ .HasColumnType("TEXT")
+ .HasMaxLength(100);
+
+ b.HasKey("Id");
+
+ b.HasIndex("AppUserId");
+
+ b.HasIndex("ProjectId");
+
+ b.ToTable("Tickets");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Activity", b =>
+ {
+ b.HasOne("TicketManager.Models.AppUser", null)
+ .WithMany("Activities")
+ .HasForeignKey("AppUserId");
+
+ b.HasOne("TicketManager.Models.Project", null)
+ .WithMany("Activities")
+ .HasForeignKey("ProjectId");
+
+ b.HasOne("TicketManager.Models.Ticket", null)
+ .WithMany("Activities")
+ .HasForeignKey("TicketId");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Assignment", b =>
+ {
+ b.HasOne("TicketManager.Models.Project", "Project")
+ .WithMany("Assignments")
+ .HasForeignKey("ProjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("TicketManager.Models.AppUser", "User")
+ .WithMany("Assignments")
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("TicketManager.Models.File", b =>
+ {
+ b.HasOne("TicketManager.Models.AppUser", "AddedBy")
+ .WithMany()
+ .HasForeignKey("AddedById");
+
+ b.HasOne("TicketManager.Models.Project", null)
+ .WithMany("Files")
+ .HasForeignKey("ProjectId");
+
+ b.HasOne("TicketManager.Models.Ticket", null)
+ .WithMany("Files")
+ .HasForeignKey("TicketId");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Note", b =>
+ {
+ b.HasOne("TicketManager.Models.Ticket", "Ticket")
+ .WithMany("Notes")
+ .HasForeignKey("TicketId");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Project", b =>
+ {
+ b.HasOne("TicketManager.Models.AppUser", "Manager")
+ .WithMany()
+ .HasForeignKey("ManagerId");
+ });
+
+ modelBuilder.Entity("TicketManager.Models.Ticket", b =>
+ {
+ b.HasOne("TicketManager.Models.AppUser", null)
+ .WithMany("Tickets")
+ .HasForeignKey("AppUserId");
+
+ b.HasOne("TicketManager.Models.Project", "Project")
+ .WithMany("Tickets")
+ .HasForeignKey("ProjectId");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}