From 92a9a0e75db6f1ea88bee8cd7c6418254072d2ce Mon Sep 17 00:00:00 2001 From: masoodafar-web Date: Tue, 25 Nov 2025 02:03:51 +0330 Subject: [PATCH] =?UTF-8?q?Generator=20Changes=20at=2011/25/2025=201:59:23?= =?UTF-8?q?=E2=80=AFAM=20+03:30?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CreateNewCategoryCommand.cs | 3 +-- .../CreateNewCategoryResponseDto.cs | 3 +-- .../DeleteCategory/DeleteCategoryCommand.cs | 3 +-- .../DeleteCategoryCommandValidator.cs | 1 - .../UpdateCategory/UpdateCategoryCommand.cs | 3 +-- .../GetAllCategoryByFilterQuery.cs | 4 +--- .../GetAllCategoryByFilterQueryValidator.cs | 1 - .../GetAllCategoryByFilterResponseDto.cs | 4 +--- .../Queries/GetCategory/GetCategoryQuery.cs | 3 +-- .../GetCategory/GetCategoryQueryValidator.cs | 1 - .../GetCategory/GetCategoryResponseDto.cs | 3 +-- .../Interfaces/IApplicationDbContext.cs | 10 ++++---- .../CreateNewPruductTagResponseDto.cs | 3 +-- .../DeletePruductTagCommand.cs | 3 +-- .../DeletePruductTagCommandValidator.cs | 1 - .../GetAllPruductTagByFilterQueryValidator.cs | 1 - .../GetPruductTag/GetPruductTagQuery.cs | 3 +-- .../GetPruductTagQueryValidator.cs | 1 - .../CreateNewTag/CreateNewTagCommand.cs | 3 +-- .../CreateNewTag/CreateNewTagResponseDto.cs | 3 +-- .../Commands/DeleteTag/DeleteTagCommand.cs | 3 +-- .../DeleteTag/DeleteTagCommandValidator.cs | 1 - .../Commands/UpdateTag/UpdateTagCommand.cs | 3 +-- .../GetAllTagByFilterQuery.cs | 4 +--- .../GetAllTagByFilterQueryValidator.cs | 1 - .../GetAllTagByFilterResponseDto.cs | 4 +--- .../TagCQ/Queries/GetTag/GetTagQuery.cs | 3 +-- .../Queries/GetTag/GetTagQueryValidator.cs | 1 - .../TagCQ/Queries/GetTag/GetTagResponseDto.cs | 3 +-- .../CreateNewUserWalletCommand.cs | 2 ++ .../CreateNewUserWalletCommandValidator.cs | 2 ++ .../UpdateUserWalletCommand.cs | 2 ++ .../UpdateUserWalletCommandValidator.cs | 2 ++ .../GetAllUserWalletByFilterQuery.cs | 2 ++ .../GetAllUserWalletByFilterResponseDto.cs | 2 ++ .../GetUserWallet/GetUserWalletResponseDto.cs | 2 ++ .../CreateNewUserWalletChangeLogCommand.cs | 4 ++++ ...eNewUserWalletChangeLogCommandValidator.cs | 4 ++++ .../UpdateUserWalletChangeLogCommand.cs | 4 ++++ ...dateUserWalletChangeLogCommandValidator.cs | 4 ++++ ...lUserWalletChangeLogByFilterResponseDto.cs | 4 ++++ .../GetUserWalletChangeLogResponseDto.cs | 4 ++++ .../Entities/OtpToken.cs | 14 +++++------ .../Entities/Package.cs | 10 ++++---- src/CMSMicroservice.Domain/Entities/Role.cs | 6 ++--- src/CMSMicroservice.Domain/Entities/Tag.cs | 11 ++++----- src/CMSMicroservice.Domain/Entities/User.cs | 8 +++---- .../Entities/UserAddress.cs | 16 ++++++------- .../Entities/UserRole.cs | 10 ++++---- .../Entities/UserWallet.cs | 2 ++ .../Entities/UserWalletChangeLog.cs | 4 ++++ .../Persistence/ApplicationDbContext.cs | 10 ++++---- .../Configurations/OtpTokenConfiguration.cs | 6 ++--- .../Configurations/PackageConfiguration.cs | 6 ++--- .../Configurations/RoleConfiguration.cs | 6 ++--- .../Configurations/TagConfiguration.cs | 6 ++--- .../UserAddressConfiguration.cs | 6 ++--- .../Configurations/UserRoleConfiguration.cs | 6 ++--- .../UserWalletChangeLogConfiguration.cs | 4 +++- .../Configurations/UserWalletConfiguration.cs | 1 + .../Protos/userwallet.proto | 5 ++++ .../Protos/userwalletchangelog.proto | 24 ++++++++++++------- .../CreateNewCategoryRequestValidator.cs | 1 - .../DeletePruductTagRequestValidator.cs | 1 - ...etAllPruductTagByFilterRequestValidator.cs | 1 - .../GetPruductTagRequestValidator.cs | 1 - .../Tag/DeleteTagRequestValidator.cs | 1 - .../Tag/GetAllTagByFilterRequestValidator.cs | 1 - .../Validator/Tag/GetTagRequestValidator.cs | 1 - .../CreateNewUserWalletRequestValidator.cs | 2 ++ .../UpdateUserWalletRequestValidator.cs | 2 ++ ...eNewUserWalletChangeLogRequestValidator.cs | 4 ++++ ...dateUserWalletChangeLogRequestValidator.cs | 4 ++++ .../Common/Mappings/PruductTagProfile.cs | 1 - .../Common/Mappings/TagProfile.cs | 1 - .../Services/PruductTagService.cs | 1 - .../Services/TagService.cs | 1 - 77 files changed, 164 insertions(+), 138 deletions(-) diff --git a/src/CMSMicroservice.Application/CategoryCQ/Commands/CreateNewCategory/CreateNewCategoryCommand.cs b/src/CMSMicroservice.Application/CategoryCQ/Commands/CreateNewCategory/CreateNewCategoryCommand.cs index 9b9c965..334e0a9 100644 --- a/src/CMSMicroservice.Application/CategoryCQ/Commands/CreateNewCategory/CreateNewCategoryCommand.cs +++ b/src/CMSMicroservice.Application/CategoryCQ/Commands/CreateNewCategory/CreateNewCategoryCommand.cs @@ -16,5 +16,4 @@ public record CreateNewCategoryCommand : IRequest //ترتیب نمایش public int SortOrder { get; init; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/CategoryCQ/Commands/CreateNewCategory/CreateNewCategoryResponseDto.cs b/src/CMSMicroservice.Application/CategoryCQ/Commands/CreateNewCategory/CreateNewCategoryResponseDto.cs index 909ce7e..4a8f5e0 100644 --- a/src/CMSMicroservice.Application/CategoryCQ/Commands/CreateNewCategory/CreateNewCategoryResponseDto.cs +++ b/src/CMSMicroservice.Application/CategoryCQ/Commands/CreateNewCategory/CreateNewCategoryResponseDto.cs @@ -4,5 +4,4 @@ public class CreateNewCategoryResponseDto //شناسه public long Id { get; set; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/CategoryCQ/Commands/DeleteCategory/DeleteCategoryCommand.cs b/src/CMSMicroservice.Application/CategoryCQ/Commands/DeleteCategory/DeleteCategoryCommand.cs index a074791..70444a5 100644 --- a/src/CMSMicroservice.Application/CategoryCQ/Commands/DeleteCategory/DeleteCategoryCommand.cs +++ b/src/CMSMicroservice.Application/CategoryCQ/Commands/DeleteCategory/DeleteCategoryCommand.cs @@ -4,5 +4,4 @@ public record DeleteCategoryCommand : IRequest //شناسه public long Id { get; init; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/CategoryCQ/Commands/DeleteCategory/DeleteCategoryCommandValidator.cs b/src/CMSMicroservice.Application/CategoryCQ/Commands/DeleteCategory/DeleteCategoryCommandValidator.cs index 16c8024..31a0254 100644 --- a/src/CMSMicroservice.Application/CategoryCQ/Commands/DeleteCategory/DeleteCategoryCommandValidator.cs +++ b/src/CMSMicroservice.Application/CategoryCQ/Commands/DeleteCategory/DeleteCategoryCommandValidator.cs @@ -14,4 +14,3 @@ public class DeleteCategoryCommandValidator : AbstractValidator e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/CategoryCQ/Commands/UpdateCategory/UpdateCategoryCommand.cs b/src/CMSMicroservice.Application/CategoryCQ/Commands/UpdateCategory/UpdateCategoryCommand.cs index c77f59b..a40056a 100644 --- a/src/CMSMicroservice.Application/CategoryCQ/Commands/UpdateCategory/UpdateCategoryCommand.cs +++ b/src/CMSMicroservice.Application/CategoryCQ/Commands/UpdateCategory/UpdateCategoryCommand.cs @@ -18,5 +18,4 @@ public record UpdateCategoryCommand : IRequest //ترتیب نمایش public int SortOrder { get; init; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/CategoryCQ/Queries/GetAllCategoryByFilter/GetAllCategoryByFilterQuery.cs b/src/CMSMicroservice.Application/CategoryCQ/Queries/GetAllCategoryByFilter/GetAllCategoryByFilterQuery.cs index eb5b51c..b4fa256 100644 --- a/src/CMSMicroservice.Application/CategoryCQ/Queries/GetAllCategoryByFilter/GetAllCategoryByFilterQuery.cs +++ b/src/CMSMicroservice.Application/CategoryCQ/Queries/GetAllCategoryByFilter/GetAllCategoryByFilterQuery.cs @@ -8,8 +8,7 @@ public record GetAllCategoryByFilterQuery : IRequest e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/CategoryCQ/Queries/GetAllCategoryByFilter/GetAllCategoryByFilterResponseDto.cs b/src/CMSMicroservice.Application/CategoryCQ/Queries/GetAllCategoryByFilter/GetAllCategoryByFilterResponseDto.cs index cca5018..4edaf18 100644 --- a/src/CMSMicroservice.Application/CategoryCQ/Queries/GetAllCategoryByFilter/GetAllCategoryByFilterResponseDto.cs +++ b/src/CMSMicroservice.Application/CategoryCQ/Queries/GetAllCategoryByFilter/GetAllCategoryByFilterResponseDto.cs @@ -6,8 +6,7 @@ public class GetAllCategoryByFilterResponseDto //مدل خروجی public List? 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; } } - diff --git a/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryQuery.cs b/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryQuery.cs index 79551a6..ef9559b 100644 --- a/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryQuery.cs +++ b/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryQuery.cs @@ -4,5 +4,4 @@ public record GetCategoryQuery : IRequest //شناسه public long Id { get; init; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryQueryValidator.cs b/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryQueryValidator.cs index df3e0b3..0778291 100644 --- a/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryQueryValidator.cs +++ b/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryQueryValidator.cs @@ -14,4 +14,3 @@ public class GetCategoryQueryValidator : AbstractValidator return result.Errors.Select(e => e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryResponseDto.cs b/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryResponseDto.cs index 9297082..deee505 100644 --- a/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryResponseDto.cs +++ b/src/CMSMicroservice.Application/CategoryCQ/Queries/GetCategory/GetCategoryResponseDto.cs @@ -18,5 +18,4 @@ public class GetCategoryResponseDto //ترتیب نمایش public int SortOrder { get; set; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/Common/Interfaces/IApplicationDbContext.cs b/src/CMSMicroservice.Application/Common/Interfaces/IApplicationDbContext.cs index 28ac97c..f496789 100644 --- a/src/CMSMicroservice.Application/Common/Interfaces/IApplicationDbContext.cs +++ b/src/CMSMicroservice.Application/Common/Interfaces/IApplicationDbContext.cs @@ -7,21 +7,21 @@ public interface IApplicationDbContext DbSet Roles { get; } DbSet Categorys { get; } DbSet UserRoles { get; } - DbSet UserWallets { get; } - DbSet UserWalletChangeLogs { get; } DbSet UserCartss { get; } DbSet ProductGalleryss { get; } - DbSet UserOrders { get; } DbSet FactorDetailss { get; } DbSet Productss { get; } DbSet ProductImagess { get; } - DbSet Transactionss { get; } DbSet Users { get; } DbSet OtpTokens { get; } DbSet Contracts { get; } DbSet UserContracts { get; } - DbSet PruductCategorys { get; } DbSet Tags { get; } + DbSet PruductCategorys { get; } DbSet PruductTags { get; } + DbSet Transactionss { get; } + DbSet UserOrders { get; } + DbSet UserWallets { get; } + DbSet UserWalletChangeLogs { get; } Task SaveChangesAsync(CancellationToken cancellationToken = default); } \ No newline at end of file diff --git a/src/CMSMicroservice.Application/PruductTagCQ/Commands/CreateNewPruductTag/CreateNewPruductTagResponseDto.cs b/src/CMSMicroservice.Application/PruductTagCQ/Commands/CreateNewPruductTag/CreateNewPruductTagResponseDto.cs index 4cb2271..bd44e80 100644 --- a/src/CMSMicroservice.Application/PruductTagCQ/Commands/CreateNewPruductTag/CreateNewPruductTagResponseDto.cs +++ b/src/CMSMicroservice.Application/PruductTagCQ/Commands/CreateNewPruductTag/CreateNewPruductTagResponseDto.cs @@ -4,5 +4,4 @@ public class CreateNewPruductTagResponseDto //شناسه public long Id { get; set; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/PruductTagCQ/Commands/DeletePruductTag/DeletePruductTagCommand.cs b/src/CMSMicroservice.Application/PruductTagCQ/Commands/DeletePruductTag/DeletePruductTagCommand.cs index 6df655f..5783b3d 100644 --- a/src/CMSMicroservice.Application/PruductTagCQ/Commands/DeletePruductTag/DeletePruductTagCommand.cs +++ b/src/CMSMicroservice.Application/PruductTagCQ/Commands/DeletePruductTag/DeletePruductTagCommand.cs @@ -4,5 +4,4 @@ public record DeletePruductTagCommand : IRequest //شناسه public long Id { get; init; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/PruductTagCQ/Commands/DeletePruductTag/DeletePruductTagCommandValidator.cs b/src/CMSMicroservice.Application/PruductTagCQ/Commands/DeletePruductTag/DeletePruductTagCommandValidator.cs index 0362f79..5ed1795 100644 --- a/src/CMSMicroservice.Application/PruductTagCQ/Commands/DeletePruductTag/DeletePruductTagCommandValidator.cs +++ b/src/CMSMicroservice.Application/PruductTagCQ/Commands/DeletePruductTag/DeletePruductTagCommandValidator.cs @@ -14,4 +14,3 @@ public class DeletePruductTagCommandValidator : AbstractValidator e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetAllPruductTagByFilter/GetAllPruductTagByFilterQueryValidator.cs b/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetAllPruductTagByFilter/GetAllPruductTagByFilterQueryValidator.cs index 753da05..31e9f49 100644 --- a/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetAllPruductTagByFilter/GetAllPruductTagByFilterQueryValidator.cs +++ b/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetAllPruductTagByFilter/GetAllPruductTagByFilterQueryValidator.cs @@ -12,4 +12,3 @@ public class GetAllPruductTagByFilterQueryValidator : AbstractValidator e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetPruductTag/GetPruductTagQuery.cs b/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetPruductTag/GetPruductTagQuery.cs index 9567440..0036486 100644 --- a/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetPruductTag/GetPruductTagQuery.cs +++ b/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetPruductTag/GetPruductTagQuery.cs @@ -4,5 +4,4 @@ public record GetPruductTagQuery : IRequest //شناسه public long Id { get; init; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetPruductTag/GetPruductTagQueryValidator.cs b/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetPruductTag/GetPruductTagQueryValidator.cs index d485241..655ff9d 100644 --- a/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetPruductTag/GetPruductTagQueryValidator.cs +++ b/src/CMSMicroservice.Application/PruductTagCQ/Queries/GetPruductTag/GetPruductTagQueryValidator.cs @@ -14,4 +14,3 @@ public class GetPruductTagQueryValidator : AbstractValidator return result.Errors.Select(e => e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagCommand.cs b/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagCommand.cs index bbfd9d0..8f78d17 100644 --- a/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagCommand.cs +++ b/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagCommand.cs @@ -12,5 +12,4 @@ public record CreateNewTagCommand : IRequest //ترتیب نمایش public int SortOrder { get; init; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagResponseDto.cs b/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagResponseDto.cs index f86ccb9..250a9c8 100644 --- a/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagResponseDto.cs +++ b/src/CMSMicroservice.Application/TagCQ/Commands/CreateNewTag/CreateNewTagResponseDto.cs @@ -4,5 +4,4 @@ public class CreateNewTagResponseDto //شناسه public long Id { get; set; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/TagCQ/Commands/DeleteTag/DeleteTagCommand.cs b/src/CMSMicroservice.Application/TagCQ/Commands/DeleteTag/DeleteTagCommand.cs index f268924..9a3e3f3 100644 --- a/src/CMSMicroservice.Application/TagCQ/Commands/DeleteTag/DeleteTagCommand.cs +++ b/src/CMSMicroservice.Application/TagCQ/Commands/DeleteTag/DeleteTagCommand.cs @@ -4,5 +4,4 @@ public record DeleteTagCommand : IRequest //شناسه public long Id { get; init; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/TagCQ/Commands/DeleteTag/DeleteTagCommandValidator.cs b/src/CMSMicroservice.Application/TagCQ/Commands/DeleteTag/DeleteTagCommandValidator.cs index d6728e0..41bd69e 100644 --- a/src/CMSMicroservice.Application/TagCQ/Commands/DeleteTag/DeleteTagCommandValidator.cs +++ b/src/CMSMicroservice.Application/TagCQ/Commands/DeleteTag/DeleteTagCommandValidator.cs @@ -14,4 +14,3 @@ public class DeleteTagCommandValidator : AbstractValidator return result.Errors.Select(e => e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/TagCQ/Commands/UpdateTag/UpdateTagCommand.cs b/src/CMSMicroservice.Application/TagCQ/Commands/UpdateTag/UpdateTagCommand.cs index fd28a69..cd962e4 100644 --- a/src/CMSMicroservice.Application/TagCQ/Commands/UpdateTag/UpdateTagCommand.cs +++ b/src/CMSMicroservice.Application/TagCQ/Commands/UpdateTag/UpdateTagCommand.cs @@ -14,5 +14,4 @@ public record UpdateTagCommand : IRequest //ترتیب نمایش public int SortOrder { get; init; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterQuery.cs b/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterQuery.cs index 3e3ecc0..b5391d7 100644 --- a/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterQuery.cs +++ b/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterQuery.cs @@ -8,8 +8,7 @@ public record GetAllTagByFilterQuery : IRequest //فیلتر 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; } } - diff --git a/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterQueryValidator.cs b/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterQueryValidator.cs index 35c9137..307d595 100644 --- a/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterQueryValidator.cs +++ b/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterQueryValidator.cs @@ -12,4 +12,3 @@ public class GetAllTagByFilterQueryValidator : AbstractValidator e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterResponseDto.cs b/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterResponseDto.cs index 2be769a..662c22c 100644 --- a/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterResponseDto.cs +++ b/src/CMSMicroservice.Application/TagCQ/Queries/GetAllTagByFilter/GetAllTagByFilterResponseDto.cs @@ -6,8 +6,7 @@ public class GetAllTagByFilterResponseDto //مدل خروجی public List? 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; } } - diff --git a/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagQuery.cs b/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagQuery.cs index 39348a7..1d41ba9 100644 --- a/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagQuery.cs +++ b/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagQuery.cs @@ -4,5 +4,4 @@ public record GetTagQuery : IRequest //شناسه public long Id { get; init; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagQueryValidator.cs b/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagQueryValidator.cs index d44130f..20550c0 100644 --- a/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagQueryValidator.cs +++ b/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagQueryValidator.cs @@ -14,4 +14,3 @@ public class GetTagQueryValidator : AbstractValidator return result.Errors.Select(e => e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagResponseDto.cs b/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagResponseDto.cs index f5fad19..353098a 100644 --- a/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagResponseDto.cs +++ b/src/CMSMicroservice.Application/TagCQ/Queries/GetTag/GetTagResponseDto.cs @@ -14,5 +14,4 @@ public class GetTagResponseDto //ترتیب نمایش public int SortOrder { get; set; } -} - +} \ No newline at end of file diff --git a/src/CMSMicroservice.Application/UserWalletCQ/Commands/CreateNewUserWallet/CreateNewUserWalletCommand.cs b/src/CMSMicroservice.Application/UserWalletCQ/Commands/CreateNewUserWallet/CreateNewUserWalletCommand.cs index f826eab..25b59e9 100644 --- a/src/CMSMicroservice.Application/UserWalletCQ/Commands/CreateNewUserWallet/CreateNewUserWalletCommand.cs +++ b/src/CMSMicroservice.Application/UserWalletCQ/Commands/CreateNewUserWallet/CreateNewUserWalletCommand.cs @@ -5,5 +5,7 @@ public record CreateNewUserWalletCommand : IRequest model.Balance) .NotNull(); + RuleFor(model => model.NetworkBalance) + .NotNull(); } public Func>> ValidateValue => async (model, propertyName) => { diff --git a/src/CMSMicroservice.Application/UserWalletCQ/Commands/UpdateUserWallet/UpdateUserWalletCommand.cs b/src/CMSMicroservice.Application/UserWalletCQ/Commands/UpdateUserWallet/UpdateUserWalletCommand.cs index 3993b65..19ac43d 100644 --- a/src/CMSMicroservice.Application/UserWalletCQ/Commands/UpdateUserWallet/UpdateUserWalletCommand.cs +++ b/src/CMSMicroservice.Application/UserWalletCQ/Commands/UpdateUserWallet/UpdateUserWalletCommand.cs @@ -7,5 +7,7 @@ public record UpdateUserWalletCommand : IRequest public long UserId { get; init; } //موجودی public long Balance { get; init; } + //موجودی شبکه + public long NetworkBalance { get; init; } } \ No newline at end of file diff --git a/src/CMSMicroservice.Application/UserWalletCQ/Commands/UpdateUserWallet/UpdateUserWalletCommandValidator.cs b/src/CMSMicroservice.Application/UserWalletCQ/Commands/UpdateUserWallet/UpdateUserWalletCommandValidator.cs index 82defa6..68c0a63 100644 --- a/src/CMSMicroservice.Application/UserWalletCQ/Commands/UpdateUserWallet/UpdateUserWalletCommandValidator.cs +++ b/src/CMSMicroservice.Application/UserWalletCQ/Commands/UpdateUserWallet/UpdateUserWalletCommandValidator.cs @@ -9,6 +9,8 @@ public class UpdateUserWalletCommandValidator : AbstractValidator model.Balance) .NotNull(); + RuleFor(model => model.NetworkBalance) + .NotNull(); } public Func>> ValidateValue => async (model, propertyName) => { diff --git a/src/CMSMicroservice.Application/UserWalletCQ/Queries/GetAllUserWalletByFilter/GetAllUserWalletByFilterQuery.cs b/src/CMSMicroservice.Application/UserWalletCQ/Queries/GetAllUserWalletByFilter/GetAllUserWalletByFilterQuery.cs index 4d8baf0..a8accdf 100644 --- a/src/CMSMicroservice.Application/UserWalletCQ/Queries/GetAllUserWalletByFilter/GetAllUserWalletByFilterQuery.cs +++ b/src/CMSMicroservice.Application/UserWalletCQ/Queries/GetAllUserWalletByFilter/GetAllUserWalletByFilterQuery.cs @@ -16,4 +16,6 @@ public record GetAllUserWalletByFilterQuery : IRequest model.ChangeValue) .NotNull(); + RuleFor(model => model.CurrentNetworkBalance) + .NotNull(); + RuleFor(model => model.ChangeNerworkValue) + .NotNull(); RuleFor(model => model.IsIncrease) .NotNull(); } diff --git a/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Commands/UpdateUserWalletChangeLog/UpdateUserWalletChangeLogCommand.cs b/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Commands/UpdateUserWalletChangeLog/UpdateUserWalletChangeLogCommand.cs index 43d3225..d41be96 100644 --- a/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Commands/UpdateUserWalletChangeLog/UpdateUserWalletChangeLogCommand.cs +++ b/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Commands/UpdateUserWalletChangeLog/UpdateUserWalletChangeLogCommand.cs @@ -9,6 +9,10 @@ public record UpdateUserWalletChangeLogCommand : IRequest 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; } //شناسه ارجاع diff --git a/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Commands/UpdateUserWalletChangeLog/UpdateUserWalletChangeLogCommandValidator.cs b/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Commands/UpdateUserWalletChangeLog/UpdateUserWalletChangeLogCommandValidator.cs index 3e29dde..3a6c32d 100644 --- a/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Commands/UpdateUserWalletChangeLog/UpdateUserWalletChangeLogCommandValidator.cs +++ b/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Commands/UpdateUserWalletChangeLog/UpdateUserWalletChangeLogCommandValidator.cs @@ -11,6 +11,10 @@ public class UpdateUserWalletChangeLogCommandValidator : AbstractValidator model.ChangeValue) .NotNull(); + RuleFor(model => model.CurrentNetworkBalance) + .NotNull(); + RuleFor(model => model.ChangeNerworkValue) + .NotNull(); RuleFor(model => model.IsIncrease) .NotNull(); } diff --git a/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Queries/GetAllUserWalletChangeLogByFilter/GetAllUserWalletChangeLogByFilterResponseDto.cs b/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Queries/GetAllUserWalletChangeLogByFilter/GetAllUserWalletChangeLogByFilterResponseDto.cs index 86f3e83..36a3dea 100644 --- a/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Queries/GetAllUserWalletChangeLogByFilter/GetAllUserWalletChangeLogByFilterResponseDto.cs +++ b/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Queries/GetAllUserWalletChangeLogByFilter/GetAllUserWalletChangeLogByFilterResponseDto.cs @@ -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; } //شناسه ارجاع diff --git a/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Queries/GetUserWalletChangeLog/GetUserWalletChangeLogResponseDto.cs b/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Queries/GetUserWalletChangeLog/GetUserWalletChangeLogResponseDto.cs index c385043..6b0f5a7 100644 --- a/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Queries/GetUserWalletChangeLog/GetUserWalletChangeLogResponseDto.cs +++ b/src/CMSMicroservice.Application/UserWalletChangeLogCQ/Queries/GetUserWalletChangeLog/GetUserWalletChangeLogResponseDto.cs @@ -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; } //شناسه ارجاع diff --git a/src/CMSMicroservice.Domain/Entities/OtpToken.cs b/src/CMSMicroservice.Domain/Entities/OtpToken.cs index 939d6be..5846726 100644 --- a/src/CMSMicroservice.Domain/Entities/OtpToken.cs +++ b/src/CMSMicroservice.Domain/Entities/OtpToken.cs @@ -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; } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Domain/Entities/Package.cs b/src/CMSMicroservice.Domain/Entities/Package.cs index 05c3484..7429c23 100644 --- a/src/CMSMicroservice.Domain/Entities/Package.cs +++ b/src/CMSMicroservice.Domain/Entities/Package.cs @@ -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 UserOrders { get; set; } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Domain/Entities/Role.cs b/src/CMSMicroservice.Domain/Entities/Role.cs index ab41c83..21ba87d 100644 --- a/src/CMSMicroservice.Domain/Entities/Role.cs +++ b/src/CMSMicroservice.Domain/Entities/Role.cs @@ -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 UserRoles { get; set; } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Domain/Entities/Tag.cs b/src/CMSMicroservice.Domain/Entities/Tag.cs index 1f687b3..70fa6d4 100644 --- a/src/CMSMicroservice.Domain/Entities/Tag.cs +++ b/src/CMSMicroservice.Domain/Entities/Tag.cs @@ -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 PruductTags { get; set; } } - diff --git a/src/CMSMicroservice.Domain/Entities/User.cs b/src/CMSMicroservice.Domain/Entities/User.cs index 472ee89..ea787f7 100644 --- a/src/CMSMicroservice.Domain/Entities/User.cs +++ b/src/CMSMicroservice.Domain/Entities/User.cs @@ -40,14 +40,14 @@ public class User : BaseAuditableEntity public virtual ICollection UserAddresss { get; set; } //UserRole Collection Navigation Reference public virtual ICollection UserRoles { get; set; } - //UserWallet Collection Navigation Reference - public virtual ICollection UserWallets { get; set; } //UserCarts Collection Navigation Reference public virtual ICollection UserCartss { get; set; } - //UserOrder Collection Navigation Reference - public virtual ICollection UserOrders { get; set; } //User Collection Navigation Reference public virtual ICollection Users { get; set; } //UserContract Collection Navigation Reference public virtual ICollection UserContracts { get; set; } + //UserOrder Collection Navigation Reference + public virtual ICollection UserOrders { get; set; } + //UserWallet Collection Navigation Reference + public virtual ICollection UserWallets { get; set; } } diff --git a/src/CMSMicroservice.Domain/Entities/UserAddress.cs b/src/CMSMicroservice.Domain/Entities/UserAddress.cs index 723f744..a719a19 100644 --- a/src/CMSMicroservice.Domain/Entities/UserAddress.cs +++ b/src/CMSMicroservice.Domain/Entities/UserAddress.cs @@ -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 UserOrders { get; set; } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Domain/Entities/UserRole.cs b/src/CMSMicroservice.Domain/Entities/UserRole.cs index 3798634..0495597 100644 --- a/src/CMSMicroservice.Domain/Entities/UserRole.cs +++ b/src/CMSMicroservice.Domain/Entities/UserRole.cs @@ -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; } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Domain/Entities/UserWallet.cs b/src/CMSMicroservice.Domain/Entities/UserWallet.cs index c352a1c..d0c47fe 100644 --- a/src/CMSMicroservice.Domain/Entities/UserWallet.cs +++ b/src/CMSMicroservice.Domain/Entities/UserWallet.cs @@ -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 UserWalletChangeLogs { get; set; } } diff --git a/src/CMSMicroservice.Domain/Entities/UserWalletChangeLog.cs b/src/CMSMicroservice.Domain/Entities/UserWalletChangeLog.cs index 9b94b48..8680dc4 100644 --- a/src/CMSMicroservice.Domain/Entities/UserWalletChangeLog.cs +++ b/src/CMSMicroservice.Domain/Entities/UserWalletChangeLog.cs @@ -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; } //شناسه ارجاع diff --git a/src/CMSMicroservice.Infrastructure/Persistence/ApplicationDbContext.cs b/src/CMSMicroservice.Infrastructure/Persistence/ApplicationDbContext.cs index 0aca0e3..bb9c431 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/ApplicationDbContext.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/ApplicationDbContext.cs @@ -44,20 +44,20 @@ public class ApplicationDbContext : DbContext, IApplicationDbContext public DbSet Roles => Set(); public DbSet Categorys => Set(); public DbSet UserRoles => Set(); - public DbSet UserWallets => Set(); - public DbSet UserWalletChangeLogs => Set(); public DbSet UserCartss => Set(); public DbSet ProductGalleryss => Set(); - public DbSet UserOrders => Set(); public DbSet FactorDetailss => Set(); public DbSet Productss => Set(); public DbSet ProductImagess => Set(); - public DbSet Transactionss => Set(); public DbSet Users => Set(); public DbSet OtpTokens => Set(); public DbSet Contracts => Set(); public DbSet UserContracts => Set(); - public DbSet PruductCategorys => Set(); public DbSet Tags => Set(); + public DbSet PruductCategorys => Set(); public DbSet PruductTags => Set(); + public DbSet Transactionss => Set(); + public DbSet UserOrders => Set(); + public DbSet UserWallets => Set(); + public DbSet UserWalletChangeLogs => Set(); } diff --git a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/OtpTokenConfiguration.cs b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/OtpTokenConfiguration.cs index 15f14b1..e80d5ae 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/OtpTokenConfiguration.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/OtpTokenConfiguration.cs @@ -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 { public void Configure(EntityTypeBuilder builder) @@ -18,5 +17,6 @@ public class OtpTokenConfiguration : IEntityTypeConfiguration builder.Property(entity => entity.ExpiresAt).IsRequired(true); builder.Property(entity => entity.Attempts).IsRequired(true); builder.Property(entity => entity.IsUsed).IsRequired(true); + } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/PackageConfiguration.cs b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/PackageConfiguration.cs index d10f72b..9cd5e28 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/PackageConfiguration.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/PackageConfiguration.cs @@ -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 { public void Configure(EntityTypeBuilder builder) @@ -16,5 +15,6 @@ public class PackageConfiguration : IEntityTypeConfiguration builder.Property(entity => entity.Description).IsRequired(true); builder.Property(entity => entity.ImagePath).IsRequired(true); builder.Property(entity => entity.Price).IsRequired(true); + } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/RoleConfiguration.cs b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/RoleConfiguration.cs index 696a8cf..5d4c687 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/RoleConfiguration.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/RoleConfiguration.cs @@ -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 { public void Configure(EntityTypeBuilder builder) @@ -14,5 +13,6 @@ public class RoleConfiguration : IEntityTypeConfiguration builder.Property(entity => entity.Id).UseIdentityColumn(); builder.Property(entity => entity.Name).IsRequired(true); builder.Property(entity => entity.Title).IsRequired(true); + } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/TagConfiguration.cs b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/TagConfiguration.cs index 312e559..5489ad7 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/TagConfiguration.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/TagConfiguration.cs @@ -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 { public void Configure(EntityTypeBuilder builder) @@ -12,12 +11,11 @@ public class TagConfiguration : IEntityTypeConfiguration 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); + } } - diff --git a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserAddressConfiguration.cs b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserAddressConfiguration.cs index 61167c9..ab690ef 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserAddressConfiguration.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserAddressConfiguration.cs @@ -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 { public void Configure(EntityTypeBuilder builder) @@ -22,5 +21,6 @@ public class UserAddressConfiguration : IEntityTypeConfiguration builder.Property(entity => entity.PostalCode).IsRequired(true); builder.Property(entity => entity.IsDefault).IsRequired(true); builder.Property(entity => entity.CityId).IsRequired(true); + } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserRoleConfiguration.cs b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserRoleConfiguration.cs index 717b2a3..3315521 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserRoleConfiguration.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserRoleConfiguration.cs @@ -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 { public void Configure(EntityTypeBuilder builder) @@ -22,5 +21,6 @@ public class UserRoleConfiguration : IEntityTypeConfiguration .WithMany(entity => entity.UserRoles) .HasForeignKey(entity => entity.UserId) .IsRequired(true); + } -} \ No newline at end of file +} diff --git a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserWalletChangeLogConfiguration.cs b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserWalletChangeLogConfiguration.cs index 0205b56..4c280fd 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserWalletChangeLogConfiguration.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserWalletChangeLogConfiguration.cs @@ -13,11 +13,13 @@ public class UserWalletChangeLogConfiguration : IEntityTypeConfiguration 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); diff --git a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserWalletConfiguration.cs b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserWalletConfiguration.cs index 43d7a72..9a7dda4 100644 --- a/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserWalletConfiguration.cs +++ b/src/CMSMicroservice.Infrastructure/Persistence/Configurations/UserWalletConfiguration.cs @@ -17,6 +17,7 @@ public class UserWalletConfiguration : IEntityTypeConfiguration .HasForeignKey(entity => entity.UserId) .IsRequired(true); builder.Property(entity => entity.Balance).IsRequired(true); + builder.Property(entity => entity.NetworkBalance).IsRequired(true); } } diff --git a/src/CMSMicroservice.Protobuf/Protos/userwallet.proto b/src/CMSMicroservice.Protobuf/Protos/userwallet.proto index 73f8736..42defba 100644 --- a/src/CMSMicroservice.Protobuf/Protos/userwallet.proto +++ b/src/CMSMicroservice.Protobuf/Protos/userwallet.proto @@ -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; } diff --git a/src/CMSMicroservice.Protobuf/Protos/userwalletchangelog.proto b/src/CMSMicroservice.Protobuf/Protos/userwalletchangelog.proto index c6809ff..405146b 100644 --- a/src/CMSMicroservice.Protobuf/Protos/userwalletchangelog.proto +++ b/src/CMSMicroservice.Protobuf/Protos/userwalletchangelog.proto @@ -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; } diff --git a/src/CMSMicroservice.Protobuf/Validator/Category/CreateNewCategoryRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/Category/CreateNewCategoryRequestValidator.cs index 3c9531f..b507c2d 100644 --- a/src/CMSMicroservice.Protobuf/Validator/Category/CreateNewCategoryRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/Category/CreateNewCategoryRequestValidator.cs @@ -1,6 +1,5 @@ using FluentValidation; using CMSMicroservice.Protobuf.Protos.Category; - namespace CMSMicroservice.Protobuf.Validator.Category; public class CreateNewCategoryRequestValidator : AbstractValidator diff --git a/src/CMSMicroservice.Protobuf/Validator/PruductTag/DeletePruductTagRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/PruductTag/DeletePruductTagRequestValidator.cs index db412f8..07d41cc 100644 --- a/src/CMSMicroservice.Protobuf/Validator/PruductTag/DeletePruductTagRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/PruductTag/DeletePruductTagRequestValidator.cs @@ -17,4 +17,3 @@ public class DeletePruductTagRequestValidator : AbstractValidator e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Protobuf/Validator/PruductTag/GetAllPruductTagByFilterRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/PruductTag/GetAllPruductTagByFilterRequestValidator.cs index d64e0d7..68a8ad1 100644 --- a/src/CMSMicroservice.Protobuf/Validator/PruductTag/GetAllPruductTagByFilterRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/PruductTag/GetAllPruductTagByFilterRequestValidator.cs @@ -15,4 +15,3 @@ public class GetAllPruductTagByFilterRequestValidator : AbstractValidator e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Protobuf/Validator/PruductTag/GetPruductTagRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/PruductTag/GetPruductTagRequestValidator.cs index 86ae788..47db25c 100644 --- a/src/CMSMicroservice.Protobuf/Validator/PruductTag/GetPruductTagRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/PruductTag/GetPruductTagRequestValidator.cs @@ -17,4 +17,3 @@ public class GetPruductTagRequestValidator : AbstractValidator e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Protobuf/Validator/Tag/DeleteTagRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/Tag/DeleteTagRequestValidator.cs index 48f5be9..2408cb4 100644 --- a/src/CMSMicroservice.Protobuf/Validator/Tag/DeleteTagRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/Tag/DeleteTagRequestValidator.cs @@ -17,4 +17,3 @@ public class DeleteTagRequestValidator : AbstractValidator return result.Errors.Select(e => e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Protobuf/Validator/Tag/GetAllTagByFilterRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/Tag/GetAllTagByFilterRequestValidator.cs index 5a6f665..ff52b2b 100644 --- a/src/CMSMicroservice.Protobuf/Validator/Tag/GetAllTagByFilterRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/Tag/GetAllTagByFilterRequestValidator.cs @@ -15,4 +15,3 @@ public class GetAllTagByFilterRequestValidator : AbstractValidator e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Protobuf/Validator/Tag/GetTagRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/Tag/GetTagRequestValidator.cs index 314c944..adced8a 100644 --- a/src/CMSMicroservice.Protobuf/Validator/Tag/GetTagRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/Tag/GetTagRequestValidator.cs @@ -17,4 +17,3 @@ public class GetTagRequestValidator : AbstractValidator return result.Errors.Select(e => e.ErrorMessage); }; } - diff --git a/src/CMSMicroservice.Protobuf/Validator/UserWallet/CreateNewUserWalletRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/UserWallet/CreateNewUserWalletRequestValidator.cs index 84dc61c..91b15f7 100644 --- a/src/CMSMicroservice.Protobuf/Validator/UserWallet/CreateNewUserWalletRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/UserWallet/CreateNewUserWalletRequestValidator.cs @@ -10,6 +10,8 @@ public class CreateNewUserWalletRequestValidator : AbstractValidator model.Balance) .NotNull(); + RuleFor(model => model.NetworkBalance) + .NotNull(); } public Func>> ValidateValue => async (model, propertyName) => { diff --git a/src/CMSMicroservice.Protobuf/Validator/UserWallet/UpdateUserWalletRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/UserWallet/UpdateUserWalletRequestValidator.cs index a929054..a45b855 100644 --- a/src/CMSMicroservice.Protobuf/Validator/UserWallet/UpdateUserWalletRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/UserWallet/UpdateUserWalletRequestValidator.cs @@ -12,6 +12,8 @@ public class UpdateUserWalletRequestValidator : AbstractValidator model.Balance) .NotNull(); + RuleFor(model => model.NetworkBalance) + .NotNull(); } public Func>> ValidateValue => async (model, propertyName) => { diff --git a/src/CMSMicroservice.Protobuf/Validator/UserWalletChangeLog/CreateNewUserWalletChangeLogRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/UserWalletChangeLog/CreateNewUserWalletChangeLogRequestValidator.cs index 5bd17ea..e3535ba 100644 --- a/src/CMSMicroservice.Protobuf/Validator/UserWalletChangeLog/CreateNewUserWalletChangeLogRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/UserWalletChangeLog/CreateNewUserWalletChangeLogRequestValidator.cs @@ -12,6 +12,10 @@ public class CreateNewUserWalletChangeLogRequestValidator : AbstractValidator model.ChangeValue) .NotNull(); + RuleFor(model => model.CurrentNetworkBalance) + .NotNull(); + RuleFor(model => model.ChangeNerworkValue) + .NotNull(); RuleFor(model => model.IsIncrease) .NotNull(); } diff --git a/src/CMSMicroservice.Protobuf/Validator/UserWalletChangeLog/UpdateUserWalletChangeLogRequestValidator.cs b/src/CMSMicroservice.Protobuf/Validator/UserWalletChangeLog/UpdateUserWalletChangeLogRequestValidator.cs index 39b2b35..004b2e5 100644 --- a/src/CMSMicroservice.Protobuf/Validator/UserWalletChangeLog/UpdateUserWalletChangeLogRequestValidator.cs +++ b/src/CMSMicroservice.Protobuf/Validator/UserWalletChangeLog/UpdateUserWalletChangeLogRequestValidator.cs @@ -14,6 +14,10 @@ public class UpdateUserWalletChangeLogRequestValidator : AbstractValidator model.ChangeValue) .NotNull(); + RuleFor(model => model.CurrentNetworkBalance) + .NotNull(); + RuleFor(model => model.ChangeNerworkValue) + .NotNull(); RuleFor(model => model.IsIncrease) .NotNull(); } diff --git a/src/CMSMicroservice.WebApi/Common/Mappings/PruductTagProfile.cs b/src/CMSMicroservice.WebApi/Common/Mappings/PruductTagProfile.cs index 3f3e78e..3496282 100644 --- a/src/CMSMicroservice.WebApi/Common/Mappings/PruductTagProfile.cs +++ b/src/CMSMicroservice.WebApi/Common/Mappings/PruductTagProfile.cs @@ -8,4 +8,3 @@ public class PruductTagProfile : IRegister // .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}"); } } - diff --git a/src/CMSMicroservice.WebApi/Common/Mappings/TagProfile.cs b/src/CMSMicroservice.WebApi/Common/Mappings/TagProfile.cs index 4023eba..1e48844 100644 --- a/src/CMSMicroservice.WebApi/Common/Mappings/TagProfile.cs +++ b/src/CMSMicroservice.WebApi/Common/Mappings/TagProfile.cs @@ -8,4 +8,3 @@ public class TagProfile : IRegister // .Map(dest => dest.FullName, src => $"{src.Firstname} {src.Lastname}"); } } - diff --git a/src/CMSMicroservice.WebApi/Services/PruductTagService.cs b/src/CMSMicroservice.WebApi/Services/PruductTagService.cs index ce9870d..b796b3f 100644 --- a/src/CMSMicroservice.WebApi/Services/PruductTagService.cs +++ b/src/CMSMicroservice.WebApi/Services/PruductTagService.cs @@ -35,4 +35,3 @@ public class PruductTagService : PruductTagContract.PruductTagContractBase return await _dispatchRequestToCQRS.Handle(request, context); } } - diff --git a/src/CMSMicroservice.WebApi/Services/TagService.cs b/src/CMSMicroservice.WebApi/Services/TagService.cs index f6225e1..98080c9 100644 --- a/src/CMSMicroservice.WebApi/Services/TagService.cs +++ b/src/CMSMicroservice.WebApi/Services/TagService.cs @@ -35,4 +35,3 @@ public class TagService : TagContract.TagContractBase return await _dispatchRequestToCQRS.Handle(request, context); } } -