diff --git a/Dynamics.DataAccess/Migrations/20241106220416_initial.Designer.cs b/Dynamics.DataAccess/Migrations/20241106220416_initial.Designer.cs
new file mode 100644
index 00000000..8dff9e0d
--- /dev/null
+++ b/Dynamics.DataAccess/Migrations/20241106220416_initial.Designer.cs
@@ -0,0 +1,1116 @@
+//
+using System;
+using Dynamics.DataAccess;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Dynamics.DataAccess.Migrations
+{
+ [DbContext(typeof(ApplicationDbContext))]
+ [Migration("20241106220416_initial")]
+ partial class initial
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.8")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Dynamics.Models.Models.History", b =>
+ {
+ b.Property("HistoryID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Attachment")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("Date")
+ .HasColumnType("date");
+
+ b.Property("Phase")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("ProjectID")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("HistoryID");
+
+ b.HasIndex("ProjectID");
+
+ b.ToTable("Histories");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Notification", b =>
+ {
+ b.Property("NotificationID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Date")
+ .HasColumnType("datetime2");
+
+ b.Property("Link")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Message")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("UserID")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("NotificationID");
+
+ b.HasIndex("UserID");
+
+ b.ToTable("Notifications");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Organization", b =>
+ {
+ b.Property("OrganizationID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OrganizationAddress")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrganizationDescription")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrganizationEmail")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("OrganizationName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("OrganizationPhoneNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrganizationPictures")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OrganizationStatus")
+ .HasColumnType("int");
+
+ b.Property("ShutdownDay")
+ .HasColumnType("date");
+
+ b.Property("StartTime")
+ .HasColumnType("date");
+
+ b.HasKey("OrganizationID");
+
+ b.HasIndex("OrganizationEmail")
+ .IsUnique()
+ .HasFilter("[OrganizationEmail] IS NOT NULL");
+
+ b.HasIndex("OrganizationName")
+ .IsUnique();
+
+ b.ToTable("Organizations");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.OrganizationMember", b =>
+ {
+ b.Property("OrganizationID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UserID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.HasKey("OrganizationID", "UserID");
+
+ b.HasIndex("UserID");
+
+ b.ToTable("OrganizationMember");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.OrganizationResource", b =>
+ {
+ b.Property("ResourceID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("OrganizationID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.Property("ResourceName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Unit")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("ResourceID");
+
+ b.HasIndex("OrganizationID");
+
+ b.ToTable("OrganizationResources");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.OrganizationToProjectHistory", b =>
+ {
+ b.Property("TransactionID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Amount")
+ .HasColumnType("int");
+
+ b.Property("Attachments")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Message")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("OrganizationResourceID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProjectResourceID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("Time")
+ .HasColumnType("date");
+
+ b.HasKey("TransactionID");
+
+ b.HasIndex("OrganizationResourceID");
+
+ b.HasIndex("ProjectResourceID");
+
+ b.ToTable("OrganizationToProjectTransactionHistory");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Project", b =>
+ {
+ b.Property("ProjectID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Attachment")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EndTime")
+ .HasColumnType("date");
+
+ b.Property("OrganizationID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ProjectAddress")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProjectDescription")
+ .IsRequired()
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("ProjectEmail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProjectName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("ProjectPhoneNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProjectStatus")
+ .HasColumnType("int");
+
+ b.Property("ReportFile")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RequestID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ShutdownReason")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("StartTime")
+ .HasColumnType("date");
+
+ b.Property("isBanned")
+ .HasColumnType("bit");
+
+ b.HasKey("ProjectID");
+
+ b.HasIndex("OrganizationID");
+
+ b.HasIndex("RequestID")
+ .IsUnique()
+ .HasFilter("[RequestID] IS NOT NULL");
+
+ b.ToTable("Projects");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.ProjectMember", b =>
+ {
+ b.Property("ProjectID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("UserID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.HasKey("ProjectID", "UserID");
+
+ b.HasIndex("UserID");
+
+ b.ToTable("ProjectMembers");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.ProjectResource", b =>
+ {
+ b.Property("ResourceID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ExpectedQuantity")
+ .HasColumnType("int");
+
+ b.Property("ProjectID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Quantity")
+ .HasColumnType("int");
+
+ b.Property("ResourceName")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("Unit")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.HasKey("ResourceID");
+
+ b.HasIndex("ProjectID");
+
+ b.ToTable("ProjectResources");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Report", b =>
+ {
+ b.Property("ReportID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ObjectID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("ReportDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ReporterID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Type")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("ReportID");
+
+ b.HasIndex("ReporterID");
+
+ b.ToTable("Reports");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Request", b =>
+ {
+ b.Property("RequestID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Attachment")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Content")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreationDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Location")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RequestEmail")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RequestPhoneNumber")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RequestTitle")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("UserID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("isEmergency")
+ .HasColumnType("int");
+
+ b.HasKey("RequestID");
+
+ b.HasIndex("UserID");
+
+ b.ToTable("Requests");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.User", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("int");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatedDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("bit");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("bit");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("datetimeoffset");
+
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.Property("PasswordHash")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PhoneNumber")
+ .HasMaxLength(11)
+ .HasColumnType("nvarchar(11)");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("bit");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("bit");
+
+ b.Property("UserAddress")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserAvatar")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserDOB")
+ .HasColumnType("date");
+
+ b.Property("UserDescription")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("UserName")
+ .IsRequired()
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.Property("isBanned")
+ .HasColumnType("bit");
+
+ b.HasKey("Id");
+
+ b.HasIndex("Email")
+ .IsUnique()
+ .HasFilter("[Email] IS NOT NULL");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex")
+ .HasFilter("[NormalizedUserName] IS NOT NULL");
+
+ b.HasIndex("UserName")
+ .IsUnique();
+
+ b.ToTable("AspNetUsers", (string)null);
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.UserToOrganizationTransactionHistory", b =>
+ {
+ b.Property("TransactionID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Amount")
+ .HasColumnType("int");
+
+ b.Property("Attachments")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Message")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ResourceID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("Time")
+ .HasColumnType("date");
+
+ b.Property("UserID")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("TransactionID");
+
+ b.HasIndex("ResourceID");
+
+ b.HasIndex("UserID");
+
+ b.ToTable("UserToOrganizationTransactionHistories");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.UserToProjectTransactionHistory", b =>
+ {
+ b.Property("TransactionID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Amount")
+ .HasColumnType("int");
+
+ b.Property("Attachments")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Message")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("ProjectResourceID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.Property("Time")
+ .HasColumnType("date");
+
+ b.Property("UserID")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("TransactionID");
+
+ b.HasIndex("ProjectResourceID");
+
+ b.HasIndex("UserID");
+
+ b.ToTable("UserToProjectTransactionHistories");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.UserWalletTransaction", b =>
+ {
+ b.Property("TransactionId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Amount")
+ .HasColumnType("int");
+
+ b.Property("Message")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("Time")
+ .HasColumnType("datetime2");
+
+ b.Property("TransactionType")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("WalletId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("TransactionId");
+
+ b.HasIndex("WalletId");
+
+ b.ToTable("UserWalletTransactions");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Wallet", b =>
+ {
+ b.Property("WalletId")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Amount")
+ .HasColumnType("int");
+
+ b.Property("Currency")
+ .IsRequired()
+ .HasMaxLength(3)
+ .HasColumnType("nvarchar(3)");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("WalletId");
+
+ b.HasIndex("UserId")
+ .IsUnique();
+
+ b.ToTable("Wallets");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Withdraw", b =>
+ {
+ b.Property("WithdrawID")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Message")
+ .HasMaxLength(500)
+ .HasColumnType("nvarchar(500)");
+
+ b.Property("ProjectID")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Time")
+ .HasColumnType("datetime2");
+
+ b.HasKey("WithdrawID");
+
+ b.HasIndex("ProjectID");
+
+ b.ToTable("Withdraws");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("nvarchar(256)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex")
+ .HasFilter("[NormalizedName] IS NOT NULL");
+
+ b.ToTable("AspNetRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ClaimValue")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RoleId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetRoleClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ClaimType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ClaimValue")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ProviderKey")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("RoleId")
+ .HasColumnType("uniqueidentifier");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LoginProvider")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Name")
+ .HasColumnType("nvarchar(450)");
+
+ b.Property("Value")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens", (string)null);
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.History", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.Project", "Project")
+ .WithMany("History")
+ .HasForeignKey("ProjectID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Project");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Notification", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.User", "User")
+ .WithMany("Notifications")
+ .HasForeignKey("UserID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.OrganizationMember", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.Organization", "Organization")
+ .WithMany("OrganizationMember")
+ .HasForeignKey("OrganizationID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Dynamics.Models.Models.User", "User")
+ .WithMany("OrganizationMember")
+ .HasForeignKey("UserID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Organization");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.OrganizationResource", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.Organization", "Organization")
+ .WithMany("OrganizationResource")
+ .HasForeignKey("OrganizationID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Organization");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.OrganizationToProjectHistory", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.OrganizationResource", "OrganizationResource")
+ .WithMany("OrganizationToProjectHistory")
+ .HasForeignKey("OrganizationResourceID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Dynamics.Models.Models.ProjectResource", "ProjectResource")
+ .WithMany("OrganizationToProjectHistory")
+ .HasForeignKey("ProjectResourceID")
+ .OnDelete(DeleteBehavior.NoAction);
+
+ b.Navigation("OrganizationResource");
+
+ b.Navigation("ProjectResource");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Project", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.Organization", "Organization")
+ .WithMany("Project")
+ .HasForeignKey("OrganizationID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Dynamics.Models.Models.Request", "Request")
+ .WithOne("Project")
+ .HasForeignKey("Dynamics.Models.Models.Project", "RequestID");
+
+ b.Navigation("Organization");
+
+ b.Navigation("Request");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.ProjectMember", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.Project", "Project")
+ .WithMany("ProjectMember")
+ .HasForeignKey("ProjectID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Dynamics.Models.Models.User", "User")
+ .WithMany("ProjectMember")
+ .HasForeignKey("UserID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Project");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.ProjectResource", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.Project", "Project")
+ .WithMany("ProjectResource")
+ .HasForeignKey("ProjectID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Project");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Report", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.User", "Reporter")
+ .WithMany("ReportsMade")
+ .HasForeignKey("ReporterID")
+ .OnDelete(DeleteBehavior.NoAction);
+
+ b.Navigation("Reporter");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Request", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.User", "User")
+ .WithMany("Request")
+ .HasForeignKey("UserID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.UserToOrganizationTransactionHistory", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.OrganizationResource", "OrganizationResource")
+ .WithMany("UserToOrganizationTransactionHistory")
+ .HasForeignKey("ResourceID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Dynamics.Models.Models.User", "User")
+ .WithMany("UserToOrganizationTransactionHistories")
+ .HasForeignKey("UserID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("OrganizationResource");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.UserToProjectTransactionHistory", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.ProjectResource", "ProjectResource")
+ .WithMany("UserToProjectTransactionHistory")
+ .HasForeignKey("ProjectResourceID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Dynamics.Models.Models.User", "User")
+ .WithMany("UserToProjectTransactionHistories")
+ .HasForeignKey("UserID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("ProjectResource");
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.UserWalletTransaction", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.Wallet", "Wallet")
+ .WithMany("WalletTransactions")
+ .HasForeignKey("WalletId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Wallet");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Wallet", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.User", "User")
+ .WithOne("Wallet")
+ .HasForeignKey("Dynamics.Models.Models.Wallet", "UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("User");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Withdraw", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.Project", "Project")
+ .WithMany("Withdraw")
+ .HasForeignKey("ProjectID")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.Navigation("Project");
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Dynamics.Models.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.HasOne("Dynamics.Models.Models.User", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Organization", b =>
+ {
+ b.Navigation("OrganizationMember");
+
+ b.Navigation("OrganizationResource");
+
+ b.Navigation("Project");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.OrganizationResource", b =>
+ {
+ b.Navigation("OrganizationToProjectHistory");
+
+ b.Navigation("UserToOrganizationTransactionHistory");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Project", b =>
+ {
+ b.Navigation("History");
+
+ b.Navigation("ProjectMember");
+
+ b.Navigation("ProjectResource");
+
+ b.Navigation("Withdraw");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.ProjectResource", b =>
+ {
+ b.Navigation("OrganizationToProjectHistory");
+
+ b.Navigation("UserToProjectTransactionHistory");
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Request", b =>
+ {
+ b.Navigation("Project")
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.User", b =>
+ {
+ b.Navigation("Notifications");
+
+ b.Navigation("OrganizationMember");
+
+ b.Navigation("ProjectMember");
+
+ b.Navigation("ReportsMade");
+
+ b.Navigation("Request");
+
+ b.Navigation("UserToOrganizationTransactionHistories");
+
+ b.Navigation("UserToProjectTransactionHistories");
+
+ b.Navigation("Wallet")
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Dynamics.Models.Models.Wallet", b =>
+ {
+ b.Navigation("WalletTransactions");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Dynamics.DataAccess/Migrations/20241106220416_initial.cs b/Dynamics.DataAccess/Migrations/20241106220416_initial.cs
new file mode 100644
index 00000000..c9d77eb0
--- /dev/null
+++ b/Dynamics.DataAccess/Migrations/20241106220416_initial.cs
@@ -0,0 +1,794 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace Dynamics.DataAccess.Migrations
+{
+ ///
+ public partial class initial : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.CreateTable(
+ name: "AspNetRoles",
+ columns: table => new
+ {
+ Id = table.Column(type: "uniqueidentifier", nullable: false),
+ Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ NormalizedName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetRoles", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUsers",
+ columns: table => new
+ {
+ Id = table.Column(type: "uniqueidentifier", nullable: false),
+ UserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false),
+ UserDOB = table.Column(type: "date", nullable: true),
+ PhoneNumber = table.Column(type: "nvarchar(11)", maxLength: 11, nullable: true),
+ UserAddress = table.Column(type: "nvarchar(max)", nullable: true),
+ UserAvatar = table.Column(type: "nvarchar(max)", nullable: true),
+ UserDescription = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true),
+ isBanned = table.Column(type: "bit", nullable: false),
+ CreatedDate = table.Column(type: "datetime2", nullable: true),
+ NormalizedUserName = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ Email = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ NormalizedEmail = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true),
+ EmailConfirmed = table.Column(type: "bit", nullable: false),
+ PasswordHash = table.Column(type: "nvarchar(max)", nullable: true),
+ SecurityStamp = table.Column(type: "nvarchar(max)", nullable: true),
+ ConcurrencyStamp = table.Column(type: "nvarchar(max)", nullable: true),
+ PhoneNumberConfirmed = table.Column(type: "bit", nullable: false),
+ TwoFactorEnabled = table.Column(type: "bit", nullable: false),
+ LockoutEnd = table.Column(type: "datetimeoffset", nullable: true),
+ LockoutEnabled = table.Column(type: "bit", nullable: false),
+ AccessFailedCount = table.Column(type: "int", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUsers", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Organizations",
+ columns: table => new
+ {
+ OrganizationID = table.Column(type: "uniqueidentifier", nullable: false),
+ OrganizationName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ OrganizationEmail = table.Column(type: "nvarchar(450)", nullable: true),
+ OrganizationPhoneNumber = table.Column(type: "nvarchar(max)", nullable: true),
+ OrganizationAddress = table.Column(type: "nvarchar(max)", nullable: true),
+ OrganizationDescription = table.Column(type: "nvarchar(max)", nullable: false),
+ OrganizationPictures = table.Column(type: "nvarchar(max)", nullable: true),
+ StartTime = table.Column(type: "date", nullable: false),
+ ShutdownDay = table.Column(type: "date", nullable: true),
+ OrganizationStatus = table.Column(type: "int", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Organizations", x => x.OrganizationID);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetRoleClaims",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ RoleId = table.Column(type: "uniqueidentifier", nullable: false),
+ ClaimType = table.Column(type: "nvarchar(max)", nullable: true),
+ ClaimValue = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
+ column: x => x.RoleId,
+ principalTable: "AspNetRoles",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserClaims",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("SqlServer:Identity", "1, 1"),
+ UserId = table.Column(type: "uniqueidentifier", nullable: false),
+ ClaimType = table.Column(type: "nvarchar(max)", nullable: true),
+ ClaimValue = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
+ table.ForeignKey(
+ name: "FK_AspNetUserClaims_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserLogins",
+ columns: table => new
+ {
+ LoginProvider = table.Column(type: "nvarchar(450)", nullable: false),
+ ProviderKey = table.Column(type: "nvarchar(450)", nullable: false),
+ ProviderDisplayName = table.Column(type: "nvarchar(max)", nullable: true),
+ UserId = table.Column(type: "uniqueidentifier", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
+ table.ForeignKey(
+ name: "FK_AspNetUserLogins_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserRoles",
+ columns: table => new
+ {
+ UserId = table.Column(type: "uniqueidentifier", nullable: false),
+ RoleId = table.Column(type: "uniqueidentifier", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
+ table.ForeignKey(
+ name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
+ column: x => x.RoleId,
+ principalTable: "AspNetRoles",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_AspNetUserRoles_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "AspNetUserTokens",
+ columns: table => new
+ {
+ UserId = table.Column(type: "uniqueidentifier", nullable: false),
+ LoginProvider = table.Column(type: "nvarchar(450)", nullable: false),
+ Name = table.Column(type: "nvarchar(450)", nullable: false),
+ Value = table.Column(type: "nvarchar(max)", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
+ table.ForeignKey(
+ name: "FK_AspNetUserTokens_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Notifications",
+ columns: table => new
+ {
+ NotificationID = table.Column(type: "uniqueidentifier", nullable: false),
+ UserID = table.Column(type: "uniqueidentifier", nullable: false),
+ Message = table.Column(type: "nvarchar(max)", nullable: false),
+ Date = table.Column(type: "datetime2", nullable: false),
+ Link = table.Column(type: "nvarchar(max)", nullable: false),
+ Status = table.Column(type: "int", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Notifications", x => x.NotificationID);
+ table.ForeignKey(
+ name: "FK_Notifications_AspNetUsers_UserID",
+ column: x => x.UserID,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Reports",
+ columns: table => new
+ {
+ ReportID = table.Column(type: "uniqueidentifier", nullable: false),
+ ReporterID = table.Column(type: "uniqueidentifier", nullable: true),
+ ObjectID = table.Column(type: "uniqueidentifier", nullable: false),
+ Type = table.Column(type: "nvarchar(max)", nullable: false),
+ Reason = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false),
+ ReportDate = table.Column(type: "datetime2", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Reports", x => x.ReportID);
+ table.ForeignKey(
+ name: "FK_Reports_AspNetUsers_ReporterID",
+ column: x => x.ReporterID,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id");
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Requests",
+ columns: table => new
+ {
+ RequestID = table.Column(type: "uniqueidentifier", nullable: false),
+ UserID = table.Column(type: "uniqueidentifier", nullable: false),
+ Content = table.Column(type: "nvarchar(max)", nullable: false),
+ CreationDate = table.Column(type: "datetime2", nullable: true),
+ RequestTitle = table.Column(type: "nvarchar(max)", nullable: false),
+ RequestEmail = table.Column(type: "nvarchar(max)", nullable: false),
+ RequestPhoneNumber = table.Column(type: "nvarchar(max)", nullable: false),
+ Location = table.Column(type: "nvarchar(max)", nullable: false),
+ Attachment = table.Column(type: "nvarchar(max)", nullable: true),
+ isEmergency = table.Column(type: "int", nullable: true),
+ Status = table.Column(type: "int", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Requests", x => x.RequestID);
+ table.ForeignKey(
+ name: "FK_Requests_AspNetUsers_UserID",
+ column: x => x.UserID,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "Wallets",
+ columns: table => new
+ {
+ WalletId = table.Column(type: "uniqueidentifier", nullable: false),
+ Amount = table.Column(type: "int", nullable: false),
+ Currency = table.Column(type: "nvarchar(3)", maxLength: 3, nullable: false),
+ UserId = table.Column(type: "uniqueidentifier", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_Wallets", x => x.WalletId);
+ table.ForeignKey(
+ name: "FK_Wallets_AspNetUsers_UserId",
+ column: x => x.UserId,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "OrganizationMember",
+ columns: table => new
+ {
+ UserID = table.Column(type: "uniqueidentifier", nullable: false),
+ OrganizationID = table.Column(type: "uniqueidentifier", nullable: false),
+ Status = table.Column(type: "int", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_OrganizationMember", x => new { x.OrganizationID, x.UserID });
+ table.ForeignKey(
+ name: "FK_OrganizationMember_AspNetUsers_UserID",
+ column: x => x.UserID,
+ principalTable: "AspNetUsers",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_OrganizationMember_Organizations_OrganizationID",
+ column: x => x.OrganizationID,
+ principalTable: "Organizations",
+ principalColumn: "OrganizationID",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "OrganizationResources",
+ columns: table => new
+ {
+ ResourceID = table.Column(type: "uniqueidentifier", nullable: false),
+ OrganizationID = table.Column(type: "uniqueidentifier", nullable: false),
+ ResourceName = table.Column(type: "nvarchar(max)", nullable: false),
+ Quantity = table.Column(type: "int", nullable: false),
+ Unit = table.Column