Generator Changes at 11/16/2025 12:48:45 AM +03:30

This commit is contained in:
masoodafar-web
2025-11-16 00:53:15 +03:30
parent 974f3c788f
commit 0a649325f8
75 changed files with 1460 additions and 7 deletions

View File

@@ -43,8 +43,6 @@ public class ApplicationDbContext : DbContext, IApplicationDbContext
public DbSet<Package> Packages => Set<Package>();
public DbSet<Role> Roles => Set<Role>();
public DbSet<UserRole> UserRoles => Set<UserRole>();
public DbSet<OtpToken> OtpTokens => Set<OtpToken>();
public DbSet<User> Users => Set<User>();
public DbSet<UserWallet> UserWallets => Set<UserWallet>();
public DbSet<UserWalletChangeLog> UserWalletChangeLogs => Set<UserWalletChangeLog>();
public DbSet<UserCarts> UserCartss => Set<UserCarts>();
@@ -54,4 +52,8 @@ public class ApplicationDbContext : DbContext, IApplicationDbContext
public DbSet<Products> Productss => Set<Products>();
public DbSet<ProductImages> ProductImagess => Set<ProductImages>();
public DbSet<Transactions> Transactionss => Set<Transactions>();
public DbSet<User> Users => Set<User>();
public DbSet<OtpToken> OtpTokens => Set<OtpToken>();
public DbSet<Contract> Contracts => Set<Contract>();
public DbSet<UserContract> UserContracts => Set<UserContract>();
}

View File

@@ -0,0 +1,20 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//قراردادها
public class ContractConfiguration : IEntityTypeConfiguration<Contract>
{
public void Configure(EntityTypeBuilder<Contract> builder)
{
builder.HasQueryFilter(p => !p.IsDeleted);
builder.Ignore(entity => entity.DomainEvents);
builder.HasKey(entity => entity.Id);
builder.Property(entity => entity.Id).UseIdentityColumn();
builder.Property(entity => entity.Title).IsRequired(true);
builder.Property(entity => entity.Description).IsRequired(true);
builder.Property(entity => entity.HtmlContent).IsRequired(true);
builder.Property(entity => entity.Type).IsRequired(true);
}
}

View File

@@ -0,0 +1,28 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//قراردادها
public class UserContractConfiguration : IEntityTypeConfiguration<UserContract>
{
public void Configure(EntityTypeBuilder<UserContract> builder)
{
builder.HasQueryFilter(p => !p.IsDeleted);
builder.Ignore(entity => entity.DomainEvents);
builder.HasKey(entity => entity.Id);
builder.Property(entity => entity.Id).UseIdentityColumn();
builder
.HasOne(entity => entity.User)
.WithMany(entity => entity.UserContracts)
.HasForeignKey(entity => entity.UserId)
.IsRequired(true);
builder
.HasOne(entity => entity.Contract)
.WithMany(entity => entity.UserContracts)
.HasForeignKey(entity => entity.ContractId)
.IsRequired(true);
builder.Property(entity => entity.SignGuid).IsRequired(true);
builder.Property(entity => entity.SignedPdfFile).IsRequired(true);
}
}