Generator Changes at 11/25/2025 1:59:23 AM +03:30
This commit is contained in:
@@ -16,5 +16,4 @@ public record CreateNewCategoryCommand : IRequest<CreateNewCategoryResponseDto>
|
||||
//ترتیب نمایش
|
||||
public int SortOrder { get; init; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,5 +4,4 @@ public class CreateNewCategoryResponseDto
|
||||
//شناسه
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,5 +4,4 @@ public record DeleteCategoryCommand : IRequest<Unit>
|
||||
//شناسه
|
||||
public long Id { get; init; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,4 +14,3 @@ public class DeleteCategoryCommandValidator : AbstractValidator<DeleteCategoryCo
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -18,5 +18,4 @@ public record UpdateCategoryCommand : IRequest<Unit>
|
||||
//ترتیب نمایش
|
||||
public int SortOrder { get; init; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,8 +8,7 @@ public record GetAllCategoryByFilterQuery : IRequest<GetAllCategoryByFilterRespo
|
||||
//فیلتر
|
||||
public GetAllCategoryByFilterFilter? Filter { get; init; }
|
||||
|
||||
}
|
||||
public class GetAllCategoryByFilterFilter
|
||||
}public class GetAllCategoryByFilterFilter
|
||||
{
|
||||
//شناسه
|
||||
public long? Id { get; set; }
|
||||
@@ -28,4 +27,3 @@ public class GetAllCategoryByFilterFilter
|
||||
//ترتیب نمایش
|
||||
public int? SortOrder { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@ public class GetAllCategoryByFilterQueryValidator : AbstractValidator<GetAllCate
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,7 @@ public class GetAllCategoryByFilterResponseDto
|
||||
//مدل خروجی
|
||||
public List<GetAllCategoryByFilterResponseModel>? Models { get; set; }
|
||||
|
||||
}
|
||||
public class GetAllCategoryByFilterResponseModel
|
||||
}public class GetAllCategoryByFilterResponseModel
|
||||
{
|
||||
//شناسه
|
||||
public long Id { get; set; }
|
||||
@@ -26,4 +25,3 @@ public class GetAllCategoryByFilterResponseModel
|
||||
//ترتیب نمایش
|
||||
public int SortOrder { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -4,5 +4,4 @@ public record GetCategoryQuery : IRequest<GetCategoryResponseDto>
|
||||
//شناسه
|
||||
public long Id { get; init; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,4 +14,3 @@ public class GetCategoryQueryValidator : AbstractValidator<GetCategoryQuery>
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -18,5 +18,4 @@ public class GetCategoryResponseDto
|
||||
//ترتیب نمایش
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,21 +7,21 @@ public interface IApplicationDbContext
|
||||
DbSet<Role> Roles { get; }
|
||||
DbSet<Category> Categorys { get; }
|
||||
DbSet<UserRole> UserRoles { get; }
|
||||
DbSet<UserWallet> UserWallets { get; }
|
||||
DbSet<UserWalletChangeLog> UserWalletChangeLogs { get; }
|
||||
DbSet<UserCarts> UserCartss { get; }
|
||||
DbSet<ProductGallerys> ProductGalleryss { get; }
|
||||
DbSet<UserOrder> UserOrders { get; }
|
||||
DbSet<FactorDetails> FactorDetailss { get; }
|
||||
DbSet<Products> Productss { get; }
|
||||
DbSet<ProductImages> ProductImagess { get; }
|
||||
DbSet<Transactions> Transactionss { get; }
|
||||
DbSet<User> Users { get; }
|
||||
DbSet<OtpToken> OtpTokens { get; }
|
||||
DbSet<Contract> Contracts { get; }
|
||||
DbSet<UserContract> UserContracts { get; }
|
||||
DbSet<PruductCategory> PruductCategorys { get; }
|
||||
DbSet<Tag> Tags { get; }
|
||||
DbSet<PruductCategory> PruductCategorys { 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);
|
||||
}
|
||||
@@ -4,5 +4,4 @@ public class CreateNewPruductTagResponseDto
|
||||
//شناسه
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,5 +4,4 @@ public record DeletePruductTagCommand : IRequest<Unit>
|
||||
//شناسه
|
||||
public long Id { get; init; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,4 +14,3 @@ public class DeletePruductTagCommandValidator : AbstractValidator<DeletePruductT
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@ public class GetAllPruductTagByFilterQueryValidator : AbstractValidator<GetAllPr
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,5 +4,4 @@ public record GetPruductTagQuery : IRequest<GetPruductTagResponseDto>
|
||||
//شناسه
|
||||
public long Id { get; init; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,4 +14,3 @@ public class GetPruductTagQueryValidator : AbstractValidator<GetPruductTagQuery>
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -12,5 +12,4 @@ public record CreateNewTagCommand : IRequest<CreateNewTagResponseDto>
|
||||
//ترتیب نمایش
|
||||
public int SortOrder { get; init; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,5 +4,4 @@ public class CreateNewTagResponseDto
|
||||
//شناسه
|
||||
public long Id { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,5 +4,4 @@ public record DeleteTagCommand : IRequest<Unit>
|
||||
//شناسه
|
||||
public long Id { get; init; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,4 +14,3 @@ public class DeleteTagCommandValidator : AbstractValidator<DeleteTagCommand>
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -14,5 +14,4 @@ public record UpdateTagCommand : IRequest<Unit>
|
||||
//ترتیب نمایش
|
||||
public int SortOrder { get; init; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,8 +8,7 @@ public record GetAllTagByFilterQuery : IRequest<GetAllTagByFilterResponseDto>
|
||||
//فیلتر
|
||||
public GetAllTagByFilterFilter? Filter { get; init; }
|
||||
|
||||
}
|
||||
public class GetAllTagByFilterFilter
|
||||
}public class GetAllTagByFilterFilter
|
||||
{
|
||||
//شناسه
|
||||
public long? Id { get; set; }
|
||||
@@ -24,4 +23,3 @@ public class GetAllTagByFilterFilter
|
||||
//ترتیب نمایش
|
||||
public int? SortOrder { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@ public class GetAllTagByFilterQueryValidator : AbstractValidator<GetAllTagByFilt
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,7 @@ public class GetAllTagByFilterResponseDto
|
||||
//مدل خروجی
|
||||
public List<GetAllTagByFilterResponseModel>? Models { get; set; }
|
||||
|
||||
}
|
||||
public class GetAllTagByFilterResponseModel
|
||||
}public class GetAllTagByFilterResponseModel
|
||||
{
|
||||
//شناسه
|
||||
public long Id { get; set; }
|
||||
@@ -22,4 +21,3 @@ public class GetAllTagByFilterResponseModel
|
||||
//ترتیب نمایش
|
||||
public int SortOrder { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -4,5 +4,4 @@ public record GetTagQuery : IRequest<GetTagResponseDto>
|
||||
//شناسه
|
||||
public long Id { get; init; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,4 +14,3 @@ public class GetTagQueryValidator : AbstractValidator<GetTagQuery>
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -14,5 +14,4 @@ public class GetTagResponseDto
|
||||
//ترتیب نمایش
|
||||
public int SortOrder { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,5 +5,7 @@ public record CreateNewUserWalletCommand : IRequest<CreateNewUserWalletResponseD
|
||||
public long UserId { get; init; }
|
||||
//موجودی
|
||||
public long Balance { get; init; }
|
||||
//موجودی شبکه
|
||||
public long NetworkBalance { get; init; }
|
||||
|
||||
}
|
||||
@@ -7,6 +7,8 @@ public class CreateNewUserWalletCommandValidator : AbstractValidator<CreateNewUs
|
||||
.NotNull();
|
||||
RuleFor(model => model.Balance)
|
||||
.NotNull();
|
||||
RuleFor(model => model.NetworkBalance)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
@@ -7,5 +7,7 @@ public record UpdateUserWalletCommand : IRequest<Unit>
|
||||
public long UserId { get; init; }
|
||||
//موجودی
|
||||
public long Balance { get; init; }
|
||||
//موجودی شبکه
|
||||
public long NetworkBalance { get; init; }
|
||||
|
||||
}
|
||||
@@ -9,6 +9,8 @@ public class UpdateUserWalletCommandValidator : AbstractValidator<UpdateUserWall
|
||||
.NotNull();
|
||||
RuleFor(model => model.Balance)
|
||||
.NotNull();
|
||||
RuleFor(model => model.NetworkBalance)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
@@ -16,4 +16,6 @@ public record GetAllUserWalletByFilterQuery : IRequest<GetAllUserWalletByFilterR
|
||||
public long? UserId { get; set; }
|
||||
//موجودی
|
||||
public long? Balance { get; set; }
|
||||
//موجودی شبکه
|
||||
public long NetworkBalance { get; set; }
|
||||
}
|
||||
|
||||
@@ -14,4 +14,6 @@ public class GetAllUserWalletByFilterResponseDto
|
||||
public long UserId { get; set; }
|
||||
//موجودی
|
||||
public long Balance { get; set; }
|
||||
//موجودی شبکه
|
||||
public long NetworkBalance { get; set; }
|
||||
}
|
||||
|
||||
@@ -7,5 +7,7 @@ public class GetUserWalletResponseDto
|
||||
public long UserId { get; set; }
|
||||
//موجودی
|
||||
public long Balance { get; set; }
|
||||
//موجودی شبکه
|
||||
public long NetworkBalance { get; set; }
|
||||
|
||||
}
|
||||
@@ -7,6 +7,10 @@ public record CreateNewUserWalletChangeLogCommand : IRequest<CreateNewUserWallet
|
||||
public long CurrentBalance { get; init; }
|
||||
//تغییر موجودی
|
||||
public long ChangeValue { get; init; }
|
||||
//موجودی جاری شبکه
|
||||
public long CurrentNetworkBalance { get; init; }
|
||||
//تغییر موجودی شبکه
|
||||
public long ChangeNerworkValue { get; init; }
|
||||
//افزایشی؟
|
||||
public bool IsIncrease { get; init; }
|
||||
//شناسه ارجاع
|
||||
|
||||
@@ -9,6 +9,10 @@ public class CreateNewUserWalletChangeLogCommandValidator : AbstractValidator<Cr
|
||||
.NotNull();
|
||||
RuleFor(model => model.ChangeValue)
|
||||
.NotNull();
|
||||
RuleFor(model => model.CurrentNetworkBalance)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ChangeNerworkValue)
|
||||
.NotNull();
|
||||
RuleFor(model => model.IsIncrease)
|
||||
.NotNull();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,10 @@ public record UpdateUserWalletChangeLogCommand : IRequest<Unit>
|
||||
public long CurrentBalance { get; init; }
|
||||
//تغییر موجودی
|
||||
public long ChangeValue { get; init; }
|
||||
//موجودی جاری شبکه
|
||||
public long CurrentNetworkBalance { get; init; }
|
||||
//تغییر موجودی شبکه
|
||||
public long ChangeNerworkValue { get; init; }
|
||||
//افزایشی؟
|
||||
public bool IsIncrease { get; init; }
|
||||
//شناسه ارجاع
|
||||
|
||||
@@ -11,6 +11,10 @@ public class UpdateUserWalletChangeLogCommandValidator : AbstractValidator<Updat
|
||||
.NotNull();
|
||||
RuleFor(model => model.ChangeValue)
|
||||
.NotNull();
|
||||
RuleFor(model => model.CurrentNetworkBalance)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ChangeNerworkValue)
|
||||
.NotNull();
|
||||
RuleFor(model => model.IsIncrease)
|
||||
.NotNull();
|
||||
}
|
||||
|
||||
@@ -16,6 +16,10 @@ public class GetAllUserWalletChangeLogByFilterResponseDto
|
||||
public long CurrentBalance { get; set; }
|
||||
//تغییر موجودی
|
||||
public long ChangeValue { get; set; }
|
||||
//موجودی جاری شبکه
|
||||
public long CurrentNetworkBalance { get; set; }
|
||||
//تغییر موجودی شبکه
|
||||
public long ChangeNerworkValue { get; set; }
|
||||
//افزایشی؟
|
||||
public bool IsIncrease { get; set; }
|
||||
//شناسه ارجاع
|
||||
|
||||
@@ -9,6 +9,10 @@ public class GetUserWalletChangeLogResponseDto
|
||||
public long CurrentBalance { get; set; }
|
||||
//تغییر موجودی
|
||||
public long ChangeValue { get; set; }
|
||||
//موجودی جاری شبکه
|
||||
public long CurrentNetworkBalance { get; set; }
|
||||
//تغییر موجودی شبکه
|
||||
public long ChangeNerworkValue { get; set; }
|
||||
//افزایشی؟
|
||||
public bool IsIncrease { get; set; }
|
||||
//شناسه ارجاع
|
||||
|
||||
@@ -2,16 +2,16 @@ namespace CMSMicroservice.Domain.Entities;
|
||||
//توکن Otp
|
||||
public class OtpToken : BaseAuditableEntity
|
||||
{
|
||||
//موبایل مقصد
|
||||
//موبایل مقصد
|
||||
public string Mobile { get; set; }
|
||||
//مقصود
|
||||
//مقصود
|
||||
public string Purpose { get; set; }
|
||||
//کد هش شده
|
||||
//کد هش شده
|
||||
public string CodeHash { get; set; }
|
||||
//زمان انقضا
|
||||
//زمان انقضا
|
||||
public DateTime ExpiresAt { get; set; }
|
||||
//شمارش تلاشها
|
||||
//شمارش تلاشها
|
||||
public int Attempts { get; set; }
|
||||
//موفق بود؟
|
||||
//موفق بود؟
|
||||
public bool IsUsed { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@ namespace CMSMicroservice.Domain.Entities;
|
||||
//پکیج
|
||||
public class Package : BaseAuditableEntity
|
||||
{
|
||||
//عنوان
|
||||
//عنوان
|
||||
public string Title { get; set; }
|
||||
//توضیحات
|
||||
//توضیحات
|
||||
public string Description { get; set; }
|
||||
//آدرس تصویر
|
||||
//آدرس تصویر
|
||||
public string ImagePath { get; set; }
|
||||
//قیمت
|
||||
//قیمت
|
||||
public long Price { get; set; }
|
||||
//UserOrder Collection Navigation Reference
|
||||
public virtual ICollection<UserOrder> UserOrders { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,10 @@ namespace CMSMicroservice.Domain.Entities;
|
||||
//نقش
|
||||
public class Role : BaseAuditableEntity
|
||||
{
|
||||
//نام لاتین
|
||||
//نام لاتین
|
||||
public string Name { get; set; }
|
||||
//عنوان
|
||||
//عنوان
|
||||
public string Title { get; set; }
|
||||
//UserRole Collection Navigation Reference
|
||||
public virtual ICollection<UserRole> UserRoles { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,17 +2,16 @@ namespace CMSMicroservice.Domain.Entities;
|
||||
//تگ
|
||||
public class Tag : BaseAuditableEntity
|
||||
{
|
||||
//نام لاتین
|
||||
//نام لاتین
|
||||
public string Name { get; set; }
|
||||
//عنوان
|
||||
//عنوان
|
||||
public string Title { get; set; }
|
||||
//توضیحات
|
||||
//توضیحات
|
||||
public string? Description { get; set; }
|
||||
//فعال؟
|
||||
//فعال؟
|
||||
public bool IsActive { get; set; }
|
||||
//ترتیب نمایش
|
||||
//ترتیب نمایش
|
||||
public int SortOrder { get; set; }
|
||||
//PruductTag Collection Navigation Reference
|
||||
public virtual ICollection<PruductTag> PruductTags { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,14 @@ public class User : BaseAuditableEntity
|
||||
public virtual ICollection<UserAddress> UserAddresss { get; set; }
|
||||
//UserRole Collection Navigation Reference
|
||||
public virtual ICollection<UserRole> UserRoles { get; set; }
|
||||
//UserWallet Collection Navigation Reference
|
||||
public virtual ICollection<UserWallet> UserWallets { get; set; }
|
||||
//UserCarts Collection Navigation Reference
|
||||
public virtual ICollection<UserCarts> UserCartss { get; set; }
|
||||
//UserOrder Collection Navigation Reference
|
||||
public virtual ICollection<UserOrder> UserOrders { get; set; }
|
||||
//User Collection Navigation Reference
|
||||
public virtual ICollection<User> Users { get; set; }
|
||||
//UserContract Collection Navigation Reference
|
||||
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; }
|
||||
}
|
||||
|
||||
@@ -2,20 +2,20 @@ namespace CMSMicroservice.Domain.Entities;
|
||||
//آدرس کاربر
|
||||
public class UserAddress : BaseAuditableEntity
|
||||
{
|
||||
//شناسه کاربر
|
||||
//شناسه کاربر
|
||||
public long UserId { get; set; }
|
||||
//User Navigation Property
|
||||
//User Navigation Property
|
||||
public virtual User User { get; set; }
|
||||
//عنوان
|
||||
//عنوان
|
||||
public string Title { get; set; }
|
||||
//آدرس
|
||||
//آدرس
|
||||
public string Address { get; set; }
|
||||
//کدپستی
|
||||
//کدپستی
|
||||
public string PostalCode { get; set; }
|
||||
//پیشفرض؟
|
||||
//پیشفرض؟
|
||||
public bool IsDefault { get; set; }
|
||||
//شناسه شهر
|
||||
//شناسه شهر
|
||||
public long CityId { get; set; }
|
||||
//UserOrder Collection Navigation Reference
|
||||
public virtual ICollection<UserOrder> UserOrders { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@ namespace CMSMicroservice.Domain.Entities;
|
||||
//نقش کاربر
|
||||
public class UserRole : BaseAuditableEntity
|
||||
{
|
||||
//شناسه نقش
|
||||
//شناسه نقش
|
||||
public long RoleId { get; set; }
|
||||
//Role Navigation Property
|
||||
//Role Navigation Property
|
||||
public virtual Role Role { get; set; }
|
||||
//شناسه کاربر
|
||||
//شناسه کاربر
|
||||
public long UserId { get; set; }
|
||||
//User Navigation Property
|
||||
//User Navigation Property
|
||||
public virtual User User { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@ public class UserWallet : BaseAuditableEntity
|
||||
public virtual User User { get; set; }
|
||||
//موجودی
|
||||
public long Balance { get; set; }
|
||||
//موجودی شبکه
|
||||
public long NetworkBalance { get; set; }
|
||||
//UserWalletChangeLog Collection Navigation Reference
|
||||
public virtual ICollection<UserWalletChangeLog> UserWalletChangeLogs { get; set; }
|
||||
}
|
||||
|
||||
@@ -10,6 +10,10 @@ public class UserWalletChangeLog : BaseAuditableEntity
|
||||
public long CurrentBalance { get; set; }
|
||||
//تغییر موجودی
|
||||
public long ChangeValue { get; set; }
|
||||
//موجودی جاری شبکه
|
||||
public long CurrentNetworkBalance { get; set; }
|
||||
//تغییر موجودی شبکه
|
||||
public long ChangeNerworkValue { get; set; }
|
||||
//افزایشی؟
|
||||
public bool IsIncrease { get; set; }
|
||||
//شناسه ارجاع
|
||||
|
||||
@@ -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>();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ message CreateNewUserWalletRequest
|
||||
{
|
||||
int64 user_id = 1;
|
||||
int64 balance = 2;
|
||||
int64 network_balance = 3;
|
||||
}
|
||||
message CreateNewUserWalletResponse
|
||||
{
|
||||
@@ -58,6 +59,7 @@ message UpdateUserWalletRequest
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
int64 balance = 3;
|
||||
int64 network_balance = 4;
|
||||
}
|
||||
message DeleteUserWalletRequest
|
||||
{
|
||||
@@ -72,6 +74,7 @@ message GetUserWalletResponse
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
int64 balance = 3;
|
||||
int64 network_balance = 4;
|
||||
}
|
||||
message GetAllUserWalletByFilterRequest
|
||||
{
|
||||
@@ -84,6 +87,7 @@ message GetAllUserWalletByFilterFilter
|
||||
google.protobuf.Int64Value id = 1;
|
||||
google.protobuf.Int64Value user_id = 2;
|
||||
google.protobuf.Int64Value balance = 3;
|
||||
int64 network_balance = 4;
|
||||
}
|
||||
message GetAllUserWalletByFilterResponse
|
||||
{
|
||||
@@ -95,4 +99,5 @@ message GetAllUserWalletByFilterResponseModel
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
int64 balance = 3;
|
||||
int64 network_balance = 4;
|
||||
}
|
||||
|
||||
@@ -49,8 +49,10 @@ message CreateNewUserWalletChangeLogRequest
|
||||
int64 wallet_id = 1;
|
||||
int64 current_balance = 2;
|
||||
int64 change_value = 3;
|
||||
bool is_increase = 4;
|
||||
google.protobuf.Int64Value refrence_id = 5;
|
||||
int64 current_network_balance = 4;
|
||||
int64 change_nerwork_value = 5;
|
||||
bool is_increase = 6;
|
||||
google.protobuf.Int64Value refrence_id = 7;
|
||||
}
|
||||
message CreateNewUserWalletChangeLogResponse
|
||||
{
|
||||
@@ -62,8 +64,10 @@ message UpdateUserWalletChangeLogRequest
|
||||
int64 wallet_id = 2;
|
||||
int64 current_balance = 3;
|
||||
int64 change_value = 4;
|
||||
bool is_increase = 5;
|
||||
google.protobuf.Int64Value refrence_id = 6;
|
||||
int64 current_network_balance = 5;
|
||||
int64 change_nerwork_value = 6;
|
||||
bool is_increase = 7;
|
||||
google.protobuf.Int64Value refrence_id = 8;
|
||||
}
|
||||
message DeleteUserWalletChangeLogRequest
|
||||
{
|
||||
@@ -79,8 +83,10 @@ message GetUserWalletChangeLogResponse
|
||||
int64 wallet_id = 2;
|
||||
int64 current_balance = 3;
|
||||
int64 change_value = 4;
|
||||
bool is_increase = 5;
|
||||
google.protobuf.Int64Value refrence_id = 6;
|
||||
int64 current_network_balance = 5;
|
||||
int64 change_nerwork_value = 6;
|
||||
bool is_increase = 7;
|
||||
google.protobuf.Int64Value refrence_id = 8;
|
||||
}
|
||||
message GetAllUserWalletChangeLogByFilterRequest
|
||||
{
|
||||
@@ -108,6 +114,8 @@ message GetAllUserWalletChangeLogByFilterResponseModel
|
||||
int64 wallet_id = 2;
|
||||
int64 current_balance = 3;
|
||||
int64 change_value = 4;
|
||||
bool is_increase = 5;
|
||||
google.protobuf.Int64Value refrence_id = 6;
|
||||
int64 current_network_balance = 5;
|
||||
int64 change_nerwork_value = 6;
|
||||
bool is_increase = 7;
|
||||
google.protobuf.Int64Value refrence_id = 8;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using FluentValidation;
|
||||
using CMSMicroservice.Protobuf.Protos.Category;
|
||||
|
||||
namespace CMSMicroservice.Protobuf.Validator.Category;
|
||||
|
||||
public class CreateNewCategoryRequestValidator : AbstractValidator<CreateNewCategoryRequest>
|
||||
|
||||
@@ -17,4 +17,3 @@ public class DeletePruductTagRequestValidator : AbstractValidator<DeletePruductT
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -15,4 +15,3 @@ public class GetAllPruductTagByFilterRequestValidator : AbstractValidator<GetAll
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -17,4 +17,3 @@ public class GetPruductTagRequestValidator : AbstractValidator<GetPruductTagRequ
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -17,4 +17,3 @@ public class DeleteTagRequestValidator : AbstractValidator<DeleteTagRequest>
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -15,4 +15,3 @@ public class GetAllTagByFilterRequestValidator : AbstractValidator<GetAllTagByFi
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -17,4 +17,3 @@ public class GetTagRequestValidator : AbstractValidator<GetTagRequest>
|
||||
return result.Errors.Select(e => e.ErrorMessage);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,8 @@ public class CreateNewUserWalletRequestValidator : AbstractValidator<CreateNewUs
|
||||
.NotNull();
|
||||
RuleFor(model => model.Balance)
|
||||
.NotNull();
|
||||
RuleFor(model => model.NetworkBalance)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
@@ -12,6 +12,8 @@ public class UpdateUserWalletRequestValidator : AbstractValidator<UpdateUserWall
|
||||
.NotNull();
|
||||
RuleFor(model => model.Balance)
|
||||
.NotNull();
|
||||
RuleFor(model => model.NetworkBalance)
|
||||
.NotNull();
|
||||
}
|
||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||
{
|
||||
|
||||
@@ -12,6 +12,10 @@ public class CreateNewUserWalletChangeLogRequestValidator : AbstractValidator<Cr
|
||||
.NotNull();
|
||||
RuleFor(model => model.ChangeValue)
|
||||
.NotNull();
|
||||
RuleFor(model => model.CurrentNetworkBalance)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ChangeNerworkValue)
|
||||
.NotNull();
|
||||
RuleFor(model => model.IsIncrease)
|
||||
.NotNull();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,10 @@ public class UpdateUserWalletChangeLogRequestValidator : AbstractValidator<Updat
|
||||
.NotNull();
|
||||
RuleFor(model => model.ChangeValue)
|
||||
.NotNull();
|
||||
RuleFor(model => model.CurrentNetworkBalance)
|
||||
.NotNull();
|
||||
RuleFor(model => model.ChangeNerworkValue)
|
||||
.NotNull();
|
||||
RuleFor(model => model.IsIncrease)
|
||||
.NotNull();
|
||||
}
|
||||
|
||||
@@ -8,4 +8,3 @@ public class PruductTagProfile : IRegister
|
||||
// .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,4 +8,3 @@ public class TagProfile : IRegister
|
||||
// .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,4 +35,3 @@ public class PruductTagService : PruductTagContract.PruductTagContractBase
|
||||
return await _dispatchRequestToCQRS.Handle<GetAllPruductTagByFilterRequest, GetAllPruductTagByFilterQuery, GetAllPruductTagByFilterResponse>(request, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,4 +35,3 @@ public class TagService : TagContract.TagContractBase
|
||||
return await _dispatchRequestToCQRS.Handle<GetAllTagByFilterRequest, GetAllTagByFilterQuery, GetAllTagByFilterResponse>(request, context);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user