Generator Changes at 11/25/2025 1:59:23 AM +03:30

This commit is contained in:
masoodafar-web
2025-11-25 02:03:51 +03:30
parent 87842f0b9b
commit 92a9a0e75d
77 changed files with 164 additions and 138 deletions

View File

@@ -44,20 +44,20 @@ public class ApplicationDbContext : DbContext, IApplicationDbContext
public DbSet<Role> Roles => Set<Role>();
public DbSet<Category> Categorys => Set<Category>();
public DbSet<UserRole> UserRoles => Set<UserRole>();
public DbSet<UserWallet> UserWallets => Set<UserWallet>();
public DbSet<UserWalletChangeLog> UserWalletChangeLogs => Set<UserWalletChangeLog>();
public DbSet<UserCarts> UserCartss => Set<UserCarts>();
public DbSet<ProductGallerys> ProductGalleryss => Set<ProductGallerys>();
public DbSet<UserOrder> UserOrders => Set<UserOrder>();
public DbSet<FactorDetails> FactorDetailss => Set<FactorDetails>();
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>();
public DbSet<PruductCategory> PruductCategorys => Set<PruductCategory>();
public DbSet<Tag> Tags => Set<Tag>();
public DbSet<PruductCategory> PruductCategorys => Set<PruductCategory>();
public DbSet<PruductTag> PruductTags => Set<PruductTag>();
public DbSet<Transactions> Transactionss => Set<Transactions>();
public DbSet<UserOrder> UserOrders => Set<UserOrder>();
public DbSet<UserWallet> UserWallets => Set<UserWallet>();
public DbSet<UserWalletChangeLog> UserWalletChangeLogs => Set<UserWalletChangeLog>();
}

View File

@@ -1,9 +1,8 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//توکن Otp
public class OtpTokenConfiguration : IEntityTypeConfiguration<OtpToken>
{
public void Configure(EntityTypeBuilder<OtpToken> builder)
@@ -18,5 +17,6 @@ public class OtpTokenConfiguration : IEntityTypeConfiguration<OtpToken>
builder.Property(entity => entity.ExpiresAt).IsRequired(true);
builder.Property(entity => entity.Attempts).IsRequired(true);
builder.Property(entity => entity.IsUsed).IsRequired(true);
}
}
}

View File

@@ -1,9 +1,8 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//پکیج
public class PackageConfiguration : IEntityTypeConfiguration<Package>
{
public void Configure(EntityTypeBuilder<Package> builder)
@@ -16,5 +15,6 @@ public class PackageConfiguration : IEntityTypeConfiguration<Package>
builder.Property(entity => entity.Description).IsRequired(true);
builder.Property(entity => entity.ImagePath).IsRequired(true);
builder.Property(entity => entity.Price).IsRequired(true);
}
}
}

View File

@@ -1,9 +1,8 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//نقش
public class RoleConfiguration : IEntityTypeConfiguration<Role>
{
public void Configure(EntityTypeBuilder<Role> builder)
@@ -14,5 +13,6 @@ public class RoleConfiguration : IEntityTypeConfiguration<Role>
builder.Property(entity => entity.Id).UseIdentityColumn();
builder.Property(entity => entity.Name).IsRequired(true);
builder.Property(entity => entity.Title).IsRequired(true);
}
}
}

View File

@@ -1,9 +1,8 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//تگ
public class TagConfiguration : IEntityTypeConfiguration<Tag>
{
public void Configure(EntityTypeBuilder<Tag> builder)
@@ -12,12 +11,11 @@ public class TagConfiguration : IEntityTypeConfiguration<Tag>
builder.Ignore(entity => entity.DomainEvents);
builder.HasKey(entity => entity.Id);
builder.Property(entity => entity.Id).UseIdentityColumn();
builder.Property(entity => entity.Name).IsRequired(true);
builder.Property(entity => entity.Title).IsRequired(true);
builder.Property(entity => entity.Description).IsRequired(false);
builder.Property(entity => entity.IsActive).IsRequired(true);
builder.Property(entity => entity.SortOrder).IsRequired(true);
}
}

View File

@@ -1,9 +1,8 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//آدرس کاربر
public class UserAddressConfiguration : IEntityTypeConfiguration<UserAddress>
{
public void Configure(EntityTypeBuilder<UserAddress> builder)
@@ -22,5 +21,6 @@ public class UserAddressConfiguration : IEntityTypeConfiguration<UserAddress>
builder.Property(entity => entity.PostalCode).IsRequired(true);
builder.Property(entity => entity.IsDefault).IsRequired(true);
builder.Property(entity => entity.CityId).IsRequired(true);
}
}
}

View File

@@ -1,9 +1,8 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//نقش کاربر
public class UserRoleConfiguration : IEntityTypeConfiguration<UserRole>
{
public void Configure(EntityTypeBuilder<UserRole> builder)
@@ -22,5 +21,6 @@ public class UserRoleConfiguration : IEntityTypeConfiguration<UserRole>
.WithMany(entity => entity.UserRoles)
.HasForeignKey(entity => entity.UserId)
.IsRequired(true);
}
}
}

View File

@@ -13,11 +13,13 @@ public class UserWalletChangeLogConfiguration : IEntityTypeConfiguration<UserWal
builder.Property(entity => entity.Id).UseIdentityColumn();
builder
.HasOne(entity => entity.Wallet)
.WithMany(entity => entity.UserWalletChangeLogs)
.WithMany(entity => entity.WalletUserWalletChangeLogs)
.HasForeignKey(entity => entity.WalletId)
.IsRequired(true);
builder.Property(entity => entity.CurrentBalance).IsRequired(true);
builder.Property(entity => entity.ChangeValue).IsRequired(true);
builder.Property(entity => entity.CurrentNetworkBalance).IsRequired(true);
builder.Property(entity => entity.ChangeNerworkValue).IsRequired(true);
builder.Property(entity => entity.IsIncrease).IsRequired(true);
builder.Property(entity => entity.RefrenceId).IsRequired(false);

View File

@@ -17,6 +17,7 @@ public class UserWalletConfiguration : IEntityTypeConfiguration<UserWallet>
.HasForeignKey(entity => entity.UserId)
.IsRequired(true);
builder.Property(entity => entity.Balance).IsRequired(true);
builder.Property(entity => entity.NetworkBalance).IsRequired(true);
}
}