diff --git a/Hushian.Domain/Entites/AIA.cs b/Hushian.Domain/Entites/AIA.cs new file mode 100644 index 0000000..afefb07 --- /dev/null +++ b/Hushian.Domain/Entites/AIA.cs @@ -0,0 +1,21 @@ +using Hushian.Domain.Abstracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Hushian.Domain.Entites +{ + class AIA : BaseEntity + { + public int ID { get; set; } + public DateTime Cdatetime { get; set; } + + public int CompanyID { get; set; } + public int UserID { get; set; } + public string Request { get; set; } + public string Response { get; set; } + + } +} diff --git a/Hushian.Domain/Entites/Company.cs b/Hushian.Domain/Entites/Company.cs index 4b0337b..9b6219c 100644 --- a/Hushian.Domain/Entites/Company.cs +++ b/Hushian.Domain/Entites/Company.cs @@ -37,6 +37,8 @@ namespace Hushian.Domain.Entites = new List(); public ICollection CompanyContentInfos { get; set; } = new List(); + public ICollection prompts { get; set; } + = new List(); #endregion } } diff --git a/Hushian.Domain/Entites/Prompt.cs b/Hushian.Domain/Entites/Prompt.cs new file mode 100644 index 0000000..b9e2d81 --- /dev/null +++ b/Hushian.Domain/Entites/Prompt.cs @@ -0,0 +1,21 @@ +using Hushian.Domain.Abstracts; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Hushian.Domain.Entites +{ + public class Prompt : BaseEntity + { + public int ID { get; set; } + public DateTime Cdatetime { get; set; } + public int CompanyID { get; set; } + public string Test { get; set; } + + [ForeignKey("CompanyID")] + public Company Company { get; set; } + } +} diff --git a/Hushian.sln b/Hushian.sln index 8df0538..d104999 100644 --- a/Hushian.sln +++ b/Hushian.sln @@ -21,11 +21,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hushian.WebApi", "Presentat EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HushianWebApp", "Presentation\HushianWebApp\HushianWebApp.csproj", "{80D865DC-1CCD-9C25-5DAF-153E7B33408E}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}" - ProjectSection(SolutionItems) = preProject - TODO.txt = TODO.txt - EndProjectSection -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Infrastructure/Persistence/HushianDbContext.cs b/Infrastructure/Persistence/HushianDbContext.cs index 7dbfdce..c0052b6 100644 --- a/Infrastructure/Persistence/HushianDbContext.cs +++ b/Infrastructure/Persistence/HushianDbContext.cs @@ -22,6 +22,7 @@ namespace Hushian.Persistence public DbSet EG { get; set; } public DbSet Users { get; set; } public DbSet verificationCodes { get; set; } + public DbSet prompts { get; set; } #endregion protected override void OnModelCreating(ModelBuilder modelBuilder) diff --git a/Infrastructure/Persistence/Migrations/20250815213829_tbpromt.Designer.cs b/Infrastructure/Persistence/Migrations/20250815213829_tbpromt.Designer.cs new file mode 100644 index 0000000..667e444 --- /dev/null +++ b/Infrastructure/Persistence/Migrations/20250815213829_tbpromt.Designer.cs @@ -0,0 +1,490 @@ +// +using System; +using Hushian.Persistence; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Hushian.Persistence.Migrations +{ + [DbContext(typeof(HushianDbContext))] + [Migration("20250815213829_tbpromt")] + partial class tbpromt + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.7") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("Hushian.Domain.Entites.Company", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("Available") + .HasColumnType("bit"); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("FullName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FullNameManager") + .HasColumnType("nvarchar(max)"); + + b.Property("Mobile") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Password") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Verified") + .HasColumnType("bit"); + + b.Property("WebSite") + .HasColumnType("nvarchar(max)"); + + b.Property("allowBot") + .HasColumnType("bit"); + + b.Property("logo") + .HasColumnType("varbinary(max)"); + + b.HasKey("ID"); + + b.ToTable("Companies"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.Property("CompanyID") + .HasColumnType("int"); + + b.Property("Content") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("ID"); + + b.HasIndex("CompanyID"); + + b.ToTable("CompanyContentInfo"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.Property("CompanyID") + .HasColumnType("int"); + + b.Property("FinishedDateTime") + .HasColumnType("datetime2"); + + b.Property("GroupID") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("UserID") + .HasColumnType("int"); + + b.HasKey("ID"); + + b.HasIndex("CompanyID"); + + b.HasIndex("GroupID"); + + b.HasIndex("UserID"); + + b.ToTable("Conversations"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.Property("ConversationID") + .HasColumnType("int"); + + b.Property("ExperID") + .HasColumnType("int"); + + b.Property("FileContent") + .HasColumnType("varbinary(max)"); + + b.Property("FileName") + .HasColumnType("nvarchar(max)"); + + b.Property("FileType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsRead") + .HasColumnType("bit"); + + b.Property("ReadDateTime") + .HasColumnType("datetime2"); + + b.Property("Text") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("ID"); + + b.HasIndex("ConversationID"); + + b.HasIndex("ExperID"); + + b.ToTable("ConversationItems"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Exper", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("Available") + .HasColumnType("bit"); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.Property("CompanyID") + .HasColumnType("int"); + + b.Property("FullName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Password") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("ID"); + + b.HasIndex("CompanyID"); + + b.ToTable("Expers"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b => + { + b.Property("ExperID") + .HasColumnType("int"); + + b.Property("GroupID") + .HasColumnType("int"); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.HasKey("ExperID", "GroupID"); + + b.HasIndex("GroupID"); + + b.ToTable("EG"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Group", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("Available") + .HasColumnType("bit"); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.Property("CompanyID") + .HasColumnType("int"); + + b.Property("Info") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("img") + .HasColumnType("varbinary(max)"); + + b.HasKey("ID"); + + b.HasIndex("CompanyID"); + + b.ToTable("Groups"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Prompt", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.Property("CompanyID") + .HasColumnType("int"); + + b.Property("Test") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("ID"); + + b.HasIndex("CompanyID"); + + b.ToTable("prompts"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.User", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.Property("FullName") + .HasColumnType("nvarchar(max)"); + + b.Property("Mobile") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("ID"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("Identity.Models.VerificationCode", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.Property("Code") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Mobile") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("ID"); + + b.ToTable("verificationCodes"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.CompanyContentInfo", b => + { + b.HasOne("Hushian.Domain.Entites.Company", "company") + .WithMany("CompanyContentInfos") + .HasForeignKey("CompanyID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("company"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b => + { + b.HasOne("Hushian.Domain.Entites.Company", "Company") + .WithMany("Conversations") + .HasForeignKey("CompanyID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Hushian.Domain.Entites.Group", "Group") + .WithMany() + .HasForeignKey("GroupID"); + + b.HasOne("Hushian.Domain.Entites.User", "User") + .WithMany("Conversations") + .HasForeignKey("UserID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + + b.Navigation("Group"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.ConversationResponse", b => + { + b.HasOne("Hushian.Domain.Entites.Conversation", "conversation") + .WithMany("ConversationResponses") + .HasForeignKey("ConversationID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Hushian.Domain.Entites.Exper", "Exper") + .WithMany() + .HasForeignKey("ExperID"); + + b.Navigation("Exper"); + + b.Navigation("conversation"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Exper", b => + { + b.HasOne("Hushian.Domain.Entites.Company", "Company") + .WithMany("Expers") + .HasForeignKey("CompanyID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.ExperGroup", b => + { + b.HasOne("Hushian.Domain.Entites.Exper", "Exper") + .WithMany("EG") + .HasForeignKey("ExperID") + .OnDelete(DeleteBehavior.ClientCascade) + .IsRequired(); + + b.HasOne("Hushian.Domain.Entites.Group", "Group") + .WithMany("EG") + .HasForeignKey("GroupID") + .OnDelete(DeleteBehavior.ClientCascade) + .IsRequired(); + + b.Navigation("Exper"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Group", b => + { + b.HasOne("Hushian.Domain.Entites.Company", "Company") + .WithMany("Groups") + .HasForeignKey("CompanyID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Prompt", b => + { + b.HasOne("Hushian.Domain.Entites.Company", "Company") + .WithMany("prompts") + .HasForeignKey("CompanyID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Company", b => + { + b.Navigation("CompanyContentInfos"); + + b.Navigation("Conversations"); + + b.Navigation("Expers"); + + b.Navigation("Groups"); + + b.Navigation("prompts"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b => + { + b.Navigation("ConversationResponses"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Exper", b => + { + b.Navigation("EG"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.Group", b => + { + b.Navigation("EG"); + }); + + modelBuilder.Entity("Hushian.Domain.Entites.User", b => + { + b.Navigation("Conversations"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Infrastructure/Persistence/Migrations/20250815213829_tbpromt.cs b/Infrastructure/Persistence/Migrations/20250815213829_tbpromt.cs new file mode 100644 index 0000000..27ee969 --- /dev/null +++ b/Infrastructure/Persistence/Migrations/20250815213829_tbpromt.cs @@ -0,0 +1,48 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Hushian.Persistence.Migrations +{ + /// + public partial class tbpromt : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "prompts", + columns: table => new + { + ID = table.Column(type: "int", nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Cdatetime = table.Column(type: "datetime2", nullable: false), + CompanyID = table.Column(type: "int", nullable: false), + Test = table.Column(type: "nvarchar(max)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_prompts", x => x.ID); + table.ForeignKey( + name: "FK_prompts_Companies_CompanyID", + column: x => x.CompanyID, + principalTable: "Companies", + principalColumn: "ID", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_prompts_CompanyID", + table: "prompts", + column: "CompanyID"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "prompts"); + } + } +} diff --git a/Infrastructure/Persistence/Migrations/HushianDbContextModelSnapshot.cs b/Infrastructure/Persistence/Migrations/HushianDbContextModelSnapshot.cs index 31c5447..ebe3a9e 100644 --- a/Infrastructure/Persistence/Migrations/HushianDbContextModelSnapshot.cs +++ b/Infrastructure/Persistence/Migrations/HushianDbContextModelSnapshot.cs @@ -269,6 +269,31 @@ namespace Hushian.Persistence.Migrations b.ToTable("Groups"); }); + modelBuilder.Entity("Hushian.Domain.Entites.Prompt", b => + { + b.Property("ID") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("ID")); + + b.Property("Cdatetime") + .HasColumnType("datetime2"); + + b.Property("CompanyID") + .HasColumnType("int"); + + b.Property("Test") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("ID"); + + b.HasIndex("CompanyID"); + + b.ToTable("prompts"); + }); + modelBuilder.Entity("Hushian.Domain.Entites.User", b => { b.Property("ID") @@ -413,6 +438,17 @@ namespace Hushian.Persistence.Migrations b.Navigation("Company"); }); + modelBuilder.Entity("Hushian.Domain.Entites.Prompt", b => + { + b.HasOne("Hushian.Domain.Entites.Company", "Company") + .WithMany("prompts") + .HasForeignKey("CompanyID") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Company"); + }); + modelBuilder.Entity("Hushian.Domain.Entites.Company", b => { b.Navigation("CompanyContentInfos"); @@ -422,6 +458,8 @@ namespace Hushian.Persistence.Migrations b.Navigation("Expers"); b.Navigation("Groups"); + + b.Navigation("prompts"); }); modelBuilder.Entity("Hushian.Domain.Entites.Conversation", b =>