Generator Changes at 11/12/2025 1:32:03 AM +03:30
This commit is contained in:
@@ -44,7 +44,14 @@ public class ApplicationDbContext : DbContext, IApplicationDbContext
|
||||
public DbSet<Role> Roles => Set<Role>();
|
||||
public DbSet<UserRole> UserRoles => Set<UserRole>();
|
||||
public DbSet<OtpToken> OtpTokens => Set<OtpToken>();
|
||||
public DbSet<UserOrder> UserOrders => Set<UserOrder>();
|
||||
public DbSet<User> Users => Set<User>();
|
||||
|
||||
}
|
||||
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>();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
//آدرس کاربر
|
||||
public class FactorDetailsConfiguration : IEntityTypeConfiguration<FactorDetails>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<FactorDetails> 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.Product)
|
||||
.WithMany(entity => entity.ProductFactorDetailss)
|
||||
.HasForeignKey(entity => entity.ProductId)
|
||||
.IsRequired(true);
|
||||
builder.Property(entity => entity.Count).IsRequired(true);
|
||||
builder.Property(entity => entity.UnitPrice).IsRequired(true);
|
||||
builder.Property(entity => entity.UnitDiscount).IsRequired(true);
|
||||
builder
|
||||
.HasOne(entity => entity.Order)
|
||||
.WithMany(entity => entity.OrderFactorDetailss)
|
||||
.HasForeignKey(entity => entity.OrderId)
|
||||
.IsRequired(true);
|
||||
builder.Property(entity => entity.UnitDiscountPrice).IsRequired(true);
|
||||
builder.Property(entity => entity.IsChangePrice).IsRequired(true);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
//توکن Otp
|
||||
public class ProductGallerysConfiguration : IEntityTypeConfiguration<ProductGallerys>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ProductGallerys> 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.ProductImage)
|
||||
.WithMany(entity => entity.ProductImageProductGalleryss)
|
||||
.HasForeignKey(entity => entity.ProductImageId)
|
||||
.IsRequired(true);
|
||||
builder
|
||||
.HasOne(entity => entity.Product)
|
||||
.WithMany(entity => entity.ProductProductGalleryss)
|
||||
.HasForeignKey(entity => entity.ProductId)
|
||||
.IsRequired(true);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
//توکن Otp
|
||||
public class ProductImagesConfiguration : IEntityTypeConfiguration<ProductImages>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<ProductImages> 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.ImagePath).IsRequired(true);
|
||||
builder.Property(entity => entity.ImageThumbnailPath).IsRequired(true);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
//توکن Otp
|
||||
public class ProductsConfiguration : IEntityTypeConfiguration<Products>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Products> 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.ShortInfomation).IsRequired(true);
|
||||
builder.Property(entity => entity.FullInformation).IsRequired(true);
|
||||
builder.Property(entity => entity.Price).IsRequired(true);
|
||||
builder.Property(entity => entity.Discount).IsRequired(true);
|
||||
builder.Property(entity => entity.Rate).IsRequired(true);
|
||||
builder.Property(entity => entity.ImagePath).IsRequired(true);
|
||||
builder.Property(entity => entity.ThumbnailPath).IsRequired(true);
|
||||
builder.Property(entity => entity.SaleCount).IsRequired(true);
|
||||
builder.Property(entity => entity.ViewCount).IsRequired(true);
|
||||
builder.Property(entity => entity.RemainingCount).IsRequired(true);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
//آدرس کاربر
|
||||
public class TransactionsConfiguration : IEntityTypeConfiguration<Transactions>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Transactions> 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.MerchantId).IsRequired(true);
|
||||
builder.Property(entity => entity.Amount).IsRequired(true);
|
||||
builder.Property(entity => entity.CallbackUrl).IsRequired(true);
|
||||
builder.Property(entity => entity.Description).IsRequired(true);
|
||||
builder.Property(entity => entity.Mobile).IsRequired(false);
|
||||
builder.Property(entity => entity.Email).IsRequired(false);
|
||||
builder.Property(entity => entity.RequestStatusCode).IsRequired(false);
|
||||
builder.Property(entity => entity.RequestStatusMessage).IsRequired(false);
|
||||
builder.Property(entity => entity.Authority).IsRequired(false);
|
||||
builder.Property(entity => entity.FeeType).IsRequired(false);
|
||||
builder.Property(entity => entity.Fee).IsRequired(false);
|
||||
builder.Property(entity => entity.Currency).IsRequired(false);
|
||||
builder.Property(entity => entity.PaymentStatus).IsRequired(true);
|
||||
builder.Property(entity => entity.PaymentDate).IsRequired(false);
|
||||
builder.Property(entity => entity.VerificationStatusCode).IsRequired(false);
|
||||
builder.Property(entity => entity.VerificationStatusMessage).IsRequired(false);
|
||||
builder.Property(entity => entity.CardHash).IsRequired(false);
|
||||
builder.Property(entity => entity.CardPan).IsRequired(false);
|
||||
builder.Property(entity => entity.RefId).IsRequired(false);
|
||||
builder
|
||||
.HasOne(entity => entity.Order)
|
||||
.WithMany(entity => entity.OrderTransactionss)
|
||||
.HasForeignKey(entity => entity.OrderId)
|
||||
.IsRequired(false);
|
||||
builder.Property(entity => entity.Type).IsRequired(true);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
//آدرس کاربر
|
||||
public class UserCartsConfiguration : IEntityTypeConfiguration<UserCarts>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<UserCarts> 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.Product)
|
||||
.WithMany(entity => entity.ProductUserCartss)
|
||||
.HasForeignKey(entity => entity.ProductId)
|
||||
.IsRequired(true);
|
||||
builder
|
||||
.HasOne(entity => entity.User)
|
||||
.WithMany(entity => entity.UserCartss)
|
||||
.HasForeignKey(entity => entity.UserId)
|
||||
.IsRequired(true);
|
||||
builder.Property(entity => entity.Count).IsRequired(true);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
//آدرس کاربر
|
||||
public class UserWalletChangeLogConfiguration : IEntityTypeConfiguration<UserWalletChangeLog>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<UserWalletChangeLog> 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.Wallet)
|
||||
.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.IsIncrease).IsRequired(true);
|
||||
builder.Property(entity => entity.RefrenceId).IsRequired(false);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
//آدرس کاربر
|
||||
public class UserWalletConfiguration : IEntityTypeConfiguration<UserWallet>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<UserWallet> 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.UserWallets)
|
||||
.HasForeignKey(entity => entity.UserId)
|
||||
.IsRequired(true);
|
||||
builder.Property(entity => entity.Balance).IsRequired(true);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user