refactor: Update protobuf namespaces and remove unused imports

This commit is contained in:
masoodafar-web
2025-12-06 16:42:15 +03:30
parent ba38e4ac22
commit b229a3f0b6
98 changed files with 62 additions and 205 deletions

View File

@@ -1,5 +1,3 @@
using MediatR;
namespace BackOffice.BFF.Application.AuthorizationCQ.Queries.CheckUserPermission;
public record CheckUserPermissionQuery(string Permission) : IRequest<bool>;

View File

@@ -1,8 +1,3 @@
using System.Threading;
using System.Threading.Tasks;
using BackOffice.BFF.Application.Common.Interfaces;
using MediatR;
namespace BackOffice.BFF.Application.AuthorizationCQ.Queries.CheckUserPermission;
public class CheckUserPermissionQueryHandler : IRequestHandler<CheckUserPermissionQuery, bool>

View File

@@ -1,6 +1,3 @@
using System.Collections.Generic;
using MediatR;
namespace BackOffice.BFF.Application.AuthorizationCQ.Queries.GetUserRoles;
public record GetUserRolesQuery : IRequest<IReadOnlyList<string>>;

View File

@@ -1,9 +1,3 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using BackOffice.BFF.Application.Common.Interfaces;
using MediatR;
namespace BackOffice.BFF.Application.AuthorizationCQ.Queries.GetUserRoles;
public class GetUserRolesQueryHandler : IRequestHandler<GetUserRolesQuery, IReadOnlyList<string>>

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSCategory = CMSMicroservice.Protobuf.Protos.Category;
namespace BackOffice.BFF.Application.CategoryCQ.Commands.CreateNewCategory;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSCategory = CMSMicroservice.Protobuf.Protos.Category;
namespace BackOffice.BFF.Application.CategoryCQ.Commands.DeleteCategory;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSCategory = CMSMicroservice.Protobuf.Protos.Category;
namespace BackOffice.BFF.Application.CategoryCQ.Commands.UpdateCategory;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSCategory = CMSMicroservice.Protobuf.Protos.Category;
namespace BackOffice.BFF.Application.CategoryCQ.Queries.GetAllCategoryByFilter;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSCategory = CMSMicroservice.Protobuf.Protos.Category;
namespace BackOffice.BFF.Application.CategoryCQ.Queries.GetCategory;

View File

@@ -1,4 +1,5 @@
using BackOffice.BFF.ClubMembership.Protobuf;
using CMSMicroservice.Protobuf.Protos.ClubMembership;
namespace BackOffice.BFF.Application.ClubMembershipCQ.Commands.ActivateClub;

View File

@@ -1,4 +1,5 @@
using BackOffice.BFF.ClubMembership.Protobuf;
using Foursat.BackOffice.BFF.ClubMembership.Protobuf;
namespace BackOffice.BFF.Application.ClubMembershipCQ.Queries.GetAllClubMembers;

View File

@@ -1,4 +1,5 @@
using BackOffice.BFF.ClubMembership.Protobuf;
using CMSMicroservice.Protobuf.Protos.ClubMembership;
namespace BackOffice.BFF.Application.ClubMembershipCQ.Queries.GetClubStatistics;

View File

@@ -1,5 +1,4 @@
using BackOffice.BFF.Commission.Protobuf;
using Google.Protobuf.WellKnownTypes;
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWithdrawalReports;

View File

@@ -1,5 +1,3 @@
using BackOffice.BFF.Application.Common.Models;
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWorkerExecutionLogs;
public class GetWorkerExecutionLogsResponseDto

View File

@@ -1,5 +1,4 @@
using System.Diagnostics;
using MediatR;
using Microsoft.Extensions.Logging;
namespace BackOffice.BFF.Application.Common.Behaviours;

View File

@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BackOffice.BFF.Application.Common.Interfaces;
namespace BackOffice.BFF.Application.Common.Interfaces;
public interface IAfrinoIdpService
{
Task<bool> SendOtp(string mobile);

View File

@@ -9,10 +9,7 @@ using CMSMicroservice.Protobuf.Protos.ProductImages;
using CMSMicroservice.Protobuf.Protos.ProductGalleries;
using CMSMicroservice.Protobuf.Protos.Category;
using CMSMicroservice.Protobuf.Protos.ProductCategory;
using BackOffice.BFF.Commission.Protobuf;
using BackOffice.BFF.NetworkMembership.Protobuf;
using BackOffice.BFF.ClubMembership.Protobuf;
using BackOffice.BFF.Configuration.Protobuf;
using FMSMicroservice.Protobuf.Protos.FileInfo;
using CMSMicroservice.Protobuf.Protos.DiscountProduct;
using CMSMicroservice.Protobuf.Protos.DiscountCategory;
@@ -21,6 +18,8 @@ using CMSMicroservice.Protobuf.Protos.DiscountOrder;
using CMSMicroservice.Protobuf.Protos.Tag;
using CMSMicroservice.Protobuf.Protos.ProductTag;
using CMSMicroservice.Protobuf.Protos;
using CMSMicroservice.Protobuf.Protos.ClubMembership;
using CMSMicroservice.Protobuf.Protos.Configuration;
namespace BackOffice.BFF.Application.Common.Interfaces;

View File

@@ -1,7 +1,3 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace BackOffice.BFF.Application.Common.Interfaces;
public interface IPermissionService

View File

@@ -1,12 +1,8 @@
using BackOffice.BFF.Application.UserOrderCQ.Queries.GetAllUserOrderByFilter;
using BackOffice.BFF.Application.UserOrderCQ.Queries.GetUserOrder;
using CMSMicroservice.Protobuf.Protos;
using CMSMicroservice.Protobuf.Protos.UserOrder;
using Google.Protobuf.WellKnownTypes;
using CmsUserOrderFilter = CMSMicroservice.Protobuf.Protos.UserOrder.GetAllUserOrderByFilterFilter;
using CmsUserOrderRequest = CMSMicroservice.Protobuf.Protos.UserOrder.GetAllUserOrderByFilterRequest;
using GetAllUserOrderByFilterFilter = BackOffice.BFF.Application.UserOrderCQ.Queries.GetAllUserOrderByFilter.GetAllUserOrderByFilterFilter;
using GetAllUserOrderByFilterResponseModel = BackOffice.BFF.Application.UserOrderCQ.Queries.GetAllUserOrderByFilter.GetAllUserOrderByFilterResponseModel;
using CmsGetUserOrderResponse = CMSMicroservice.Protobuf.Protos.UserOrder.GetUserOrderResponse;
using BffGetUserOrderResponseDto = BackOffice.BFF.Application.UserOrderCQ.Queries.GetUserOrder.GetUserOrderResponseDto;

View File

@@ -1,7 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
namespace BackOffice.BFF.Application.Common.Models;
public static class RoleNames

View File

@@ -1,6 +1,5 @@
using CMSMicroservice.Protobuf.Protos.DiscountCategory;
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
namespace BackOffice.BFF.Application.DiscountCategoryCQ.Commands.CreateDiscountCategory;

View File

@@ -1,6 +1,5 @@
using CMSMicroservice.Protobuf.Protos.DiscountCategory;
using Google.Protobuf;
using Google.Protobuf.WellKnownTypes;
namespace BackOffice.BFF.Application.DiscountCategoryCQ.Commands.UpdateDiscountCategory;

View File

@@ -1,5 +1,4 @@
using CMSMicroservice.Protobuf.Protos.DiscountCategory;
using Google.Protobuf.WellKnownTypes;
namespace BackOffice.BFF.Application.DiscountCategoryCQ.Queries.GetDiscountCategories;

View File

@@ -1,6 +1,4 @@
using BackOffice.BFF.Application.Common.Models;
using CMSMicroservice.Protobuf.Protos.DiscountProduct;
using Google.Protobuf.WellKnownTypes;
namespace BackOffice.BFF.Application.DiscountProductCQ.Queries.GetDiscountProducts;

View File

@@ -1,5 +1,3 @@
using BackOffice.BFF.Application.Common.Models;
namespace BackOffice.BFF.Application.DiscountProductCQ.Queries.GetDiscountProducts;
public class GetDiscountProductsResponseDto

View File

@@ -1,4 +1,4 @@
using BackOffice.BFF.Health.Protobuf;
using Foursat.BackOffice.BFF.Health.Protobuf;
namespace BackOffice.BFF.Application.HealthCQ.Queries.GetSystemHealth;

View File

@@ -1,5 +1,6 @@
using BackOffice.BFF.Health.Protobuf;
using Google.Protobuf.WellKnownTypes;
using CMSMicroservice.Protobuf.Protos.ClubMembership;
using CMSMicroservice.Protobuf.Protos.Configuration;
using Foursat.BackOffice.BFF.Health.Protobuf;
namespace BackOffice.BFF.Application.HealthCQ.Queries.GetSystemHealth;
@@ -56,7 +57,7 @@ public class GetSystemHealthQueryHandler : IRequestHandler<GetSystemHealthQuery,
{
var stopwatch = System.Diagnostics.Stopwatch.StartNew();
await _context.Configurations.GetAllConfigurationsAsync(
new BackOffice.BFF.Configuration.Protobuf.GetAllConfigurationsRequest
new GetAllConfigurationsRequest
{
PageIndex = 1,
PageSize = 1
@@ -116,7 +117,7 @@ public class GetSystemHealthQueryHandler : IRequestHandler<GetSystemHealthQuery,
{
var stopwatch = System.Diagnostics.Stopwatch.StartNew();
await _context.ClubMemberships.GetClubStatisticsAsync(
new BackOffice.BFF.ClubMembership.Protobuf.GetClubStatisticsRequest(),
new GetClubStatisticsRequest(),
cancellationToken: cancellationToken);
stopwatch.Stop();
clubHealthy = true;

View File

@@ -1,6 +1,4 @@
using BackOffice.BFF.Application.Common.Interfaces;
namespace BackOffice.BFF.Application.OtpCQ.Commands.SendOtp;
namespace BackOffice.BFF.Application.OtpCQ.Commands.SendOtp;
public class SendOtpCommandHandler : IRequestHandler<SendOtpCommand, Unit>
{
private readonly IApplicationContractContext _context;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
using CMSMicroservice.Protobuf.Protos.Package;
using Google.Protobuf;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
using CMSMicroservice.Protobuf.Protos.Package;
namespace BackOffice.BFF.Application.PackageCQ.Queries.GetAllPackageByFilter;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Queries.GetUser;
using CMSMicroservice.Protobuf.Protos.Package;
namespace BackOffice.BFF.Application.PackageCQ.Queries.GetPackage;

View File

@@ -1,5 +1,4 @@
using BackOffice.BFF.Package.Protobuf.Protos.Package;
using MediatR;
namespace BackOffice.BFF.Application.PackageCQ.Queries.GetUserPackageStatus;

View File

@@ -1,5 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using MediatR;
using Microsoft.Extensions.Logging;
using BffPackage = BackOffice.BFF.Package.Protobuf.Protos.Package;
using CmsPackage = CMSMicroservice.Protobuf.Protos.Package;

View File

@@ -1,5 +1,3 @@
using FluentValidation;
namespace BackOffice.BFF.Application.PackageCQ.Queries.GetUserPackageStatus;
public class GetUserPackageStatusQueryValidator : AbstractValidator<GetUserPackageStatusQuery>

View File

@@ -1,5 +1,3 @@
using CMSMicroservice.Protobuf.Protos.ProductTag;
namespace BackOffice.BFF.Application.ProductTagCQ.Commands.AssignTagToProduct;
public record AssignTagToProductCommand : IRequest<long>

View File

@@ -1,5 +1,3 @@
using BackOffice.BFF.Application.ProductTagCQ.Queries.GetProductTagsByProduct;
namespace BackOffice.BFF.Application.ProductTagCQ.Queries.GetProductTagsByProduct;
public record GetProductTagsByProductQuery : IRequest<GetProductTagsByProductResponseDto>

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.ProductTag;
namespace BackOffice.BFF.Application.ProductTagCQ.Queries.GetProductTagsByProduct;

View File

@@ -1,5 +1,4 @@
using System.IO;
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.ProductImages;
using CMSMicroservice.Protobuf.Protos.ProductGalleries;
using Google.Protobuf;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.Products;
namespace BackOffice.BFF.Application.ProductsCQ.Commands.BulkUpdateProductPrices;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.Products;
namespace BackOffice.BFF.Application.ProductsCQ.Commands.BulkUpdateProductStock;

View File

@@ -1,5 +1,4 @@
using System.IO;
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.Products;
using Google.Protobuf;
using SixLabors.ImageSharp;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.Products;
namespace BackOffice.BFF.Application.ProductsCQ.Commands.DeleteProducts;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.ProductGalleries;
namespace BackOffice.BFF.Application.ProductsCQ.Commands.RemoveProductImage;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.Products;
namespace BackOffice.BFF.Application.ProductsCQ.Commands.ToggleProductStatus;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSProductCategory = CMSMicroservice.Protobuf.Protos.ProductCategory;
namespace BackOffice.BFF.Application.ProductsCQ.Commands.UpdateCategoryProducts;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSProductCategory = CMSMicroservice.Protobuf.Protos.ProductCategory;
namespace BackOffice.BFF.Application.ProductsCQ.Commands.UpdateProductCategories;

View File

@@ -1,5 +1,4 @@
using System.IO;
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.Products;
using Google.Protobuf;
using SixLabors.ImageSharp;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.Products;
namespace BackOffice.BFF.Application.ProductsCQ.Queries.GetAllProductsByFilter;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSCategory = CMSMicroservice.Protobuf.Protos.Category;
using CMSProductCategory = CMSMicroservice.Protobuf.Protos.ProductCategory;

View File

@@ -1,5 +1,3 @@
using BackOffice.BFF.Application.Common.Models;
namespace BackOffice.BFF.Application.ProductsCQ.Queries.GetLowStockProducts;
public record GetLowStockProductsQuery : IRequest<GetLowStockProductsResponseDto>

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.Products;
namespace BackOffice.BFF.Application.ProductsCQ.Queries.GetLowStockProducts;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.ProductGalleries;
using CMSMicroservice.Protobuf.Protos.ProductImages;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.Products;
namespace BackOffice.BFF.Application.ProductsCQ.Queries.GetProducts;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSProducts = CMSMicroservice.Protobuf.Protos.Products;
using CMSProductCategory = CMSMicroservice.Protobuf.Protos.ProductCategory;

View File

@@ -1,15 +1,14 @@
using BackOffice.BFF.Application.Common.Interfaces;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
using CmsProto = CMSMicroservice.Protobuf.Protos;
namespace BackOffice.BFF.Application.PublicMessageCQ.Commands.ArchiveMessage;
public class ArchiveMessageCommand : IRequest<BffProto.ArchiveMessageResponse>
public class ArchiveMessageCommand : IRequest<ArchiveMessageResponse>
{
public long MessageId { get; set; }
}
public class ArchiveMessageCommandHandler : IRequestHandler<ArchiveMessageCommand, BffProto.ArchiveMessageResponse>
public class ArchiveMessageCommandHandler : IRequestHandler<ArchiveMessageCommand, ArchiveMessageResponse>
{
private readonly IApplicationContractContext _context;
@@ -18,7 +17,7 @@ public class ArchiveMessageCommandHandler : IRequestHandler<ArchiveMessageComman
_context = context;
}
public async Task<BffProto.ArchiveMessageResponse> Handle(ArchiveMessageCommand request, CancellationToken cancellationToken)
public async Task<ArchiveMessageResponse> Handle(ArchiveMessageCommand request, CancellationToken cancellationToken)
{
var cmsRequest = new CmsProto.ArchiveMessageRequest
{
@@ -29,7 +28,7 @@ public class ArchiveMessageCommandHandler : IRequestHandler<ArchiveMessageComman
cmsRequest,
cancellationToken: cancellationToken);
return new BffProto.ArchiveMessageResponse
return new ArchiveMessageResponse
{
Success = cmsResponse.Success,
Message = cmsResponse.Message,

View File

@@ -1,9 +1,8 @@
using MediatR;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
namespace BackOffice.BFF.Application.PublicMessageCQ.Commands.CreatePublicMessage;
public record CreatePublicMessageCommand : IRequest<BffProto.CreatePublicMessageResponse>
public record CreatePublicMessageCommand : IRequest<CreatePublicMessageResponse>
{
public string Title { get; init; } = string.Empty;
public string Content { get; init; } = string.Empty;

View File

@@ -1,12 +1,9 @@
using BackOffice.BFF.Application.Common.Interfaces;
using Google.Protobuf.WellKnownTypes;
using MediatR;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
using CmsProto = CMSMicroservice.Protobuf.Protos;
namespace BackOffice.BFF.Application.PublicMessageCQ.Commands.CreatePublicMessage;
public class CreatePublicMessageCommandHandler : IRequestHandler<CreatePublicMessageCommand, BffProto.CreatePublicMessageResponse>
public class CreatePublicMessageCommandHandler : IRequestHandler<CreatePublicMessageCommand, CreatePublicMessageResponse>
{
private readonly IApplicationContractContext _context;
@@ -15,7 +12,7 @@ public class CreatePublicMessageCommandHandler : IRequestHandler<CreatePublicMes
_context = context;
}
public async Task<BffProto.CreatePublicMessageResponse> Handle(CreatePublicMessageCommand request, CancellationToken cancellationToken)
public async Task<CreatePublicMessageResponse> Handle(CreatePublicMessageCommand request, CancellationToken cancellationToken)
{
var cmsRequest = new CmsProto.CreatePublicMessageRequest
{
@@ -31,7 +28,7 @@ public class CreatePublicMessageCommandHandler : IRequestHandler<CreatePublicMes
cmsRequest,
cancellationToken: cancellationToken);
return new BffProto.CreatePublicMessageResponse
return new CreatePublicMessageResponse
{
Success = true,
Message = "پیام با موفقیت ایجاد شد",

View File

@@ -1,9 +1,8 @@
using MediatR;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
namespace BackOffice.BFF.Application.PublicMessageCQ.Commands.DeletePublicMessage;
public record DeletePublicMessageCommand : IRequest<BffProto.DeletePublicMessageResponse>
public record DeletePublicMessageCommand : IRequest<DeletePublicMessageResponse>
{
public long MessageId { get; init; }
}

View File

@@ -1,11 +1,9 @@
using BackOffice.BFF.Application.Common.Interfaces;
using MediatR;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
using CmsProto = CMSMicroservice.Protobuf.Protos;
namespace BackOffice.BFF.Application.PublicMessageCQ.Commands.DeletePublicMessage;
public class DeletePublicMessageCommandHandler : IRequestHandler<DeletePublicMessageCommand, BffProto.DeletePublicMessageResponse>
public class DeletePublicMessageCommandHandler : IRequestHandler<DeletePublicMessageCommand, DeletePublicMessageResponse>
{
private readonly IApplicationContractContext _context;
@@ -14,7 +12,7 @@ public class DeletePublicMessageCommandHandler : IRequestHandler<DeletePublicMes
_context = context;
}
public async Task<BffProto.DeletePublicMessageResponse> Handle(DeletePublicMessageCommand request, CancellationToken cancellationToken)
public async Task<DeletePublicMessageResponse> Handle(DeletePublicMessageCommand request, CancellationToken cancellationToken)
{
var cmsRequest = new CmsProto.DeletePublicMessageRequest
{
@@ -25,7 +23,7 @@ public class DeletePublicMessageCommandHandler : IRequestHandler<DeletePublicMes
cmsRequest,
cancellationToken: cancellationToken);
return new BffProto.DeletePublicMessageResponse
return new DeletePublicMessageResponse
{
Success = true,
Message = "پیام با موفقیت حذف شد"

View File

@@ -1,9 +1,8 @@
using MediatR;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
namespace BackOffice.BFF.Application.PublicMessageCQ.Commands.PublishMessage;
public record PublishMessageCommand : IRequest<BffProto.PublishMessageResponse>
public record PublishMessageCommand : IRequest<PublishMessageResponse>
{
public long MessageId { get; init; }
}

View File

@@ -1,11 +1,9 @@
using BackOffice.BFF.Application.Common.Interfaces;
using MediatR;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
using CmsProto = CMSMicroservice.Protobuf.Protos;
namespace BackOffice.BFF.Application.PublicMessageCQ.Commands.PublishMessage;
public class PublishMessageCommandHandler : IRequestHandler<PublishMessageCommand, BffProto.PublishMessageResponse>
public class PublishMessageCommandHandler : IRequestHandler<PublishMessageCommand, PublishMessageResponse>
{
private readonly IApplicationContractContext _context;
@@ -14,7 +12,7 @@ public class PublishMessageCommandHandler : IRequestHandler<PublishMessageComman
_context = context;
}
public async Task<BffProto.PublishMessageResponse> Handle(PublishMessageCommand request, CancellationToken cancellationToken)
public async Task<PublishMessageResponse> Handle(PublishMessageCommand request, CancellationToken cancellationToken)
{
var cmsRequest = new CmsProto.PublishMessageRequest
{
@@ -25,7 +23,7 @@ public class PublishMessageCommandHandler : IRequestHandler<PublishMessageComman
cmsRequest,
cancellationToken: cancellationToken);
return new BffProto.PublishMessageResponse
return new PublishMessageResponse
{
Success = cmsResponse.Success,
Message = cmsResponse.Message,

View File

@@ -1,9 +1,8 @@
using MediatR;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
namespace BackOffice.BFF.Application.PublicMessageCQ.Commands.UpdatePublicMessage;
public record UpdatePublicMessageCommand : IRequest<BffProto.UpdatePublicMessageResponse>
public record UpdatePublicMessageCommand : IRequest<UpdatePublicMessageResponse>
{
public long MessageId { get; init; }
public string Title { get; init; } = string.Empty;

View File

@@ -1,12 +1,9 @@
using BackOffice.BFF.Application.Common.Interfaces;
using Google.Protobuf.WellKnownTypes;
using MediatR;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
using CmsProto = CMSMicroservice.Protobuf.Protos;
namespace BackOffice.BFF.Application.PublicMessageCQ.Commands.UpdatePublicMessage;
public class UpdatePublicMessageCommandHandler : IRequestHandler<UpdatePublicMessageCommand, BffProto.UpdatePublicMessageResponse>
public class UpdatePublicMessageCommandHandler : IRequestHandler<UpdatePublicMessageCommand, UpdatePublicMessageResponse>
{
private readonly IApplicationContractContext _context;
@@ -15,7 +12,7 @@ public class UpdatePublicMessageCommandHandler : IRequestHandler<UpdatePublicMes
_context = context;
}
public async Task<BffProto.UpdatePublicMessageResponse> Handle(UpdatePublicMessageCommand request, CancellationToken cancellationToken)
public async Task<UpdatePublicMessageResponse> Handle(UpdatePublicMessageCommand request, CancellationToken cancellationToken)
{
var cmsRequest = new CmsProto.UpdatePublicMessageRequest
{
@@ -32,7 +29,7 @@ public class UpdatePublicMessageCommandHandler : IRequestHandler<UpdatePublicMes
cmsRequest,
cancellationToken: cancellationToken);
return new BffProto.UpdatePublicMessageResponse
return new UpdatePublicMessageResponse
{
Success = true,
Message = "پیام با موفقیت به‌روزرسانی شد"

View File

@@ -1,18 +1,17 @@
// GetActiveMessages - Public view
using BackOffice.BFF.Application.Common.Interfaces;
using MediatR;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
using CmsProto = CMSMicroservice.Protobuf.Protos;
namespace BackOffice.BFF.Application.PublicMessageCQ.Queries.GetActiveMessages;
public record GetActiveMessagesQuery : IRequest<BffProto.GetActiveMessagesResponse>
public record GetActiveMessagesQuery : IRequest<GetActiveMessagesResponse>
{
public int? MessageType { get; init; }
public string? TargetAudience { get; init; }
}
public class GetActiveMessagesQueryHandler : IRequestHandler<GetActiveMessagesQuery, BffProto.GetActiveMessagesResponse>
public class GetActiveMessagesQueryHandler : IRequestHandler<GetActiveMessagesQuery, GetActiveMessagesResponse>
{
private readonly IApplicationContractContext _context;
@@ -21,18 +20,18 @@ public class GetActiveMessagesQueryHandler : IRequestHandler<GetActiveMessagesQu
_context = context;
}
public async Task<BffProto.GetActiveMessagesResponse> Handle(GetActiveMessagesQuery request, CancellationToken cancellationToken)
public async Task<GetActiveMessagesResponse> Handle(GetActiveMessagesQuery request, CancellationToken cancellationToken)
{
var cmsRequest = new CmsProto.GetActiveMessagesRequest();
// نسخه فعلی CMS فیلدی برای فیلتر ندارد؛ در صورت اضافه شدن، اینجا مپ می‌شود.
var cmsResponse = await _context.PublicMessages.GetActiveMessagesAsync(cmsRequest, cancellationToken: cancellationToken);
var result = new BffProto.GetActiveMessagesResponse();
var result = new GetActiveMessagesResponse();
foreach (var message in cmsResponse.Messages)
{
result.Messages.Add(new BffProto.PublicMessageDto
result.Messages.Add(new PublicMessageDto
{
MessageId = message.Id,
Title = message.Title,

View File

@@ -1,13 +1,11 @@
// GetAllMessages - Admin view
using BackOffice.BFF.Application.Common.Interfaces;
using Google.Protobuf.WellKnownTypes;
using MediatR;
using BffProto = BackOffice.BFF.PublicMessage.Protobuf;
using Foursat.BackOffice.BFF.PublicMessage.Protobuf;
using CmsProto = CMSMicroservice.Protobuf.Protos;
namespace BackOffice.BFF.Application.PublicMessageCQ.Queries.GetAllMessages;
public record GetAllMessagesQuery : IRequest<BffProto.GetAllMessagesResponse>
public record GetAllMessagesQuery : IRequest<GetAllMessagesResponse>
{
public int? Status { get; init; }
public int? MessageType { get; init; }
@@ -15,7 +13,7 @@ public record GetAllMessagesQuery : IRequest<BffProto.GetAllMessagesResponse>
public int PageSize { get; init; }
}
public class GetAllMessagesQueryHandler : IRequestHandler<GetAllMessagesQuery, BffProto.GetAllMessagesResponse>
public class GetAllMessagesQueryHandler : IRequestHandler<GetAllMessagesQuery, GetAllMessagesResponse>
{
private readonly IApplicationContractContext _context;
@@ -24,7 +22,7 @@ public class GetAllMessagesQueryHandler : IRequestHandler<GetAllMessagesQuery, B
_context = context;
}
public async Task<BffProto.GetAllMessagesResponse> Handle(GetAllMessagesQuery request, CancellationToken cancellationToken)
public async Task<GetAllMessagesResponse> Handle(GetAllMessagesQuery request, CancellationToken cancellationToken)
{
var cmsRequest = new CmsProto.GetAllMessagesRequest
{
@@ -44,7 +42,7 @@ public class GetAllMessagesQueryHandler : IRequestHandler<GetAllMessagesQuery, B
var cmsResponse = await _context.PublicMessages.GetAllMessagesAsync(cmsRequest, cancellationToken: cancellationToken);
var result = new BffProto.GetAllMessagesResponse
var result = new GetAllMessagesResponse
{
TotalCount = (int)cmsResponse.MetaData.TotalCount,
PageNumber = request.PageNumber,
@@ -53,7 +51,7 @@ public class GetAllMessagesQueryHandler : IRequestHandler<GetAllMessagesQuery, B
foreach (var message in cmsResponse.Messages)
{
result.Messages.Add(new BffProto.AdminPublicMessageDto
result.Messages.Add(new AdminPublicMessageDto
{
MessageId = message.Id,
Title = message.Title,

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
using CMSMicroservice.Protobuf.Protos.Role;
namespace BackOffice.BFF.Application.RoleCQ.Commands.CreateNewRole;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.RoleCQ.Queries.GetAllRoleByFilter;
using CMSMicroservice.Protobuf.Protos.Role;
namespace BackOffice.BFF.Application.RoleCQ.Queries.GetAllRoleByFilter;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.RoleCQ.Queries.GetRole;
using CMSMicroservice.Protobuf.Protos.Role;
namespace BackOffice.BFF.Application.RoleCQ.Queries.GetRole;

View File

@@ -1,5 +1,3 @@
using CMSMicroservice.Protobuf.Protos.Tag;
namespace BackOffice.BFF.Application.TagCQ.Commands.CreateTag;
public record CreateTagCommand : IRequest<long>

View File

@@ -1,5 +1,3 @@
using CMSMicroservice.Protobuf.Protos.Tag;
namespace BackOffice.BFF.Application.TagCQ.Commands.UpdateTag;
public record UpdateTagCommand : IRequest

View File

@@ -1,6 +1,4 @@
using CMSMicroservice.Protobuf.Protos.Tag;
using Google.Protobuf.WellKnownTypes;
using CMSMicroservice.Protobuf.Protos;
namespace BackOffice.BFF.Application.TagCQ.Queries.GetAllTags;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
using CMSMicroservice.Protobuf.Protos.UserAddress;
namespace BackOffice.BFF.Application.UserAddressCQ.Commands.CreateNewUserAddress;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
using CMSMicroservice.Protobuf.Protos.UserAddress;
namespace BackOffice.BFF.Application.UserAddressCQ.Queries.GetAllUserAddressByFilter;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Queries.GetUser;
using CMSMicroservice.Protobuf.Protos.UserAddress;
namespace BackOffice.BFF.Application.UserAddressCQ.Queries.GetUserAddress;

View File

@@ -1,4 +1,3 @@
using MediatR;
using BffProto = BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.ApplyDiscountToOrder;

View File

@@ -1,5 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using MediatR;
using Microsoft.Extensions.Logging;
using BffProto = BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
using CmsProto = CMSMicroservice.Protobuf.Protos.UserOrder;

View File

@@ -1,5 +1,3 @@
using FluentValidation;
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.ApplyDiscountToOrder;
public class ApplyDiscountToOrderCommandValidator : AbstractValidator<ApplyDiscountToOrderCommand>

View File

@@ -1,4 +1,3 @@
using MediatR;
using BffProto = BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.CancelOrder;

View File

@@ -1,5 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using MediatR;
using Microsoft.Extensions.Logging;
using BffProto = BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
using CmsProto = CMSMicroservice.Protobuf.Protos.UserOrder;

View File

@@ -1,5 +1,3 @@
using FluentValidation;
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.CancelOrder;
public class CancelOrderCommandValidator : AbstractValidator<CancelOrderCommand>

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
using CMSMicroservice.Protobuf.Protos.UserOrder;
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.CreateNewUserOrder;

View File

@@ -1,4 +1,3 @@
using MediatR;
using BffProto = BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.UpdateOrderStatus;

View File

@@ -1,5 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using MediatR;
using Microsoft.Extensions.Logging;
using BffProto = BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
using CmsProto = CMSMicroservice.Protobuf.Protos.UserOrder;

View File

@@ -1,5 +1,3 @@
using FluentValidation;
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.UpdateOrderStatus;
public class UpdateOrderStatusCommandValidator : AbstractValidator<UpdateOrderStatusCommand>

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using CMSMicroservice.Protobuf.Protos.UserOrder;
namespace BackOffice.BFF.Application.UserOrderCQ.Commands.UpdateUserOrder;

View File

@@ -1,4 +1,3 @@
using MediatR;
using BffProto = BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
namespace BackOffice.BFF.Application.UserOrderCQ.Queries.CalculateOrderPV;

View File

@@ -1,5 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using MediatR;
using BffProto = BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
using CmsProto = CMSMicroservice.Protobuf.Protos.UserOrder;

View File

@@ -1,5 +1,3 @@
using FluentValidation;
namespace BackOffice.BFF.Application.UserOrderCQ.Queries.CalculateOrderPV;
public class CalculateOrderPVQueryValidator : AbstractValidator<CalculateOrderPVQuery>

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
using PaginationState = BackOffice.BFF.Application.Common.Models.PaginationState;
namespace BackOffice.BFF.Application.UserOrderCQ.Queries.GetAllUserOrderByFilter;

View File

@@ -1,4 +1,3 @@
using MediatR;
using BffProto = BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
namespace BackOffice.BFF.Application.UserOrderCQ.Queries.GetOrdersByDateRange;

View File

@@ -1,5 +1,3 @@
using FluentValidation;
namespace BackOffice.BFF.Application.UserOrderCQ.Queries.GetOrdersByDateRange;
public class GetOrdersByDateRangeQueryValidator : AbstractValidator<GetOrdersByDateRangeQuery>

View File

@@ -1,6 +1,3 @@
using BackOffice.BFF.Application.Common.Interfaces;
using Google.Protobuf.WellKnownTypes;
using MediatR;
using BffProto = BackOffice.BFF.UserOrder.Protobuf.Protos.UserOrder;
using CmsProto = CMSMicroservice.Protobuf.Protos.UserOrder;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Queries.GetUser;
using CMSMicroservice.Protobuf.Protos.UserOrder;
namespace BackOffice.BFF.Application.UserOrderCQ.Queries.GetUserOrder;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Commands.CreateNewUser;
using CMSMicroservice.Protobuf.Protos.UserRole;
namespace BackOffice.BFF.Application.UserRoleCQ.Commands.CreateNewUserRole;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Queries.GetAllUserByFilter;
using CMSMicroservice.Protobuf.Protos.UserRole;
namespace BackOffice.BFF.Application.UserRoleCQ.Queries.GetAllUserRoleByFilter;

View File

@@ -1,4 +1,3 @@
using BackOffice.BFF.Application.UserCQ.Queries.GetUser;
using CMSMicroservice.Protobuf.Protos.UserRole;
namespace BackOffice.BFF.Application.UserRoleCQ.Queries.GetUserRole;

View File

@@ -12,8 +12,6 @@ using CMSMicroservice.Protobuf.Protos.Category;
using CMSMicroservice.Protobuf.Protos.ProductCategory;
using BackOffice.BFF.Commission.Protobuf;
using BackOffice.BFF.NetworkMembership.Protobuf;
using BackOffice.BFF.ClubMembership.Protobuf;
using BackOffice.BFF.Configuration.Protobuf;
using FMSMicroservice.Protobuf.Protos.FileInfo;
using CMSMicroservice.Protobuf.Protos.DiscountProduct;
using CMSMicroservice.Protobuf.Protos.DiscountCategory;
@@ -22,6 +20,8 @@ using CMSMicroservice.Protobuf.Protos.DiscountOrder;
using CMSMicroservice.Protobuf.Protos.Tag;
using CMSMicroservice.Protobuf.Protos.ProductTag;
using CMSMicroservice.Protobuf.Protos;
using CMSMicroservice.Protobuf.Protos.ClubMembership;
using CMSMicroservice.Protobuf.Protos.Configuration;
using CMSMicroservice.Protobuf.Protos.ManualPayment;
using Microsoft.Extensions.DependencyInjection;

View File

@@ -1,6 +1,6 @@
using BackOffice.BFF.Application.HealthCQ.Queries.GetSystemHealth;
using BackOffice.BFF.WebApi.Common.Services;
using BackOffice.BFF.Health.Protobuf;
using Foursat.BackOffice.BFF.Health.Protobuf;
using Grpc.Core;
namespace BackOffice.BFF.WebApi.Services;