feat: add GetAvailableWeeks query and update protobuf imports
Build and Deploy / build (push) Successful in 2m18s
Build and Deploy / build (push) Successful in 2m18s
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.ClubMembership.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.ClubMembership;
|
||||
|
||||
namespace BackOffice.BFF.Application.ClubMembershipCQ.Commands.ActivateClub;
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.ClubMembership.Protos;
|
||||
using Foursat.BackOffice.BFF.ClubMembership.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.ClubMembership;
|
||||
|
||||
namespace BackOffice.BFF.Application.ClubMembershipCQ.Queries.GetAllClubMembers;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.ClubMembership.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.ClubMembership;
|
||||
|
||||
namespace BackOffice.BFF.Application.ClubMembershipCQ.Queries.GetClubStatistics;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Commands.ApproveWithdrawal;
|
||||
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Commands.ProcessWithdrawal;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Commands.RejectWithdrawal;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Commands.TriggerWeeklyCalculation;
|
||||
|
||||
|
||||
+3
-1
@@ -1,5 +1,7 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetAllWeeklyPools;
|
||||
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetAvailableWeeks;
|
||||
|
||||
public class GetAvailableWeeksQuery : IRequest<GetAvailableWeeksResponseDto>
|
||||
{
|
||||
public int FutureWeeksCount { get; init; } = 4;
|
||||
public int PastWeeksCount { get; init; } = 12;
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetAvailableWeeks;
|
||||
|
||||
public class GetAvailableWeeksQueryHandler : IRequestHandler<GetAvailableWeeksQuery, GetAvailableWeeksResponseDto>
|
||||
{
|
||||
private readonly IApplicationContractContext _context;
|
||||
|
||||
public GetAvailableWeeksQueryHandler(IApplicationContractContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<GetAvailableWeeksResponseDto> Handle(
|
||||
GetAvailableWeeksQuery request,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
// Call CMS microservice through BFF proto
|
||||
var cmsRequest = new GetAvailableWeeksRequest
|
||||
{
|
||||
FutureWeeksCount = request.FutureWeeksCount,
|
||||
PastWeeksCount = request.PastWeeksCount
|
||||
};
|
||||
|
||||
var response = await _context.Commissions.GetAvailableWeeksAsync(cmsRequest, cancellationToken: cancellationToken);
|
||||
|
||||
// Map to DTO
|
||||
return new GetAvailableWeeksResponseDto
|
||||
{
|
||||
CurrentWeek = MapToDto(response.CurrentWeek),
|
||||
CalculatedWeeks = response.CalculatedWeeks.Select(MapToDto).ToList(),
|
||||
PendingWeeks = response.PendingWeeks.Select(MapToDto).ToList(),
|
||||
FutureWeeks = response.FutureWeeks.Select(MapToDto).ToList()
|
||||
};
|
||||
}
|
||||
|
||||
private static WeekInfoDto MapToDto(WeekInfo weekInfo)
|
||||
{
|
||||
return new WeekInfoDto
|
||||
{
|
||||
WeekNumber = weekInfo.WeekNumber,
|
||||
StartDate = weekInfo.StartDate?.ToDateTime() ?? DateTime.MinValue,
|
||||
EndDate = weekInfo.EndDate?.ToDateTime() ?? DateTime.MinValue,
|
||||
IsCalculated = weekInfo.IsCalculated,
|
||||
CalculatedAt = weekInfo.CalculatedAt?.ToDateTime(),
|
||||
LastExecutionStatus = weekInfo.LastExecutionStatus,
|
||||
TotalPoolAmount = weekInfo.TotalPoolAmount != 0 ? weekInfo.TotalPoolAmount : null,
|
||||
EligibleUsersCount = weekInfo.EligibleUsersCount != 0 ? weekInfo.EligibleUsersCount : null,
|
||||
DisplayText = weekInfo.DisplayText
|
||||
};
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetAvailableWeeks;
|
||||
|
||||
public class GetAvailableWeeksResponseDto
|
||||
{
|
||||
public required WeekInfoDto CurrentWeek { get; init; }
|
||||
public required List<WeekInfoDto> CalculatedWeeks { get; init; }
|
||||
public required List<WeekInfoDto> PendingWeeks { get; init; }
|
||||
public required List<WeekInfoDto> FutureWeeks { get; init; }
|
||||
}
|
||||
|
||||
public class WeekInfoDto
|
||||
{
|
||||
public required string WeekNumber { get; init; }
|
||||
public required DateTime StartDate { get; init; }
|
||||
public required DateTime EndDate { get; init; }
|
||||
public bool IsCalculated { get; init; }
|
||||
public DateTime? CalculatedAt { get; init; }
|
||||
public string? LastExecutionStatus { get; init; }
|
||||
public long? TotalPoolAmount { get; init; }
|
||||
public int? EligibleUsersCount { get; init; }
|
||||
public required string DisplayText { get; init; }
|
||||
}
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetUserPayouts;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetUserWeeklyBalances;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWeeklyPool;
|
||||
|
||||
|
||||
+4
-50
@@ -2,58 +2,12 @@ namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWeeklyPool;
|
||||
|
||||
public class GetWeeklyPoolResponseDto
|
||||
{
|
||||
/// <summary>
|
||||
/// شناسه Pool
|
||||
/// </summary>
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// شماره هفته (فرمت: YYYY-Www)
|
||||
/// </summary>
|
||||
public string WeekNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// مجموع کل Pool (تومان)
|
||||
/// </summary>
|
||||
public decimal TotalPoolValue { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع مشارکتهای اولیه (InitialContribution)
|
||||
/// </summary>
|
||||
public decimal TotalContributions { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// مجموع Payout های پرداخت شده
|
||||
/// </summary>
|
||||
public decimal TotalPayouts { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// باقیمانده Pool
|
||||
/// </summary>
|
||||
public decimal LeftBalance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تعداد اعضای فعال در این هفته
|
||||
/// </summary>
|
||||
public int ActiveMembersCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// آیا محاسبه شده است؟
|
||||
/// </summary>
|
||||
public long TotalPoolAmount { get; set; }
|
||||
public long TotalBalances { get; set; }
|
||||
public decimal ValuePerBalance { get; set; }
|
||||
public bool IsCalculated { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ محاسبه
|
||||
/// </summary>
|
||||
public DateTime? CalculatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ ایجاد
|
||||
/// </summary>
|
||||
public DateTime CreatedAt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ آخرین ویرایش
|
||||
/// </summary>
|
||||
public DateTime? ModifiedAt { get; set; }
|
||||
public DateTimeOffset Created { get; set; }
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWithdrawalReports;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWithdrawalRequests;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWorkerExecutionLogs;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.CommissionCQ.Queries.GetWorkerStatus;
|
||||
|
||||
|
||||
@@ -13,15 +13,16 @@ using FMSMicroservice.Protobuf.Protos.FileInfo;
|
||||
using CMSMicroservice.Protobuf.Protos.DiscountProduct;
|
||||
using CMSMicroservice.Protobuf.Protos.DiscountCategory;
|
||||
using CMSMicroservice.Protobuf.Protos.DiscountShoppingCart;
|
||||
using BackOffice.BFF.DiscountOrder.Protobuf.Protos.DiscountOrder;
|
||||
using CMSMicroservice.Protobuf.Protos.Tag;
|
||||
using CMSMicroservice.Protobuf.Protos.ProductTag;
|
||||
using CMSMicroservice.Protobuf.Protos;
|
||||
using Foursat.BackOffice.BFF.ClubMembership.Protos;
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
using Foursat.BackOffice.BFF.Configuration.Protos;
|
||||
using Foursat.BackOffice.BFF.NetworkMembership.Protos;
|
||||
using BackOffice.BFF.ManualPayment.Protobuf;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.ClubMembership;
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||
using CMSMicroservice.Protobuf.Protos.DiscountOrder;
|
||||
using CMSMicroservice.Protobuf.Protos.ManualPayment;
|
||||
using CMSMicroservice.Protobuf.Protos.NetworkMembership;
|
||||
|
||||
namespace BackOffice.BFF.Application.Common.Interfaces;
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetWeeklyPool;
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
|
||||
namespace BackOffice.BFF.Application.Common.Mappings;
|
||||
|
||||
public class CommissionProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
config.NewConfig< GetWeeklyCommissionPoolResponse,GetWeeklyPoolResponseDto>()
|
||||
.Map(dest => dest.Id, src => src.Id)
|
||||
.Map(dest => dest.CalculatedAt, src => src.CalculatedAt)
|
||||
.Map(dest => dest.IsCalculated, src => src.IsCalculated)
|
||||
.Map(dest => dest.WeekNumber, src => src.WeekNumber)
|
||||
.Map(dest => dest.TotalPoolAmount, src => src.TotalPoolAmount)
|
||||
.Map(dest => dest.ValuePerBalance, src => src.ValuePerBalance)
|
||||
.Map(dest => dest.TotalBalances, src => src.TotalBalances)
|
||||
.Map(dest => dest.Created, src => src.Created.ToDateTimeOffset())
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,9 @@ public class GeneralMapping : IRegister
|
||||
config.NewConfig<TimeSpan?, Duration>()
|
||||
.MapWith(src => src.HasValue ? Duration.FromTimeSpan(src.Value) : null);
|
||||
|
||||
config.NewConfig<DateTimeOffset?, DateTime?>()
|
||||
.MapWith(src => src.HasValue ? src.Value.DateTime : (DateTime?)null);
|
||||
|
||||
config.Default
|
||||
.UseDestinationValue(member => member.SetterModifier == AccessModifier.None &&
|
||||
member.Type.IsGenericType &&
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
using Foursat.BackOffice.BFF.Configuration.Protos;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||
|
||||
namespace BackOffice.BFF.Application.ConfigurationCQ.Commands.CreateOrUpdateConfiguration;
|
||||
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
using Foursat.BackOffice.BFF.Configuration.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||
|
||||
namespace BackOffice.BFF.Application.ConfigurationCQ.Commands.DeactivateConfiguration;
|
||||
|
||||
|
||||
+2
-4
@@ -1,7 +1,5 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using Foursat.BackOffice.BFF.Configuration.Protos;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using MediatR;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BackOffice.BFF.Application.ConfigurationCQ.Commands.SetDefaultVatPercentage;
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace BackOffice.BFF.Application.ConfigurationCQ.Commands.SetDefaultVatPercentage;
|
||||
|
||||
public class SetDefaultVatPercentageCommandValidator : AbstractValidator<SetDefaultVatPercentageCommand>
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
using Foursat.BackOffice.BFF.Configuration.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||
|
||||
namespace BackOffice.BFF.Application.ConfigurationCQ.Queries.GetAllConfigurations;
|
||||
|
||||
|
||||
+1
-3
@@ -1,6 +1,4 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using Foursat.BackOffice.BFF.Configuration.Protos;
|
||||
using MediatR;
|
||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BackOffice.BFF.Application.ConfigurationCQ.Queries.GetCurrentVatPercentage;
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
using BackOffice.BFF.DiscountOrder.Protobuf.Protos.DiscountOrder;
|
||||
using Mapster;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.DiscountOrder;
|
||||
|
||||
namespace BackOffice.BFF.Application.DiscountOrderCQ.Commands.CompleteOrderPayment;
|
||||
|
||||
@@ -14,10 +14,10 @@ public class CompleteOrderPaymentCommandHandler : IRequestHandler<CompleteOrderP
|
||||
|
||||
public async Task<CompleteOrderPaymentResponseDto> Handle(CompleteOrderPaymentCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var grpcRequest = TypeAdapter.Adapt(request, request.GetType(), typeof(CompleteOrderPaymentRequest)) as CompleteOrderPaymentRequest;
|
||||
var grpcRequest = request.Adapt<CompleteOrderPaymentRequest>();
|
||||
|
||||
var response = await _context.DiscountOrders.CompleteOrderPaymentAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
return TypeAdapter.Adapt(response, response.GetType(), typeof(CompleteOrderPaymentResponseDto)) as CompleteOrderPaymentResponseDto;
|
||||
return response.Adapt<CompleteOrderPaymentResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
using BackOffice.BFF.DiscountOrder.Protobuf.Protos.DiscountOrder;
|
||||
using Mapster;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.DiscountOrder;
|
||||
|
||||
namespace BackOffice.BFF.Application.DiscountOrderCQ.Commands.PlaceOrder;
|
||||
|
||||
@@ -14,10 +14,10 @@ public class PlaceOrderCommandHandler : IRequestHandler<PlaceOrderCommand, Place
|
||||
|
||||
public async Task<PlaceOrderResponseDto> Handle(PlaceOrderCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var grpcRequest = TypeAdapter.Adapt(request, request.GetType(), typeof(PlaceOrderRequest)) as PlaceOrderRequest;
|
||||
var grpcRequest = request.Adapt<PlaceOrderRequest>();
|
||||
|
||||
var response = await _context.DiscountOrders.PlaceOrderAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
return TypeAdapter.Adapt(response, response.GetType(), typeof(PlaceOrderResponseDto)) as PlaceOrderResponseDto;
|
||||
return response.Adapt<PlaceOrderResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
using BackOffice.BFF.DiscountOrder.Protobuf.Protos.DiscountOrder;
|
||||
using Mapster;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.DiscountOrder;
|
||||
|
||||
namespace BackOffice.BFF.Application.DiscountOrderCQ.Commands.UpdateOrderStatus;
|
||||
|
||||
@@ -14,10 +14,10 @@ public class UpdateOrderStatusCommandHandler : IRequestHandler<UpdateOrderStatus
|
||||
|
||||
public async Task<UpdateOrderStatusResponseDto> Handle(UpdateOrderStatusCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var grpcRequest = TypeAdapter.Adapt(request, request.GetType(), typeof(UpdateOrderStatusRequest)) as UpdateOrderStatusRequest;
|
||||
var grpcRequest = request.Adapt<UpdateOrderStatusRequest>();
|
||||
|
||||
var response = await _context.DiscountOrders.UpdateOrderStatusAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
return TypeAdapter.Adapt(response, response.GetType(), typeof(UpdateOrderStatusResponseDto)) as UpdateOrderStatusResponseDto;
|
||||
return response.Adapt<UpdateOrderStatusResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
using BackOffice.BFF.DiscountOrder.Protobuf.Protos.DiscountOrder;
|
||||
using Mapster;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.DiscountOrder;
|
||||
|
||||
namespace BackOffice.BFF.Application.DiscountOrderCQ.Queries.GetOrderById;
|
||||
|
||||
@@ -22,6 +22,6 @@ public class GetOrderByIdQueryHandler : IRequestHandler<GetOrderByIdQuery, GetOr
|
||||
|
||||
var response = await _context.DiscountOrders.GetOrderByIdAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
return TypeAdapter.Adapt(response, response.GetType(), typeof(GetOrderByIdResponseDto)) as GetOrderByIdResponseDto;
|
||||
return response.Adapt<GetOrderByIdResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
using BackOffice.BFF.DiscountOrder.Protobuf.Protos.DiscountOrder;
|
||||
using Mapster;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.DiscountOrder;
|
||||
|
||||
namespace BackOffice.BFF.Application.DiscountOrderCQ.Queries.GetUserOrders;
|
||||
|
||||
@@ -26,6 +26,6 @@ public class GetUserOrdersQueryHandler : IRequestHandler<GetUserOrdersQuery, Get
|
||||
|
||||
var response = await _context.DiscountOrders.GetUserOrdersAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
return TypeAdapter.Adapt(response, response.GetType(), typeof(GetUserOrdersResponseDto)) as GetUserOrdersResponseDto;
|
||||
return response.Adapt<GetUserOrdersResponseDto>();
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using BackOffice.BFF.Application.Common.Models;
|
||||
|
||||
namespace BackOffice.BFF.Application.DiscountOrderCQ.Queries.GetUserOrders;
|
||||
|
||||
public class GetUserOrdersResponseDto
|
||||
|
||||
+6
-4
@@ -1,7 +1,9 @@
|
||||
using Foursat.BackOffice.BFF.ClubMembership.Protos;
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
using Foursat.BackOffice.BFF.Configuration.Protos;
|
||||
using Foursat.BackOffice.BFF.NetworkMembership.Protos;
|
||||
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.ClubMembership;
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||
using CMSMicroservice.Protobuf.Protos.NetworkMembership;
|
||||
using Foursat.BackOffice.BFF.Health.Protobuf;
|
||||
|
||||
namespace BackOffice.BFF.Application.HealthCQ.Queries.GetSystemHealth;
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using MediatR;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Commands.ApproveManualPayment;
|
||||
|
||||
public class ApproveManualPaymentCommand : IRequest<bool>
|
||||
|
||||
+1
-4
@@ -1,7 +1,4 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using BackOffice.BFF.ManualPayment.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using MediatR;
|
||||
using CMSMicroservice.Protobuf.Protos.ManualPayment;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Commands.ApproveManualPayment;
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Commands.ApproveManualPayment;
|
||||
|
||||
public class ApproveManualPaymentCommandValidator : AbstractValidator<ApproveManualPaymentCommand>
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using MediatR;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Commands.CreateManualPayment;
|
||||
|
||||
public class CreateManualPaymentCommand : IRequest<CreateManualPaymentResponseDto>
|
||||
|
||||
+2
-5
@@ -1,7 +1,4 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using BackOffice.BFF.ManualPayment.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using MediatR;
|
||||
using CMSMicroservice.Protobuf.Protos.ManualPayment;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Commands.CreateManualPayment;
|
||||
@@ -31,7 +28,7 @@ public class CreateManualPaymentCommandHandler : IRequestHandler<CreateManualPay
|
||||
{
|
||||
UserId = request.UserId,
|
||||
Amount = request.Amount,
|
||||
Type = request.Type,
|
||||
Type = (ManualPaymentType)request.Type,
|
||||
Description = request.Description
|
||||
};
|
||||
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Commands.CreateManualPayment;
|
||||
|
||||
public class CreateManualPaymentCommandValidator : AbstractValidator<CreateManualPaymentCommand>
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using MediatR;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Commands.RejectManualPayment;
|
||||
|
||||
public class RejectManualPaymentCommand : IRequest<bool>
|
||||
|
||||
+1
-3
@@ -1,6 +1,4 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using BackOffice.BFF.ManualPayment.Protobuf;
|
||||
using MediatR;
|
||||
using CMSMicroservice.Protobuf.Protos.ManualPayment;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Commands.RejectManualPayment;
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Commands.RejectManualPayment;
|
||||
|
||||
public class RejectManualPaymentCommandValidator : AbstractValidator<RejectManualPaymentCommand>
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using MediatR;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Queries.GetManualPayments;
|
||||
|
||||
public class GetManualPaymentsQuery : IRequest<GetManualPaymentsResponseDto>
|
||||
|
||||
+5
-8
@@ -1,8 +1,5 @@
|
||||
using BackOffice.BFF.Application.Common.Interfaces;
|
||||
using BackOffice.BFF.Application.Common.Models;
|
||||
using BackOffice.BFF.ManualPayment.Protobuf;
|
||||
using Google.Protobuf.WellKnownTypes;
|
||||
using MediatR;
|
||||
using CMSMicroservice.Protobuf.Protos.ManualPayment;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Queries.GetManualPayments;
|
||||
@@ -29,7 +26,7 @@ public class GetManualPaymentsQueryHandler : IRequestHandler<GetManualPaymentsQu
|
||||
request.Status,
|
||||
request.Type);
|
||||
|
||||
var grpcRequest = new GetManualPaymentsRequest
|
||||
var grpcRequest = new GetAllManualPaymentsRequest
|
||||
{
|
||||
PageNumber = request.PageNumber,
|
||||
PageSize = request.PageSize,
|
||||
@@ -38,7 +35,7 @@ public class GetManualPaymentsQueryHandler : IRequestHandler<GetManualPaymentsQu
|
||||
Type = request.Type
|
||||
};
|
||||
|
||||
var response = await _context.ManualPayments.GetManualPaymentsAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
var response = await _context.ManualPayments.GetAllManualPaymentsAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
|
||||
var meta = response.MetaData;
|
||||
|
||||
@@ -50,11 +47,11 @@ public class GetManualPaymentsQueryHandler : IRequestHandler<GetManualPaymentsQu
|
||||
UserFullName = m.UserFullName,
|
||||
UserMobile = m.UserMobile,
|
||||
Amount = m.Amount,
|
||||
Type = m.Type,
|
||||
Type = m.Type.GetHashCode(),
|
||||
TypeDisplay = m.TypeDisplay,
|
||||
Description = m.Description,
|
||||
ReferenceNumber = m.ReferenceNumber,
|
||||
Status = m.Status,
|
||||
Status = m.Status.GetHashCode(),
|
||||
StatusDisplay = m.StatusDisplay,
|
||||
RequestedBy = m.RequestedBy,
|
||||
RequestedByName = m.RequestedByName,
|
||||
|
||||
-2
@@ -1,5 +1,3 @@
|
||||
using BackOffice.BFF.Application.Common.Models;
|
||||
|
||||
namespace BackOffice.BFF.Application.ManualPaymentCQ.Queries.GetManualPayments;
|
||||
|
||||
public class GetManualPaymentsResponseDto
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.NetworkMembership.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.NetworkMembership;
|
||||
|
||||
namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetNetworkHistory;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.NetworkMembership.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.NetworkMembership;
|
||||
|
||||
namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetNetworkStatistics;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.NetworkMembership.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.NetworkMembership;
|
||||
|
||||
namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetNetworkTree;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
|
||||
using Foursat.BackOffice.BFF.NetworkMembership.Protos;
|
||||
|
||||
using CMSMicroservice.Protobuf.Protos.NetworkMembership;
|
||||
|
||||
namespace BackOffice.BFF.Application.NetworkMembershipCQ.Queries.GetUserNetworkInfo;
|
||||
|
||||
|
||||
+1
@@ -24,4 +24,5 @@ public record GetAllUserByFilterQuery : IRequest<GetAllUserByFilterResponseDto>
|
||||
public string? AvatarPath { get; set; }
|
||||
//شناسه والد
|
||||
public long? ParentId { get; set; }
|
||||
public string? SearchText { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user