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

@@ -17,4 +17,3 @@ public record CreateNewCategoryCommand : IRequest<CreateNewCategoryResponseDto>
public int SortOrder { get; init; } public int SortOrder { get; init; }
} }

View File

@@ -5,4 +5,3 @@ public class CreateNewCategoryResponseDto
public long Id { get; set; } public long Id { get; set; }
} }

View File

@@ -5,4 +5,3 @@ public record DeleteCategoryCommand : IRequest<Unit>
public long Id { get; init; } public long Id { get; init; }
} }

View File

@@ -14,4 +14,3 @@ public class DeleteCategoryCommandValidator : AbstractValidator<DeleteCategoryCo
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -19,4 +19,3 @@ public record UpdateCategoryCommand : IRequest<Unit>
public int SortOrder { get; init; } public int SortOrder { get; init; }
} }

View File

@@ -8,8 +8,7 @@ public record GetAllCategoryByFilterQuery : IRequest<GetAllCategoryByFilterRespo
//فیلتر //فیلتر
public GetAllCategoryByFilterFilter? Filter { get; init; } public GetAllCategoryByFilterFilter? Filter { get; init; }
} }public class GetAllCategoryByFilterFilter
public class GetAllCategoryByFilterFilter
{ {
//شناسه //شناسه
public long? Id { get; set; } public long? Id { get; set; }
@@ -28,4 +27,3 @@ public class GetAllCategoryByFilterFilter
//ترتیب نمایش //ترتیب نمایش
public int? SortOrder { get; set; } public int? SortOrder { get; set; }
} }

View File

@@ -12,4 +12,3 @@ public class GetAllCategoryByFilterQueryValidator : AbstractValidator<GetAllCate
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -6,8 +6,7 @@ public class GetAllCategoryByFilterResponseDto
//مدل خروجی //مدل خروجی
public List<GetAllCategoryByFilterResponseModel>? Models { get; set; } public List<GetAllCategoryByFilterResponseModel>? Models { get; set; }
} }public class GetAllCategoryByFilterResponseModel
public class GetAllCategoryByFilterResponseModel
{ {
//شناسه //شناسه
public long Id { get; set; } public long Id { get; set; }
@@ -26,4 +25,3 @@ public class GetAllCategoryByFilterResponseModel
//ترتیب نمایش //ترتیب نمایش
public int SortOrder { get; set; } public int SortOrder { get; set; }
} }

View File

@@ -5,4 +5,3 @@ public record GetCategoryQuery : IRequest<GetCategoryResponseDto>
public long Id { get; init; } public long Id { get; init; }
} }

View File

@@ -14,4 +14,3 @@ public class GetCategoryQueryValidator : AbstractValidator<GetCategoryQuery>
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -19,4 +19,3 @@ public class GetCategoryResponseDto
public int SortOrder { get; set; } public int SortOrder { get; set; }
} }

View File

@@ -7,21 +7,21 @@ public interface IApplicationDbContext
DbSet<Role> Roles { get; } DbSet<Role> Roles { get; }
DbSet<Category> Categorys { get; } DbSet<Category> Categorys { get; }
DbSet<UserRole> UserRoles { get; } DbSet<UserRole> UserRoles { get; }
DbSet<UserWallet> UserWallets { get; }
DbSet<UserWalletChangeLog> UserWalletChangeLogs { get; }
DbSet<UserCarts> UserCartss { get; } DbSet<UserCarts> UserCartss { get; }
DbSet<ProductGallerys> ProductGalleryss { get; } DbSet<ProductGallerys> ProductGalleryss { get; }
DbSet<UserOrder> UserOrders { get; }
DbSet<FactorDetails> FactorDetailss { get; } DbSet<FactorDetails> FactorDetailss { get; }
DbSet<Products> Productss { get; } DbSet<Products> Productss { get; }
DbSet<ProductImages> ProductImagess { get; } DbSet<ProductImages> ProductImagess { get; }
DbSet<Transactions> Transactionss { get; }
DbSet<User> Users { get; } DbSet<User> Users { get; }
DbSet<OtpToken> OtpTokens { get; } DbSet<OtpToken> OtpTokens { get; }
DbSet<Contract> Contracts { get; } DbSet<Contract> Contracts { get; }
DbSet<UserContract> UserContracts { get; } DbSet<UserContract> UserContracts { get; }
DbSet<PruductCategory> PruductCategorys { get; }
DbSet<Tag> Tags { get; } DbSet<Tag> Tags { get; }
DbSet<PruductCategory> PruductCategorys { get; }
DbSet<PruductTag> PruductTags { get; } DbSet<PruductTag> PruductTags { get; }
DbSet<Transactions> Transactionss { get; }
DbSet<UserOrder> UserOrders { get; }
DbSet<UserWallet> UserWallets { get; }
DbSet<UserWalletChangeLog> UserWalletChangeLogs { get; }
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default); Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
} }

View File

@@ -5,4 +5,3 @@ public class CreateNewPruductTagResponseDto
public long Id { get; set; } public long Id { get; set; }
} }

View File

@@ -5,4 +5,3 @@ public record DeletePruductTagCommand : IRequest<Unit>
public long Id { get; init; } public long Id { get; init; }
} }

View File

@@ -14,4 +14,3 @@ public class DeletePruductTagCommandValidator : AbstractValidator<DeletePruductT
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -12,4 +12,3 @@ public class GetAllPruductTagByFilterQueryValidator : AbstractValidator<GetAllPr
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -5,4 +5,3 @@ public record GetPruductTagQuery : IRequest<GetPruductTagResponseDto>
public long Id { get; init; } public long Id { get; init; }
} }

View File

@@ -14,4 +14,3 @@ public class GetPruductTagQueryValidator : AbstractValidator<GetPruductTagQuery>
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -13,4 +13,3 @@ public record CreateNewTagCommand : IRequest<CreateNewTagResponseDto>
public int SortOrder { get; init; } public int SortOrder { get; init; }
} }

View File

@@ -5,4 +5,3 @@ public class CreateNewTagResponseDto
public long Id { get; set; } public long Id { get; set; }
} }

View File

@@ -5,4 +5,3 @@ public record DeleteTagCommand : IRequest<Unit>
public long Id { get; init; } public long Id { get; init; }
} }

View File

@@ -14,4 +14,3 @@ public class DeleteTagCommandValidator : AbstractValidator<DeleteTagCommand>
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -15,4 +15,3 @@ public record UpdateTagCommand : IRequest<Unit>
public int SortOrder { get; init; } public int SortOrder { get; init; }
} }

View File

@@ -8,8 +8,7 @@ public record GetAllTagByFilterQuery : IRequest<GetAllTagByFilterResponseDto>
//فیلتر //فیلتر
public GetAllTagByFilterFilter? Filter { get; init; } public GetAllTagByFilterFilter? Filter { get; init; }
} }public class GetAllTagByFilterFilter
public class GetAllTagByFilterFilter
{ {
//شناسه //شناسه
public long? Id { get; set; } public long? Id { get; set; }
@@ -24,4 +23,3 @@ public class GetAllTagByFilterFilter
//ترتیب نمایش //ترتیب نمایش
public int? SortOrder { get; set; } public int? SortOrder { get; set; }
} }

View File

@@ -12,4 +12,3 @@ public class GetAllTagByFilterQueryValidator : AbstractValidator<GetAllTagByFilt
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -6,8 +6,7 @@ public class GetAllTagByFilterResponseDto
//مدل خروجی //مدل خروجی
public List<GetAllTagByFilterResponseModel>? Models { get; set; } public List<GetAllTagByFilterResponseModel>? Models { get; set; }
} }public class GetAllTagByFilterResponseModel
public class GetAllTagByFilterResponseModel
{ {
//شناسه //شناسه
public long Id { get; set; } public long Id { get; set; }
@@ -22,4 +21,3 @@ public class GetAllTagByFilterResponseModel
//ترتیب نمایش //ترتیب نمایش
public int SortOrder { get; set; } public int SortOrder { get; set; }
} }

View File

@@ -5,4 +5,3 @@ public record GetTagQuery : IRequest<GetTagResponseDto>
public long Id { get; init; } public long Id { get; init; }
} }

View File

@@ -14,4 +14,3 @@ public class GetTagQueryValidator : AbstractValidator<GetTagQuery>
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -15,4 +15,3 @@ public class GetTagResponseDto
public int SortOrder { get; set; } public int SortOrder { get; set; }
} }

View File

@@ -5,5 +5,7 @@ public record CreateNewUserWalletCommand : IRequest<CreateNewUserWalletResponseD
public long UserId { get; init; } public long UserId { get; init; }
//موجودی //موجودی
public long Balance { get; init; } public long Balance { get; init; }
//موجودی شبکه
public long NetworkBalance { get; init; }
} }

View File

@@ -7,6 +7,8 @@ public class CreateNewUserWalletCommandValidator : AbstractValidator<CreateNewUs
.NotNull(); .NotNull();
RuleFor(model => model.Balance) RuleFor(model => model.Balance)
.NotNull(); .NotNull();
RuleFor(model => model.NetworkBalance)
.NotNull();
} }
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) => public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{ {

View File

@@ -7,5 +7,7 @@ public record UpdateUserWalletCommand : IRequest<Unit>
public long UserId { get; init; } public long UserId { get; init; }
//موجودی //موجودی
public long Balance { get; init; } public long Balance { get; init; }
//موجودی شبکه
public long NetworkBalance { get; init; }
} }

View File

@@ -9,6 +9,8 @@ public class UpdateUserWalletCommandValidator : AbstractValidator<UpdateUserWall
.NotNull(); .NotNull();
RuleFor(model => model.Balance) RuleFor(model => model.Balance)
.NotNull(); .NotNull();
RuleFor(model => model.NetworkBalance)
.NotNull();
} }
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) => public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{ {

View File

@@ -16,4 +16,6 @@ public record GetAllUserWalletByFilterQuery : IRequest<GetAllUserWalletByFilterR
public long? UserId { get; set; } public long? UserId { get; set; }
//موجودی //موجودی
public long? Balance { get; set; } public long? Balance { get; set; }
//موجودی شبکه
public long NetworkBalance { get; set; }
} }

View File

@@ -14,4 +14,6 @@ public class GetAllUserWalletByFilterResponseDto
public long UserId { get; set; } public long UserId { get; set; }
//موجودی //موجودی
public long Balance { get; set; } public long Balance { get; set; }
//موجودی شبکه
public long NetworkBalance { get; set; }
} }

View File

@@ -7,5 +7,7 @@ public class GetUserWalletResponseDto
public long UserId { get; set; } public long UserId { get; set; }
//موجودی //موجودی
public long Balance { get; set; } public long Balance { get; set; }
//موجودی شبکه
public long NetworkBalance { get; set; }
} }

View File

@@ -7,6 +7,10 @@ public record CreateNewUserWalletChangeLogCommand : IRequest<CreateNewUserWallet
public long CurrentBalance { get; init; } public long CurrentBalance { get; init; }
//تغییر موجودی //تغییر موجودی
public long ChangeValue { get; init; } public long ChangeValue { get; init; }
//موجودی جاری شبکه
public long CurrentNetworkBalance { get; init; }
//تغییر موجودی شبکه
public long ChangeNerworkValue { get; init; }
//افزایشی؟ //افزایشی؟
public bool IsIncrease { get; init; } public bool IsIncrease { get; init; }
//شناسه ارجاع //شناسه ارجاع

View File

@@ -9,6 +9,10 @@ public class CreateNewUserWalletChangeLogCommandValidator : AbstractValidator<Cr
.NotNull(); .NotNull();
RuleFor(model => model.ChangeValue) RuleFor(model => model.ChangeValue)
.NotNull(); .NotNull();
RuleFor(model => model.CurrentNetworkBalance)
.NotNull();
RuleFor(model => model.ChangeNerworkValue)
.NotNull();
RuleFor(model => model.IsIncrease) RuleFor(model => model.IsIncrease)
.NotNull(); .NotNull();
} }

View File

@@ -9,6 +9,10 @@ public record UpdateUserWalletChangeLogCommand : IRequest<Unit>
public long CurrentBalance { get; init; } public long CurrentBalance { get; init; }
//تغییر موجودی //تغییر موجودی
public long ChangeValue { get; init; } public long ChangeValue { get; init; }
//موجودی جاری شبکه
public long CurrentNetworkBalance { get; init; }
//تغییر موجودی شبکه
public long ChangeNerworkValue { get; init; }
//افزایشی؟ //افزایشی؟
public bool IsIncrease { get; init; } public bool IsIncrease { get; init; }
//شناسه ارجاع //شناسه ارجاع

View File

@@ -11,6 +11,10 @@ public class UpdateUserWalletChangeLogCommandValidator : AbstractValidator<Updat
.NotNull(); .NotNull();
RuleFor(model => model.ChangeValue) RuleFor(model => model.ChangeValue)
.NotNull(); .NotNull();
RuleFor(model => model.CurrentNetworkBalance)
.NotNull();
RuleFor(model => model.ChangeNerworkValue)
.NotNull();
RuleFor(model => model.IsIncrease) RuleFor(model => model.IsIncrease)
.NotNull(); .NotNull();
} }

View File

@@ -16,6 +16,10 @@ public class GetAllUserWalletChangeLogByFilterResponseDto
public long CurrentBalance { get; set; } public long CurrentBalance { get; set; }
//تغییر موجودی //تغییر موجودی
public long ChangeValue { get; set; } public long ChangeValue { get; set; }
//موجودی جاری شبکه
public long CurrentNetworkBalance { get; set; }
//تغییر موجودی شبکه
public long ChangeNerworkValue { get; set; }
//افزایشی؟ //افزایشی؟
public bool IsIncrease { get; set; } public bool IsIncrease { get; set; }
//شناسه ارجاع //شناسه ارجاع

View File

@@ -9,6 +9,10 @@ public class GetUserWalletChangeLogResponseDto
public long CurrentBalance { get; set; } public long CurrentBalance { get; set; }
//تغییر موجودی //تغییر موجودی
public long ChangeValue { get; set; } public long ChangeValue { get; set; }
//موجودی جاری شبکه
public long CurrentNetworkBalance { get; set; }
//تغییر موجودی شبکه
public long ChangeNerworkValue { get; set; }
//افزایشی؟ //افزایشی؟
public bool IsIncrease { get; set; } public bool IsIncrease { get; set; }
//شناسه ارجاع //شناسه ارجاع

View File

@@ -15,4 +15,3 @@ public class Tag : BaseAuditableEntity
//PruductTag Collection Navigation Reference //PruductTag Collection Navigation Reference
public virtual ICollection<PruductTag> PruductTags { get; set; } public virtual ICollection<PruductTag> PruductTags { get; set; }
} }

View File

@@ -40,14 +40,14 @@ public class User : BaseAuditableEntity
public virtual ICollection<UserAddress> UserAddresss { get; set; } public virtual ICollection<UserAddress> UserAddresss { get; set; }
//UserRole Collection Navigation Reference //UserRole Collection Navigation Reference
public virtual ICollection<UserRole> UserRoles { get; set; } public virtual ICollection<UserRole> UserRoles { get; set; }
//UserWallet Collection Navigation Reference
public virtual ICollection<UserWallet> UserWallets { get; set; }
//UserCarts Collection Navigation Reference //UserCarts Collection Navigation Reference
public virtual ICollection<UserCarts> UserCartss { get; set; } public virtual ICollection<UserCarts> UserCartss { get; set; }
//UserOrder Collection Navigation Reference
public virtual ICollection<UserOrder> UserOrders { get; set; }
//User Collection Navigation Reference //User Collection Navigation Reference
public virtual ICollection<User> Users { get; set; } public virtual ICollection<User> Users { get; set; }
//UserContract Collection Navigation Reference //UserContract Collection Navigation Reference
public virtual ICollection<UserContract> UserContracts { get; set; } public virtual ICollection<UserContract> UserContracts { get; set; }
//UserOrder Collection Navigation Reference
public virtual ICollection<UserOrder> UserOrders { get; set; }
//UserWallet Collection Navigation Reference
public virtual ICollection<UserWallet> UserWallets { get; set; }
} }

View File

@@ -8,6 +8,8 @@ public class UserWallet : BaseAuditableEntity
public virtual User User { get; set; } public virtual User User { get; set; }
//موجودی //موجودی
public long Balance { get; set; } public long Balance { get; set; }
//موجودی شبکه
public long NetworkBalance { get; set; }
//UserWalletChangeLog Collection Navigation Reference //UserWalletChangeLog Collection Navigation Reference
public virtual ICollection<UserWalletChangeLog> UserWalletChangeLogs { get; set; } public virtual ICollection<UserWalletChangeLog> UserWalletChangeLogs { get; set; }
} }

View File

@@ -10,6 +10,10 @@ public class UserWalletChangeLog : BaseAuditableEntity
public long CurrentBalance { get; set; } public long CurrentBalance { get; set; }
//تغییر موجودی //تغییر موجودی
public long ChangeValue { get; set; } public long ChangeValue { get; set; }
//موجودی جاری شبکه
public long CurrentNetworkBalance { get; set; }
//تغییر موجودی شبکه
public long ChangeNerworkValue { get; set; }
//افزایشی؟ //افزایشی؟
public bool IsIncrease { get; set; } public bool IsIncrease { get; set; }
//شناسه ارجاع //شناسه ارجاع

View File

@@ -44,20 +44,20 @@ public class ApplicationDbContext : DbContext, IApplicationDbContext
public DbSet<Role> Roles => Set<Role>(); public DbSet<Role> Roles => Set<Role>();
public DbSet<Category> Categorys => Set<Category>(); public DbSet<Category> Categorys => Set<Category>();
public DbSet<UserRole> UserRoles => Set<UserRole>(); 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<UserCarts> UserCartss => Set<UserCarts>();
public DbSet<ProductGallerys> ProductGalleryss => Set<ProductGallerys>(); public DbSet<ProductGallerys> ProductGalleryss => Set<ProductGallerys>();
public DbSet<UserOrder> UserOrders => Set<UserOrder>();
public DbSet<FactorDetails> FactorDetailss => Set<FactorDetails>(); public DbSet<FactorDetails> FactorDetailss => Set<FactorDetails>();
public DbSet<Products> Productss => Set<Products>(); public DbSet<Products> Productss => Set<Products>();
public DbSet<ProductImages> ProductImagess => Set<ProductImages>(); public DbSet<ProductImages> ProductImagess => Set<ProductImages>();
public DbSet<Transactions> Transactionss => Set<Transactions>();
public DbSet<User> Users => Set<User>(); public DbSet<User> Users => Set<User>();
public DbSet<OtpToken> OtpTokens => Set<OtpToken>(); public DbSet<OtpToken> OtpTokens => Set<OtpToken>();
public DbSet<Contract> Contracts => Set<Contract>(); public DbSet<Contract> Contracts => Set<Contract>();
public DbSet<UserContract> UserContracts => Set<UserContract>(); public DbSet<UserContract> UserContracts => Set<UserContract>();
public DbSet<PruductCategory> PruductCategorys => Set<PruductCategory>();
public DbSet<Tag> Tags => Set<Tag>(); public DbSet<Tag> Tags => Set<Tag>();
public DbSet<PruductCategory> PruductCategorys => Set<PruductCategory>();
public DbSet<PruductTag> PruductTags => Set<PruductTag>(); 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 CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations; namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//توکن Otp
public class OtpTokenConfiguration : IEntityTypeConfiguration<OtpToken> public class OtpTokenConfiguration : IEntityTypeConfiguration<OtpToken>
{ {
public void Configure(EntityTypeBuilder<OtpToken> builder) 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.ExpiresAt).IsRequired(true);
builder.Property(entity => entity.Attempts).IsRequired(true); builder.Property(entity => entity.Attempts).IsRequired(true);
builder.Property(entity => entity.IsUsed).IsRequired(true); builder.Property(entity => entity.IsUsed).IsRequired(true);
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -48,6 +48,7 @@ message CreateNewUserWalletRequest
{ {
int64 user_id = 1; int64 user_id = 1;
int64 balance = 2; int64 balance = 2;
int64 network_balance = 3;
} }
message CreateNewUserWalletResponse message CreateNewUserWalletResponse
{ {
@@ -58,6 +59,7 @@ message UpdateUserWalletRequest
int64 id = 1; int64 id = 1;
int64 user_id = 2; int64 user_id = 2;
int64 balance = 3; int64 balance = 3;
int64 network_balance = 4;
} }
message DeleteUserWalletRequest message DeleteUserWalletRequest
{ {
@@ -72,6 +74,7 @@ message GetUserWalletResponse
int64 id = 1; int64 id = 1;
int64 user_id = 2; int64 user_id = 2;
int64 balance = 3; int64 balance = 3;
int64 network_balance = 4;
} }
message GetAllUserWalletByFilterRequest message GetAllUserWalletByFilterRequest
{ {
@@ -84,6 +87,7 @@ message GetAllUserWalletByFilterFilter
google.protobuf.Int64Value id = 1; google.protobuf.Int64Value id = 1;
google.protobuf.Int64Value user_id = 2; google.protobuf.Int64Value user_id = 2;
google.protobuf.Int64Value balance = 3; google.protobuf.Int64Value balance = 3;
int64 network_balance = 4;
} }
message GetAllUserWalletByFilterResponse message GetAllUserWalletByFilterResponse
{ {
@@ -95,4 +99,5 @@ message GetAllUserWalletByFilterResponseModel
int64 id = 1; int64 id = 1;
int64 user_id = 2; int64 user_id = 2;
int64 balance = 3; int64 balance = 3;
int64 network_balance = 4;
} }

View File

@@ -49,8 +49,10 @@ message CreateNewUserWalletChangeLogRequest
int64 wallet_id = 1; int64 wallet_id = 1;
int64 current_balance = 2; int64 current_balance = 2;
int64 change_value = 3; int64 change_value = 3;
bool is_increase = 4; int64 current_network_balance = 4;
google.protobuf.Int64Value refrence_id = 5; int64 change_nerwork_value = 5;
bool is_increase = 6;
google.protobuf.Int64Value refrence_id = 7;
} }
message CreateNewUserWalletChangeLogResponse message CreateNewUserWalletChangeLogResponse
{ {
@@ -62,8 +64,10 @@ message UpdateUserWalletChangeLogRequest
int64 wallet_id = 2; int64 wallet_id = 2;
int64 current_balance = 3; int64 current_balance = 3;
int64 change_value = 4; int64 change_value = 4;
bool is_increase = 5; int64 current_network_balance = 5;
google.protobuf.Int64Value refrence_id = 6; int64 change_nerwork_value = 6;
bool is_increase = 7;
google.protobuf.Int64Value refrence_id = 8;
} }
message DeleteUserWalletChangeLogRequest message DeleteUserWalletChangeLogRequest
{ {
@@ -79,8 +83,10 @@ message GetUserWalletChangeLogResponse
int64 wallet_id = 2; int64 wallet_id = 2;
int64 current_balance = 3; int64 current_balance = 3;
int64 change_value = 4; int64 change_value = 4;
bool is_increase = 5; int64 current_network_balance = 5;
google.protobuf.Int64Value refrence_id = 6; int64 change_nerwork_value = 6;
bool is_increase = 7;
google.protobuf.Int64Value refrence_id = 8;
} }
message GetAllUserWalletChangeLogByFilterRequest message GetAllUserWalletChangeLogByFilterRequest
{ {
@@ -108,6 +114,8 @@ message GetAllUserWalletChangeLogByFilterResponseModel
int64 wallet_id = 2; int64 wallet_id = 2;
int64 current_balance = 3; int64 current_balance = 3;
int64 change_value = 4; int64 change_value = 4;
bool is_increase = 5; int64 current_network_balance = 5;
google.protobuf.Int64Value refrence_id = 6; int64 change_nerwork_value = 6;
bool is_increase = 7;
google.protobuf.Int64Value refrence_id = 8;
} }

View File

@@ -1,6 +1,5 @@
using FluentValidation; using FluentValidation;
using CMSMicroservice.Protobuf.Protos.Category; using CMSMicroservice.Protobuf.Protos.Category;
namespace CMSMicroservice.Protobuf.Validator.Category; namespace CMSMicroservice.Protobuf.Validator.Category;
public class CreateNewCategoryRequestValidator : AbstractValidator<CreateNewCategoryRequest> public class CreateNewCategoryRequestValidator : AbstractValidator<CreateNewCategoryRequest>

View File

@@ -17,4 +17,3 @@ public class DeletePruductTagRequestValidator : AbstractValidator<DeletePruductT
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -15,4 +15,3 @@ public class GetAllPruductTagByFilterRequestValidator : AbstractValidator<GetAll
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -17,4 +17,3 @@ public class GetPruductTagRequestValidator : AbstractValidator<GetPruductTagRequ
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -17,4 +17,3 @@ public class DeleteTagRequestValidator : AbstractValidator<DeleteTagRequest>
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -15,4 +15,3 @@ public class GetAllTagByFilterRequestValidator : AbstractValidator<GetAllTagByFi
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -17,4 +17,3 @@ public class GetTagRequestValidator : AbstractValidator<GetTagRequest>
return result.Errors.Select(e => e.ErrorMessage); return result.Errors.Select(e => e.ErrorMessage);
}; };
} }

View File

@@ -10,6 +10,8 @@ public class CreateNewUserWalletRequestValidator : AbstractValidator<CreateNewUs
.NotNull(); .NotNull();
RuleFor(model => model.Balance) RuleFor(model => model.Balance)
.NotNull(); .NotNull();
RuleFor(model => model.NetworkBalance)
.NotNull();
} }
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) => public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{ {

View File

@@ -12,6 +12,8 @@ public class UpdateUserWalletRequestValidator : AbstractValidator<UpdateUserWall
.NotNull(); .NotNull();
RuleFor(model => model.Balance) RuleFor(model => model.Balance)
.NotNull(); .NotNull();
RuleFor(model => model.NetworkBalance)
.NotNull();
} }
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) => public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{ {

View File

@@ -12,6 +12,10 @@ public class CreateNewUserWalletChangeLogRequestValidator : AbstractValidator<Cr
.NotNull(); .NotNull();
RuleFor(model => model.ChangeValue) RuleFor(model => model.ChangeValue)
.NotNull(); .NotNull();
RuleFor(model => model.CurrentNetworkBalance)
.NotNull();
RuleFor(model => model.ChangeNerworkValue)
.NotNull();
RuleFor(model => model.IsIncrease) RuleFor(model => model.IsIncrease)
.NotNull(); .NotNull();
} }

View File

@@ -14,6 +14,10 @@ public class UpdateUserWalletChangeLogRequestValidator : AbstractValidator<Updat
.NotNull(); .NotNull();
RuleFor(model => model.ChangeValue) RuleFor(model => model.ChangeValue)
.NotNull(); .NotNull();
RuleFor(model => model.CurrentNetworkBalance)
.NotNull();
RuleFor(model => model.ChangeNerworkValue)
.NotNull();
RuleFor(model => model.IsIncrease) RuleFor(model => model.IsIncrease)
.NotNull(); .NotNull();
} }

View File

@@ -8,4 +8,3 @@ public class PruductTagProfile : IRegister
// .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}"); // .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}");
} }
} }

View File

@@ -8,4 +8,3 @@ public class TagProfile : IRegister
// .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}"); // .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}");
} }
} }

View File

@@ -35,4 +35,3 @@ public class PruductTagService : PruductTagContract.PruductTagContractBase
return await _dispatchRequestToCQRS.Handle<GetAllPruductTagByFilterRequest, GetAllPruductTagByFilterQuery, GetAllPruductTagByFilterResponse>(request, context); return await _dispatchRequestToCQRS.Handle<GetAllPruductTagByFilterRequest, GetAllPruductTagByFilterQuery, GetAllPruductTagByFilterResponse>(request, context);
} }
} }

View File

@@ -35,4 +35,3 @@ public class TagService : TagContract.TagContractBase
return await _dispatchRequestToCQRS.Handle<GetAllTagByFilterRequest, GetAllTagByFilterQuery, GetAllTagByFilterResponse>(request, context); return await _dispatchRequestToCQRS.Handle<GetAllTagByFilterRequest, GetAllTagByFilterQuery, GetAllTagByFilterResponse>(request, context);
} }
} }