update
This commit is contained in:
+5470
File diff suppressed because one or more lines are too long
@@ -8,6 +8,8 @@ using CMSMicroservice.Protobuf.Protos.ProductImages;
|
|||||||
using CMSMicroservice.Protobuf.Protos.User;
|
using CMSMicroservice.Protobuf.Protos.User;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
||||||
|
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||||
|
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserContract;
|
using CMSMicroservice.Protobuf.Protos.UserContract;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
||||||
@@ -39,6 +41,8 @@ public interface IApplicationContractContext
|
|||||||
OtpTokenContract.OtpTokenContractClient OtpToken { get; }
|
OtpTokenContract.OtpTokenContractClient OtpToken { get; }
|
||||||
UserWalletContract.UserWalletContractClient UserWallet { get; }
|
UserWalletContract.UserWalletContractClient UserWallet { get; }
|
||||||
UserWalletChangeLogContract.UserWalletChangeLogContractClient UserWalletChangeLog { get; }
|
UserWalletChangeLogContract.UserWalletChangeLogContractClient UserWalletChangeLog { get; }
|
||||||
|
ConfigurationContract.ConfigurationContractClient Configuration { get; }
|
||||||
|
CommissionContract.CommissionContractClient Commission { get; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PYMS
|
#region PYMS
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
|
||||||
public record WithdrawBalanceCommand : IRequest<Unit>
|
public record WithdrawBalanceCommand : IRequest<Unit>
|
||||||
{
|
{
|
||||||
|
public long PayoutId { get; init; }
|
||||||
|
public int WithdrawalMethod { get; init; } // 0: Cash, 1: Diamond
|
||||||
|
public string? IbanNumber { get; init; }
|
||||||
}
|
}
|
||||||
+11
-2
@@ -1,3 +1,5 @@
|
|||||||
|
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||||
|
|
||||||
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
|
||||||
public class WithdrawBalanceCommandHandler : IRequestHandler<WithdrawBalanceCommand, Unit>
|
public class WithdrawBalanceCommandHandler : IRequestHandler<WithdrawBalanceCommand, Unit>
|
||||||
{
|
{
|
||||||
@@ -10,7 +12,14 @@ public class WithdrawBalanceCommandHandler : IRequestHandler<WithdrawBalanceComm
|
|||||||
|
|
||||||
public async Task<Unit> Handle(WithdrawBalanceCommand request, CancellationToken cancellationToken)
|
public async Task<Unit> Handle(WithdrawBalanceCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
//TODO: Implement your business logic
|
var withdrawRequest = new RequestWithdrawalRequest
|
||||||
return new Unit();
|
{
|
||||||
|
PayoutId = request.PayoutId,
|
||||||
|
WithdrawalMethod = request.WithdrawalMethod,
|
||||||
|
IbanNumber = string.IsNullOrWhiteSpace(request.IbanNumber) ? null : request.IbanNumber
|
||||||
|
};
|
||||||
|
|
||||||
|
await _context.Commission.RequestWithdrawalAsync(withdrawRequest, cancellationToken: cancellationToken);
|
||||||
|
return Unit.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-2
@@ -1,12 +1,21 @@
|
|||||||
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
|
||||||
public class WithdrawBalanceCommandValidator : AbstractValidator<Unit>
|
public class WithdrawBalanceCommandValidator : AbstractValidator<WithdrawBalanceCommand>
|
||||||
{
|
{
|
||||||
public WithdrawBalanceCommandValidator()
|
public WithdrawBalanceCommandValidator()
|
||||||
{
|
{
|
||||||
|
RuleFor(x => x.PayoutId).GreaterThan(0);
|
||||||
|
RuleFor(x => x.WithdrawalMethod).InclusiveBetween(0, 1);
|
||||||
|
When(x => x.WithdrawalMethod == 0, () =>
|
||||||
|
{
|
||||||
|
RuleFor(x => x.IbanNumber)
|
||||||
|
.NotEmpty()
|
||||||
|
.MinimumLength(10)
|
||||||
|
.WithMessage("شماره شبا لازم است");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||||
{
|
{
|
||||||
var result = await ValidateAsync(ValidationContext<Unit>.CreateWithOptions((Unit)model, x => x.IncludeProperties(propertyName)));
|
var result = await ValidateAsync(ValidationContext<WithdrawBalanceCommand>.CreateWithOptions((WithdrawBalanceCommand)model, x => x.IncludeProperties(propertyName)));
|
||||||
if (result.IsValid)
|
if (result.IsValid)
|
||||||
return Array.Empty<string>();
|
return Array.Empty<string>();
|
||||||
return result.Errors.Select(e => e.ErrorMessage);
|
return result.Errors.Select(e => e.ErrorMessage);
|
||||||
|
|||||||
+1
-4
@@ -1,5 +1,2 @@
|
|||||||
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog;
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog;
|
||||||
public record GetAllUserWalletChangeLogQuery : IRequest<GetAllUserWalletChangeLogResponseDto>
|
public record GetAllUserWalletChangeLogQuery(long? ReferenceId, bool? IsIncrease) : IRequest<GetAllUserWalletChangeLogResponseDto>;
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|||||||
+3
-1
@@ -24,7 +24,9 @@ public class
|
|||||||
{
|
{
|
||||||
Filter = new GetAllUserWalletChangeLogByFilterFilter()
|
Filter = new GetAllUserWalletChangeLogByFilterFilter()
|
||||||
{
|
{
|
||||||
UserId = _currentUserService.UserId.Value
|
UserId = _currentUserService.UserId.Value,
|
||||||
|
RefrenceId = request.ReferenceId.HasValue ? new Google.Protobuf.WellKnownTypes.Int64Value { Value = request.ReferenceId.Value } : null,
|
||||||
|
IsIncrease = request.IsIncrease.HasValue ? new Google.Protobuf.WellKnownTypes.BoolValue { Value = request.IsIncrease.Value } : null
|
||||||
}
|
}
|
||||||
}, cancellationToken: cancellationToken);
|
}, cancellationToken: cancellationToken);
|
||||||
var finalResult= result.Adapt<GetAllUserWalletChangeLogResponseDto>();
|
var finalResult= result.Adapt<GetAllUserWalletChangeLogResponseDto>();
|
||||||
|
|||||||
+3
-2
@@ -1,12 +1,13 @@
|
|||||||
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog;
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog;
|
||||||
public class GetAllUserWalletChangeLogQueryValidator : AbstractValidator<Unit>
|
public class GetAllUserWalletChangeLogQueryValidator : AbstractValidator<GetAllUserWalletChangeLogQuery>
|
||||||
{
|
{
|
||||||
public GetAllUserWalletChangeLogQueryValidator()
|
public GetAllUserWalletChangeLogQueryValidator()
|
||||||
{
|
{
|
||||||
|
RuleFor(x => x.ReferenceId).GreaterThan(0).When(x => x.ReferenceId.HasValue);
|
||||||
}
|
}
|
||||||
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||||
{
|
{
|
||||||
var result = await ValidateAsync(ValidationContext<Unit>.CreateWithOptions((Unit)model, x => x.IncludeProperties(propertyName)));
|
var result = await ValidateAsync(ValidationContext<GetAllUserWalletChangeLogQuery>.CreateWithOptions((GetAllUserWalletChangeLogQuery)model, x => x.IncludeProperties(propertyName)));
|
||||||
if (result.IsValid)
|
if (result.IsValid)
|
||||||
return Array.Empty<string>();
|
return Array.Empty<string>();
|
||||||
return result.Errors.Select(e => e.ErrorMessage);
|
return result.Errors.Select(e => e.ErrorMessage);
|
||||||
|
|||||||
+2
@@ -3,6 +3,8 @@ public class GetUserWalletResponseDto
|
|||||||
{
|
{
|
||||||
//موجودی
|
//موجودی
|
||||||
public long Balance { get; set; }
|
public long Balance { get; set; }
|
||||||
|
//موجودی تخفیف باشگاه
|
||||||
|
public long DiscountBalance { get; set; }
|
||||||
//موجودی شبکه
|
//موجودی شبکه
|
||||||
public long NetworkBalance { get; set; }
|
public long NetworkBalance { get; set; }
|
||||||
|
|
||||||
|
|||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWithdrawals;
|
||||||
|
public record GetUserWithdrawalsQuery(int? Status) : IRequest<GetUserWithdrawalsResponseDto>;
|
||||||
|
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||||
|
|
||||||
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWithdrawals;
|
||||||
|
|
||||||
|
public class GetUserWithdrawalsQueryHandler : IRequestHandler<GetUserWithdrawalsQuery, GetUserWithdrawalsResponseDto>
|
||||||
|
{
|
||||||
|
private readonly IApplicationContractContext _context;
|
||||||
|
private readonly ICurrentUserService _currentUserService;
|
||||||
|
|
||||||
|
public GetUserWithdrawalsQueryHandler(IApplicationContractContext context, ICurrentUserService currentUserService)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
_currentUserService = currentUserService;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<GetUserWithdrawalsResponseDto> Handle(GetUserWithdrawalsQuery request, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var response = await _context.Commission.GetUserCommissionPayoutsAsync(new GetUserCommissionPayoutsRequest()
|
||||||
|
{
|
||||||
|
UserId = _currentUserService.UserId,
|
||||||
|
Status = request.Status.HasValue ? new Google.Protobuf.WellKnownTypes.Int32Value { Value = request.Status.Value } : null,
|
||||||
|
PageIndex = 1,
|
||||||
|
PageSize = 50
|
||||||
|
}, cancellationToken: cancellationToken);
|
||||||
|
|
||||||
|
var dto = new GetUserWithdrawalsResponseDto
|
||||||
|
{
|
||||||
|
MetaData = response.MetaData.Adapt<MetaData>(),
|
||||||
|
Models = response.Models
|
||||||
|
.Select(m => new UserWithdrawalModel
|
||||||
|
{
|
||||||
|
Id = m.Id,
|
||||||
|
WeekNumber = m.WeekNumber,
|
||||||
|
TotalAmount = m.TotalAmount,
|
||||||
|
Status = m.Status,
|
||||||
|
WithdrawalMethod = m.WithdrawalMethod?.Value,
|
||||||
|
IbanNumber = m.IbanNumber,
|
||||||
|
Created = m.Created.ToDateTime()
|
||||||
|
}).ToList()
|
||||||
|
};
|
||||||
|
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWithdrawals;
|
||||||
|
public class GetUserWithdrawalsQueryValidator : AbstractValidator<GetUserWithdrawalsQuery>
|
||||||
|
{
|
||||||
|
public GetUserWithdrawalsQueryValidator()
|
||||||
|
{
|
||||||
|
RuleFor(x => x.Status).InclusiveBetween(0, 3).When(x => x.Status.HasValue);
|
||||||
|
}
|
||||||
|
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
|
||||||
|
{
|
||||||
|
var result = await ValidateAsync(ValidationContext<GetUserWithdrawalsQuery>.CreateWithOptions((GetUserWithdrawalsQuery)model, x => x.IncludeProperties(propertyName)));
|
||||||
|
if (result.IsValid)
|
||||||
|
return Array.Empty<string>();
|
||||||
|
return result.Errors.Select(e => e.ErrorMessage);
|
||||||
|
};
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWithdrawals;
|
||||||
|
public class GetUserWithdrawalsResponseDto
|
||||||
|
{
|
||||||
|
public MetaData MetaData { get; set; } = new();
|
||||||
|
public List<UserWithdrawalModel> Models { get; set; } = new();
|
||||||
|
}
|
||||||
|
|
||||||
|
public class UserWithdrawalModel
|
||||||
|
{
|
||||||
|
public long Id { get; set; }
|
||||||
|
public string WeekNumber { get; set; } = string.Empty;
|
||||||
|
public long TotalAmount { get; set; }
|
||||||
|
public int Status { get; set; }
|
||||||
|
public int? WithdrawalMethod { get; set; }
|
||||||
|
public string? IbanNumber { get; set; }
|
||||||
|
public DateTime Created { get; set; }
|
||||||
|
}
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetWithdrawalSettings;
|
||||||
|
public record GetWithdrawalSettingsQuery : IRequest<GetWithdrawalSettingsResponseDto>;
|
||||||
|
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetWithdrawalSettings;
|
||||||
|
public class GetWithdrawalSettingsQueryHandler : IRequestHandler<GetWithdrawalSettingsQuery, GetWithdrawalSettingsResponseDto>
|
||||||
|
{
|
||||||
|
private readonly IApplicationContractContext _context;
|
||||||
|
|
||||||
|
public GetWithdrawalSettingsQueryHandler(IApplicationContractContext context)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<GetWithdrawalSettingsResponseDto> Handle(GetWithdrawalSettingsQuery request, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
const string key = "Commission.MinWithdrawalAmount";
|
||||||
|
var config = await _context.Configuration.GetConfigurationByKeyAsync(new CMSMicroservice.Protobuf.Protos.Configuration.GetConfigurationByKeyRequest()
|
||||||
|
{
|
||||||
|
Key = key
|
||||||
|
}, cancellationToken: cancellationToken);
|
||||||
|
|
||||||
|
long parsed = 0;
|
||||||
|
long.TryParse(config.Value, out parsed);
|
||||||
|
|
||||||
|
return new GetWithdrawalSettingsResponseDto
|
||||||
|
{
|
||||||
|
MinWithdrawalAmount = parsed
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
namespace FrontOffice.BFF.Application.UserWalletCQ.Queries.GetWithdrawalSettings;
|
||||||
|
public class GetWithdrawalSettingsResponseDto
|
||||||
|
{
|
||||||
|
public long MinWithdrawalAmount { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
@@ -8,6 +8,8 @@ using CMSMicroservice.Protobuf.Protos.ProductImages;
|
|||||||
using CMSMicroservice.Protobuf.Protos.User;
|
using CMSMicroservice.Protobuf.Protos.User;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
using CMSMicroservice.Protobuf.Protos.UserAddress;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
||||||
|
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||||
|
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserContract;
|
using CMSMicroservice.Protobuf.Protos.UserContract;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
using CMSMicroservice.Protobuf.Protos.UserOrder;
|
||||||
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
using CMSMicroservice.Protobuf.Protos.UserWallet;
|
||||||
@@ -66,6 +68,8 @@ public class ApplicationContractContext : IApplicationContractContext
|
|||||||
public OtpTokenContract.OtpTokenContractClient OtpToken => GetService<OtpTokenContract.OtpTokenContractClient>();
|
public OtpTokenContract.OtpTokenContractClient OtpToken => GetService<OtpTokenContract.OtpTokenContractClient>();
|
||||||
public UserWalletContract.UserWalletContractClient UserWallet => GetService<UserWalletContract.UserWalletContractClient>();
|
public UserWalletContract.UserWalletContractClient UserWallet => GetService<UserWalletContract.UserWalletContractClient>();
|
||||||
public UserWalletChangeLogContract.UserWalletChangeLogContractClient UserWalletChangeLog => GetService<UserWalletChangeLogContract.UserWalletChangeLogContractClient>();
|
public UserWalletChangeLogContract.UserWalletChangeLogContractClient UserWalletChangeLog => GetService<UserWalletChangeLogContract.UserWalletChangeLogContractClient>();
|
||||||
|
public ConfigurationContract.ConfigurationContractClient Configuration => GetService<ConfigurationContract.ConfigurationContractClient>();
|
||||||
|
public CommissionContract.CommissionContractClient Commission => GetService<CommissionContract.CommissionContractClient>();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PYMS
|
#region PYMS
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetAllUserWalletChangeLog
|
|||||||
using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet;
|
using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWallet;
|
||||||
using FrontOffice.BFF.Application.UserWalletCQ.Commands.TransferUserWalletBallance;
|
using FrontOffice.BFF.Application.UserWalletCQ.Commands.TransferUserWalletBallance;
|
||||||
using FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
|
using FrontOffice.BFF.Application.UserWalletCQ.Commands.WithdrawBalance;
|
||||||
|
using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetUserWithdrawals;
|
||||||
|
using FrontOffice.BFF.Application.UserWalletCQ.Queries.GetWithdrawalSettings;
|
||||||
using FrontOffice.BFF.UserWallet.Protobuf.Protos.UserWallet;
|
using FrontOffice.BFF.UserWallet.Protobuf.Protos.UserWallet;
|
||||||
|
|
||||||
namespace FrontOffice.BFF.WebApi.Services;
|
namespace FrontOffice.BFF.WebApi.Services;
|
||||||
@@ -14,9 +16,9 @@ public class UserWalletService : UserWalletContract.UserWalletContractBase
|
|||||||
{
|
{
|
||||||
_dispatchRequestToCQRS = dispatchRequestToCQRS;
|
_dispatchRequestToCQRS = dispatchRequestToCQRS;
|
||||||
}
|
}
|
||||||
public override async Task<GetAllUserWalletChangeLogResponse> GetAllUserWalletChangeLog(Empty request, ServerCallContext context)
|
public override async Task<GetAllUserWalletChangeLogResponse> GetAllUserWalletChangeLog(GetAllUserWalletChangeLogRequest request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
return await _dispatchRequestToCQRS.Handle<GetAllUserWalletChangeLogQuery, GetAllUserWalletChangeLogResponse>(context);
|
return await _dispatchRequestToCQRS.Handle<GetAllUserWalletChangeLogRequest, GetAllUserWalletChangeLogQuery, GetAllUserWalletChangeLogResponse>(request, context);
|
||||||
}
|
}
|
||||||
public override async Task<GetUserWalletResponse> GetUserWallet(Empty request, ServerCallContext context)
|
public override async Task<GetUserWalletResponse> GetUserWallet(Empty request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
@@ -26,8 +28,16 @@ public class UserWalletService : UserWalletContract.UserWalletContractBase
|
|||||||
{
|
{
|
||||||
return await _dispatchRequestToCQRS.Handle<TransferUserWalletBallanceCommand, Empty>(context);
|
return await _dispatchRequestToCQRS.Handle<TransferUserWalletBallanceCommand, Empty>(context);
|
||||||
}
|
}
|
||||||
public override async Task<Empty> WithdrawBalance(Empty request, ServerCallContext context)
|
public override async Task<Empty> WithdrawBalance(WithdrawBalanceRequest request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
return await _dispatchRequestToCQRS.Handle<WithdrawBalanceCommand, Empty>(context);
|
return await _dispatchRequestToCQRS.Handle<WithdrawBalanceRequest, WithdrawBalanceCommand, Empty>(request, context);
|
||||||
|
}
|
||||||
|
public override async Task<GetUserWithdrawalsResponse> GetUserWithdrawals(GetUserWithdrawalsRequest request, ServerCallContext context)
|
||||||
|
{
|
||||||
|
return await _dispatchRequestToCQRS.Handle<GetUserWithdrawalsRequest, GetUserWithdrawalsQuery, GetUserWithdrawalsResponse>(request, context);
|
||||||
|
}
|
||||||
|
public override async Task<GetWithdrawalSettingsResponse> GetWithdrawalSettings(Empty request, ServerCallContext context)
|
||||||
|
{
|
||||||
|
return await _dispatchRequestToCQRS.Handle<GetWithdrawalSettingsQuery, GetWithdrawalSettingsResponse>(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-1
@@ -3,7 +3,7 @@
|
|||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Version>0.0.11</Version>
|
<Version>0.0.12</Version>
|
||||||
<PackageId>Foursat.FrontOffice.BFF.Category.Protobuf</PackageId>
|
<PackageId>Foursat.FrontOffice.BFF.Category.Protobuf</PackageId>
|
||||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||||
<DebugSymbols>False</DebugSymbols>
|
<DebugSymbols>False</DebugSymbols>
|
||||||
@@ -22,4 +22,13 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Protobuf Include="Protos\category.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
<Protobuf Include="Protos\category.proto" ProtoRoot="Protos\" GrpcServices="Both" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="PushToFoursatNuget" AfterTargets="Pack">
|
||||||
|
<PropertyGroup>
|
||||||
|
<NugetPackagePath>$(PackageOutputPath)$(PackageId).$(Version).nupkg</NugetPackagePath>
|
||||||
|
<PushCommand>dotnet nuget push **/*.nupkg --source https://git.afrino.co/api/packages/FourSat/nuget/index.json --api-key 061a5cb15517c6da39c16cfce8556c55ae104d0d --skip-duplicate && del "$(NugetPackagePath)"</PushCommand>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Exec Command="$(PushCommand)" />
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Version>0.0.15</Version>
|
<Version>0.0.16</Version>
|
||||||
<PackageId>Foursat.FrontOffice.BFF.Products.Protobuf</PackageId>
|
<PackageId>Foursat.FrontOffice.BFF.Products.Protobuf</PackageId>
|
||||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||||
<DebugSymbols>False</DebugSymbols>
|
<DebugSymbols>False</DebugSymbols>
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Version>0.0.13</Version>
|
<Version>0.0.14</Version>
|
||||||
<PackageId>Foursat.FrontOffice.BFF.UserWallet.Protobuf</PackageId>
|
<PackageId>Foursat.FrontOffice.BFF.UserWallet.Protobuf</PackageId>
|
||||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||||
<DebugSymbols>False</DebugSymbols>
|
<DebugSymbols>False</DebugSymbols>
|
||||||
|
|||||||
@@ -12,10 +12,10 @@ option csharp_namespace = "FrontOffice.BFF.UserWallet.Protobuf.Protos.UserWallet
|
|||||||
|
|
||||||
service UserWalletContract
|
service UserWalletContract
|
||||||
{
|
{
|
||||||
rpc GetAllUserWalletChangeLog(google.protobuf.Empty) returns (GetAllUserWalletChangeLogResponse){
|
rpc GetAllUserWalletChangeLog(GetAllUserWalletChangeLogRequest) returns (GetAllUserWalletChangeLogResponse){
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
get: "/GetAllUserWalletChangeLog"
|
post: "/GetAllUserWalletChangeLog"
|
||||||
|
body: "*"
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
rpc GetUserWallet(google.protobuf.Empty) returns (GetUserWalletResponse){
|
rpc GetUserWallet(google.protobuf.Empty) returns (GetUserWalletResponse){
|
||||||
@@ -30,12 +30,23 @@ service UserWalletContract
|
|||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
rpc WithdrawBalance(google.protobuf.Empty) returns (google.protobuf.Empty){
|
rpc WithdrawBalance(WithdrawBalanceRequest) returns (google.protobuf.Empty){
|
||||||
option (google.api.http) = {
|
option (google.api.http) = {
|
||||||
post: "/WithdrawBalance"
|
post: "/WithdrawBalance"
|
||||||
body: "*"
|
body: "*"
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
rpc GetUserWithdrawals(GetUserWithdrawalsRequest) returns (GetUserWithdrawalsResponse){
|
||||||
|
option (google.api.http) = {
|
||||||
|
post: "/GetUserWithdrawals"
|
||||||
|
body: "*"
|
||||||
|
};
|
||||||
|
};
|
||||||
|
rpc GetWithdrawalSettings(google.protobuf.Empty) returns (GetWithdrawalSettingsResponse){
|
||||||
|
option (google.api.http) = {
|
||||||
|
get: "/GetWithdrawalSettings"
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
message GetAllUserWalletChangeLogResponse
|
message GetAllUserWalletChangeLogResponse
|
||||||
{
|
{
|
||||||
@@ -56,6 +67,45 @@ message GetUserWalletResponse
|
|||||||
{
|
{
|
||||||
int64 balance = 1;
|
int64 balance = 1;
|
||||||
int64 network_balance = 2;
|
int64 network_balance = 2;
|
||||||
|
int64 discount_balance = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message WithdrawBalanceRequest
|
||||||
|
{
|
||||||
|
int64 payout_id = 1;
|
||||||
|
int32 withdrawal_method = 2; // 0: Cash, 1: Diamond
|
||||||
|
google.protobuf.StringValue iban_number = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetAllUserWalletChangeLogRequest
|
||||||
|
{
|
||||||
|
google.protobuf.Int64Value reference_id = 1;
|
||||||
|
google.protobuf.BoolValue is_increase = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetUserWithdrawalsRequest
|
||||||
|
{
|
||||||
|
google.protobuf.Int32Value status = 1;
|
||||||
|
}
|
||||||
|
message GetUserWithdrawalsResponse
|
||||||
|
{
|
||||||
|
MetaData meta_data = 1;
|
||||||
|
repeated UserWithdrawalModel models = 2;
|
||||||
|
}
|
||||||
|
message UserWithdrawalModel
|
||||||
|
{
|
||||||
|
int64 id = 1;
|
||||||
|
string week_number = 2;
|
||||||
|
int64 total_amount = 3;
|
||||||
|
int32 status = 4;
|
||||||
|
google.protobuf.Int32Value withdrawal_method = 5;
|
||||||
|
string iban_number = 6;
|
||||||
|
google.protobuf.Timestamp created = 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetWithdrawalSettingsResponse
|
||||||
|
{
|
||||||
|
int64 min_withdrawal_amount = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PaginationState
|
message PaginationState
|
||||||
|
|||||||
Reference in New Issue
Block a user