Add contract and user contract entities with relationships; update JWT token claims

This commit is contained in:
masoodafar-web
2025-11-16 17:17:17 +03:30
parent 75df0c1df0
commit 79e5871899
7 changed files with 1353 additions and 1 deletions

View File

@@ -23,6 +23,49 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Contract", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("HtmlContent")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime?>("LastModified")
.HasColumnType("datetime2");
b.Property<string>("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property<string>("Title")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Type")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("Contracts", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.FactorDetails", b =>
{
b.Property<long>("Id")
@@ -620,6 +663,52 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
b.ToTable("UserCartss", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserContract", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("bigint");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<long>("Id"));
b.Property<long>("ContractId")
.HasColumnType("bigint");
b.Property<DateTime>("Created")
.HasColumnType("datetime2");
b.Property<string>("CreatedBy")
.HasColumnType("nvarchar(max)");
b.Property<bool>("IsDeleted")
.HasColumnType("bit");
b.Property<DateTime?>("LastModified")
.HasColumnType("datetime2");
b.Property<string>("LastModifiedBy")
.HasColumnType("nvarchar(max)");
b.Property<string>("SignGuid")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("SignedPdfFile")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<long>("UserId")
.HasColumnType("bigint");
b.HasKey("Id");
b.HasIndex("ContractId");
b.HasIndex("UserId");
b.ToTable("UserContracts", "CMS");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserOrder", b =>
{
b.Property<long>("Id")
@@ -880,6 +969,25 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
b.Navigation("User");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserContract", b =>
{
b.HasOne("CMSMicroservice.Domain.Entities.Contract", "Contract")
.WithMany("UserContracts")
.HasForeignKey("ContractId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("CMSMicroservice.Domain.Entities.User", "User")
.WithMany("UserContracts")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Contract");
b.Navigation("User");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.UserOrder", b =>
{
b.HasOne("CMSMicroservice.Domain.Entities.Package", "Package")
@@ -948,6 +1056,11 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
b.Navigation("Wallet");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Contract", b =>
{
b.Navigation("UserContracts");
});
modelBuilder.Entity("CMSMicroservice.Domain.Entities.Package", b =>
{
b.Navigation("UserOrders");
@@ -978,6 +1091,8 @@ namespace CMSMicroservice.Infrastructure.Persistence.Migrations
b.Navigation("UserCartss");
b.Navigation("UserContracts");
b.Navigation("UserOrders");
b.Navigation("UserRoles");