Compare commits
7 Commits
4c5cff1a9a
...
production
| Author | SHA1 | Date | |
|---|---|---|---|
| 0336120193 | |||
| 721207f6a0 | |||
| ce7683c736 | |||
| f5e7d0c882 | |||
| 86d1370535 | |||
| 92aebb42b5 | |||
| c7fc30c83e |
@@ -6,55 +6,47 @@ on:
|
||||
- production
|
||||
|
||||
env:
|
||||
REGISTRY: gitea-svc:3000
|
||||
EXTERNAL_REGISTRY: git.foursat.afrino.co
|
||||
REGISTRY: 194.5.195.53:30080
|
||||
IMAGE_NAME: admin/backoffice-bff
|
||||
K8S_SERVER: 45.149.79.127
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: docker:latest
|
||||
image: 194.5.195.53:32082/docker-sshpass:latest
|
||||
options: --privileged
|
||||
env:
|
||||
HTTP_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
|
||||
HTTPS_PROXY: http://proxyuser:87zH26nbqT2@46.249.98.211:3128
|
||||
NO_PROXY: localhost,127.0.0.1,gitea-svc,45.149.79.127,194.5.195.53,10.0.0.0/8
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apk add --no-cache git curl
|
||||
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||
chmod +x kubectl
|
||||
mv kubectl /usr/local/bin/
|
||||
|
||||
- name: Start Docker daemon
|
||||
run: |
|
||||
mkdir -p /etc/docker
|
||||
cat > /etc/docker/daemon.json << 'DAEMON'
|
||||
{
|
||||
"insecure-registries": ["git.foursat.afrino.co", "gitea-svc:3000"]
|
||||
"insecure-registries": ["194.5.195.53:30080", "194.5.195.53:32082"]
|
||||
}
|
||||
DAEMON
|
||||
mkdir -p ~/.docker
|
||||
cat > ~/.docker/config.json << 'CONF'
|
||||
{
|
||||
"proxies": {
|
||||
"default": {
|
||||
"httpProxy": "http://proxyuser:87zH26nbqT2@46.249.98.211:3128",
|
||||
"httpsProxy": "http://proxyuser:87zH26nbqT2@46.249.98.211:3128",
|
||||
"noProxy": "localhost,127.0.0.1,gitea-svc,194.5.195.53,10.0.0.0/8"
|
||||
}
|
||||
}
|
||||
}
|
||||
CONF
|
||||
echo "🚀 Starting Docker daemon..."
|
||||
dockerd &
|
||||
for i in $(seq 1 30); do docker info >/dev/null 2>&1 && break || sleep 2; done
|
||||
|
||||
|
||||
for i in $(seq 1 90); do
|
||||
if docker info >/dev/null 2>&1; then
|
||||
echo "✅ Docker daemon is ready (attempt $i)"
|
||||
docker version
|
||||
break
|
||||
else
|
||||
echo "⏳ Waiting for Docker daemon... (attempt $i/90)"
|
||||
sleep 2
|
||||
fi
|
||||
done
|
||||
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
echo "❌ Docker daemon failed to start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Checkout code
|
||||
run: |
|
||||
git clone --depth 1 --branch production http://gitea-svc:3000/admin/BackOffice.BFF.git .
|
||||
git log -1 --format="%H %s"
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
@@ -62,22 +54,15 @@ jobs:
|
||||
docker build -f BackOffice.BFF.WebApi/Dockerfile \
|
||||
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
|
||||
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:prod \
|
||||
-t ${{ env.EXTERNAL_REGISTRY }}/${{ env.IMAGE_NAME }}:prod \
|
||||
--build-arg HTTP_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
|
||||
--build-arg HTTPS_PROXY=http://proxyuser:87zH26nbqT2@46.249.98.211:3128 \
|
||||
.
|
||||
|
||||
- name: Push to Registry
|
||||
run: |
|
||||
echo "87zH26nbqT" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
|
||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
|
||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
|
||||
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:prod
|
||||
echo "87zH26nbqT" | docker login ${{ env.EXTERNAL_REGISTRY }} -u admin --password-stdin
|
||||
docker push ${{ env.EXTERNAL_REGISTRY }}/${{ env.IMAGE_NAME }}:prod
|
||||
|
||||
|
||||
- name: Deploy to Production
|
||||
run: |
|
||||
mkdir -p ~/.kube
|
||||
echo "${{ secrets.KUBECONFIG_PROD }}" | base64 -d > ~/.kube/config
|
||||
kubectl rollout restart deployment/backoffice-bff || echo "Deployment not found"
|
||||
kubectl rollout status deployment/backoffice-bff --timeout=5m || echo "Rollout pending"
|
||||
sshpass -p "${{ secrets.K8S_SSH_PASSWORD }}" ssh -o StrictHostKeyChecking=no root@${{ env.K8S_SERVER }} \
|
||||
"kubectl rollout restart deployment/backoffice-bff && kubectl rollout status deployment/backoffice-bff --timeout=5m" || echo "Deployment pending"
|
||||
|
||||
+7
-2
@@ -10,10 +10,15 @@ public record UserWeeklyBalanceDto
|
||||
{
|
||||
public long Id { get; init; }
|
||||
public long UserId { get; init; }
|
||||
public string UserFullName { get; init; } = string.Empty;
|
||||
public long WeekDefinitionId { get; init; }
|
||||
public string WeekDisplayName { get; init; } = string.Empty;
|
||||
public int LeftLegBalances { get; init; }
|
||||
public int RightLegBalances { get; init; }
|
||||
public int LeftLegNewMembers { get; init; }
|
||||
public int LeftLegCarryover { get; init; }
|
||||
public int LeftLegTotal { get; init; }
|
||||
public int RightLegNewMembers { get; init; }
|
||||
public int RightLegCarryover { get; init; }
|
||||
public int RightLegTotal { get; init; }
|
||||
public int TotalBalances { get; init; }
|
||||
public long WeeklyPoolContribution { get; init; }
|
||||
public DateTime? CalculatedAt { get; init; }
|
||||
|
||||
+30
-1
@@ -37,6 +37,35 @@ public class GetWithdrawalRequestsQueryHandler : IRequestHandler<GetWithdrawalRe
|
||||
}
|
||||
|
||||
var response = await _context.Commissions.GetWithdrawalRequestsAsync(grpcRequest, cancellationToken: cancellationToken);
|
||||
return response.Adapt<GetWithdrawalRequestsResponseDto>();
|
||||
|
||||
return new GetWithdrawalRequestsResponseDto
|
||||
{
|
||||
MetaData = new MetaDataDto
|
||||
{
|
||||
TotalCount = (int)(response.MetaData?.TotalCount ?? 0),
|
||||
PageSize = (int)(response.MetaData?.PageSize ?? request.PageSize),
|
||||
CurrentPage = (int)(response.MetaData?.CurrentPage ?? request.PageIndex),
|
||||
TotalPages = (int)(response.MetaData?.TotalPage ?? 0)
|
||||
},
|
||||
Models = response.Models.Select(m => new WithdrawalRequestDto
|
||||
{
|
||||
Id = m.Id,
|
||||
UserId = m.UserId,
|
||||
UserName = m.UserName,
|
||||
WeekDefinitionId = m.WeekDefinitionId,
|
||||
Amount = m.Amount,
|
||||
Status = m.Status,
|
||||
WithdrawalMethod = m.WithdrawalMethod,
|
||||
IbanNumber = m.IbanNumber,
|
||||
RequestedAt = m.RequestedAt?.ToDateTime() ?? DateTime.MinValue,
|
||||
ProcessedAt = m.ProcessedAt?.ToDateTime(),
|
||||
ProcessedBy = m.ProcessedBy,
|
||||
Reason = m.Reason,
|
||||
Created = m.Created?.ToDateTime() ?? DateTime.MinValue,
|
||||
BankReferenceId = m.BankReferenceId,
|
||||
BankTrackingCode = m.BankTrackingCode,
|
||||
PaymentFailureReason = m.PaymentFailureReason
|
||||
}).ToList()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
+8
-7
@@ -11,18 +11,19 @@ public record WithdrawalRequestDto
|
||||
public long Id { get; init; }
|
||||
public long UserId { get; init; }
|
||||
public string UserName { get; init; } = string.Empty;
|
||||
public string PhoneNumber { get; init; } = string.Empty;
|
||||
public long WeekDefinitionId { get; init; }
|
||||
public long Amount { get; init; }
|
||||
public int Status { get; init; }
|
||||
public string Method { get; init; } = "Bank";
|
||||
public string? BankAccount { get; init; }
|
||||
public string? BankName { get; init; }
|
||||
public int WithdrawalMethod { get; init; }
|
||||
public string? IbanNumber { get; init; }
|
||||
public DateTime RequestedAt { get; init; }
|
||||
public DateTime? ProcessedAt { get; init; }
|
||||
public string? ProcessedBy { get; init; }
|
||||
public string? Reason { get; init; }
|
||||
public DateTime Created { get; init; }
|
||||
public string? BankReferenceId { get; init; }
|
||||
public string? BankTrackingCode { get; init; }
|
||||
public string? PaymentFailureReason { get; init; }
|
||||
public DateTime RequestDate { get; init; }
|
||||
public DateTime? ProcessedDate { get; init; }
|
||||
public string? AdminNote { get; init; }
|
||||
}
|
||||
|
||||
public record MetaDataDto
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetWeeklyPool;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetAllWeeklyPools;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetUserWeeklyBalances;
|
||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||
using WeeklyPoolsMetaDataDto = BackOffice.BFF.Application.CommissionCQ.Queries.GetAllWeeklyPools.MetaDataDto;
|
||||
using UserBalancesMetaDataDto = BackOffice.BFF.Application.CommissionCQ.Queries.GetUserWeeklyBalances.MetaDataDto;
|
||||
|
||||
namespace BackOffice.BFF.Application.Common.Mappings;
|
||||
|
||||
@@ -7,7 +11,7 @@ public class CommissionProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
config.NewConfig< GetWeeklyCommissionPoolResponse,GetWeeklyPoolResponseDto>()
|
||||
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)
|
||||
@@ -15,9 +19,63 @@ public class CommissionProfile : IRegister
|
||||
.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())
|
||||
;
|
||||
|
||||
|
||||
.Map(dest => dest.Created, src => src.Created.ToDateTimeOffset());
|
||||
|
||||
// CMS GetAllWeeklyPoolsResponse -> GetAllWeeklyPoolsResponseDto
|
||||
config.NewConfig<GetAllWeeklyPoolsResponse, GetAllWeeklyPoolsResponseDto>()
|
||||
.MapWith(src => new GetAllWeeklyPoolsResponseDto
|
||||
{
|
||||
MetaData = new WeeklyPoolsMetaDataDto
|
||||
{
|
||||
TotalCount = (int)src.MetaData.TotalCount,
|
||||
PageSize = (int)src.MetaData.PageSize,
|
||||
CurrentPage = (int)src.MetaData.CurrentPage,
|
||||
TotalPages = (int)src.MetaData.TotalPage
|
||||
},
|
||||
Models = src.Models.Select(m => new WeeklyCommissionPoolDto
|
||||
{
|
||||
Id = m.Id,
|
||||
WeekDefinitionId = m.WeekDefinitionId,
|
||||
WeekDisplayName = m.WeekDisplayName,
|
||||
TotalPoolAmount = m.TotalPoolAmount,
|
||||
TotalBalances = m.TotalBalances,
|
||||
ValuePerBalance = m.ValuePerBalance,
|
||||
IsCalculated = m.IsCalculated,
|
||||
CalculatedAt = m.CalculatedAt != null ? m.CalculatedAt.ToDateTime() : null,
|
||||
Created = m.Created.ToDateTime()
|
||||
}).ToList()
|
||||
});
|
||||
|
||||
// CMS GetUserWeeklyBalancesResponse -> GetUserWeeklyBalancesResponseDto
|
||||
config.NewConfig<GetUserWeeklyBalancesResponse, GetUserWeeklyBalancesResponseDto>()
|
||||
.MapWith(src => new GetUserWeeklyBalancesResponseDto
|
||||
{
|
||||
MetaData = new UserBalancesMetaDataDto
|
||||
{
|
||||
TotalCount = (int)src.MetaData.TotalCount,
|
||||
PageSize = (int)src.MetaData.PageSize,
|
||||
CurrentPage = (int)src.MetaData.CurrentPage,
|
||||
TotalPages = (int)src.MetaData.TotalPage
|
||||
},
|
||||
Models = src.Models.Select(m => new UserWeeklyBalanceDto
|
||||
{
|
||||
Id = m.Id,
|
||||
UserId = m.UserId,
|
||||
UserFullName = m.UserFullName ?? string.Empty,
|
||||
WeekDefinitionId = m.WeekDefinitionId,
|
||||
WeekDisplayName = m.WeekDisplayName ?? string.Empty,
|
||||
LeftLegNewMembers = m.LeftLegNewMembers,
|
||||
LeftLegCarryover = m.LeftLegCarryover,
|
||||
LeftLegTotal = m.LeftLegTotal,
|
||||
RightLegNewMembers = m.RightLegNewMembers,
|
||||
RightLegCarryover = m.RightLegCarryover,
|
||||
RightLegTotal = m.RightLegTotal,
|
||||
TotalBalances = m.TotalBalances,
|
||||
WeeklyPoolContribution = m.WeeklyPoolContribution,
|
||||
CalculatedAt = m.CalculatedAt != null ? m.CalculatedAt.ToDateTime() : null,
|
||||
IsExpired = m.IsExpired,
|
||||
Created = m.Created.ToDateTime()
|
||||
}).ToList()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Afrino.FMSMicroservice.Protobuf" Version="0.0.122" />
|
||||
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.159" />
|
||||
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.162" />
|
||||
|
||||
<PackageReference Include="Google.Protobuf" Version="3.23.3" />
|
||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.54.0" />
|
||||
|
||||
@@ -3,6 +3,8 @@ using BackOffice.BFF.Application.CommissionCQ.Queries.GetAllWeeklyPools;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetUserWeeklyBalances;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetAvailableWeeks;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetUserPayouts;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Queries.GetWithdrawalRequests;
|
||||
using BackOffice.BFF.Application.CommissionCQ.Commands.ProcessWithdrawal;
|
||||
using Foursat.BackOffice.BFF.Commission.Protos;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -12,6 +14,12 @@ public class CommissionProfile : IRegister
|
||||
{
|
||||
void IRegister.Register(TypeAdapterConfig config)
|
||||
{
|
||||
// ProcessWithdrawalRequest -> ProcessWithdrawalCommand
|
||||
config.NewConfig<ProcessWithdrawalRequest, ProcessWithdrawalCommand>()
|
||||
.Map(dest => dest.WithdrawalId, src => src.PayoutId)
|
||||
.Map(dest => dest.IsApproved, src => src.IsApproved)
|
||||
.Map(dest => dest.Reason, src => src.Reason);
|
||||
|
||||
// GetUserCommissionPayoutsRequest -> GetUserPayoutsQuery
|
||||
config.NewConfig<GetUserCommissionPayoutsRequest, GetUserPayoutsQuery>()
|
||||
.MapWith(src => new GetUserPayoutsQuery
|
||||
@@ -68,34 +76,8 @@ public class CommissionProfile : IRegister
|
||||
});
|
||||
|
||||
// GetUserPayoutsResponseDto -> GetUserCommissionPayoutsResponse
|
||||
// config.NewConfig<GetUserPayoutsResponseDto, GetUserCommissionPayoutsResponse>()
|
||||
// .MapWith(src => new GetUserCommissionPayoutsResponse
|
||||
// {
|
||||
// MetaData = new BackOffice.BFF.Protobuf.Common.MetaData
|
||||
// {
|
||||
// CurrentPage = src.MetaData.CurrentPage,
|
||||
// PageSize = src.MetaData.PageSize,
|
||||
// TotalCount = src.MetaData.TotalCount,
|
||||
// TotalPage = src.MetaData.TotalPage
|
||||
// },
|
||||
// Models = { (src.Models ?? new List<GetUserPayoutsResponseModel>()).Select(m => new UserCommissionPayoutModel
|
||||
// {
|
||||
// Id = m.Id,
|
||||
// UserId = m.UserId,
|
||||
// UserName = m.UserName,
|
||||
// WeekNumber = m.WeekNumber,
|
||||
// BalancesEarned = m.BalancesEarned,
|
||||
// ValuePerBalance = m.ValuePerBalance,
|
||||
// TotalAmount = m.TotalAmount,
|
||||
// Status = m.Status,
|
||||
// WithdrawalMethod = m.WithdrawalMethod,
|
||||
// IbanNumber = m.IbanNumber,
|
||||
// Created = Timestamp.FromDateTime(DateTime.SpecifyKind(m.Created, DateTimeKind.Utc)),
|
||||
// LastModified = m.LastModified.HasValue
|
||||
// ? Timestamp.FromDateTime(DateTime.SpecifyKind(m.LastModified.Value, DateTimeKind.Utc))
|
||||
// : null
|
||||
// }) }
|
||||
// });
|
||||
config.NewConfig<GetUserPayoutsResponseDto, GetUserCommissionPayoutsResponse>()
|
||||
.MapWith(src => MapPayoutsResponse(src));
|
||||
|
||||
// GetAllWeeklyPoolsResponseDto -> GetAllWeeklyPoolsResponse
|
||||
config.NewConfig<GetAllWeeklyPoolsResponseDto, GetAllWeeklyPoolsResponse>()
|
||||
@@ -139,10 +121,15 @@ public class CommissionProfile : IRegister
|
||||
{
|
||||
Id = m.Id,
|
||||
UserId = m.UserId,
|
||||
UserFullName = m.UserFullName ?? string.Empty,
|
||||
WeekDefinitionId = m.WeekDefinitionId,
|
||||
WeekDisplayName = m.WeekDisplayName ?? string.Empty,
|
||||
LeftLegBalances = m.LeftLegBalances,
|
||||
RightLegBalances = m.RightLegBalances,
|
||||
LeftLegNewMembers = m.LeftLegNewMembers,
|
||||
LeftLegCarryover = m.LeftLegCarryover,
|
||||
LeftLegTotal = m.LeftLegTotal,
|
||||
RightLegNewMembers = m.RightLegNewMembers,
|
||||
RightLegCarryover = m.RightLegCarryover,
|
||||
RightLegTotal = m.RightLegTotal,
|
||||
TotalBalances = m.TotalBalances,
|
||||
WeeklyPoolContribution = m.WeeklyPoolContribution,
|
||||
CalculatedAt = m.CalculatedAt.HasValue
|
||||
@@ -154,33 +141,38 @@ public class CommissionProfile : IRegister
|
||||
});
|
||||
|
||||
// GetWithdrawalRequestsResponseDto -> GetWithdrawalRequestsResponse
|
||||
// config.NewConfig<GetWithdrawalRequestsResponseDto, GetWithdrawalRequestsResponse>()
|
||||
// .MapWith(src => new GetWithdrawalRequestsResponse
|
||||
// {
|
||||
// MetaData = new BackOffice.BFF.Protobuf.Common.MetaData
|
||||
// {
|
||||
// CurrentPage = src.MetaData.CurrentPage,
|
||||
// PageSize = src.MetaData.PageSize,
|
||||
// TotalCount = src.MetaData.TotalCount,
|
||||
// TotalPage = src.MetaData.TotalPages
|
||||
// },
|
||||
// Models = { src.Models.Select(m => new WithdrawalRequestModel
|
||||
// {
|
||||
// Id = m.Id,
|
||||
// UserId = m.UserId,
|
||||
// UserName = m.UserName ?? string.Empty,
|
||||
// Amount = m.Amount,
|
||||
// Status = m.Status,
|
||||
// StatusDisplay = m.StatusDisplay ?? string.Empty,
|
||||
// RequestedAt = Timestamp.FromDateTime(DateTime.SpecifyKind(m.RequestedAt, DateTimeKind.Utc)),
|
||||
// ProcessedAt = m.ProcessedAt.HasValue
|
||||
// ? Timestamp.FromDateTime(DateTime.SpecifyKind(m.ProcessedAt.Value, DateTimeKind.Utc))
|
||||
// : null,
|
||||
// ProcessedBy = m.ProcessedBy,
|
||||
// ProcessedByName = m.ProcessedByName ?? string.Empty,
|
||||
// RejectionReason = m.RejectionReason ?? string.Empty
|
||||
// }) }
|
||||
// });
|
||||
config.NewConfig<GetWithdrawalRequestsResponseDto, GetWithdrawalRequestsResponse>()
|
||||
.MapWith(src => new GetWithdrawalRequestsResponse
|
||||
{
|
||||
MetaData = new BackOffice.BFF.Protobuf.Common.MetaData
|
||||
{
|
||||
CurrentPage = src.MetaData.CurrentPage,
|
||||
PageSize = src.MetaData.PageSize,
|
||||
TotalCount = src.MetaData.TotalCount,
|
||||
TotalPage = src.MetaData.TotalPages
|
||||
},
|
||||
Models = { src.Models.Select(m => new WithdrawalRequestModel
|
||||
{
|
||||
Id = m.Id,
|
||||
UserId = m.UserId,
|
||||
UserName = m.UserName ?? string.Empty,
|
||||
WeekDefinitionId = m.WeekDefinitionId,
|
||||
Amount = m.Amount,
|
||||
Status = m.Status,
|
||||
WithdrawalMethod = m.WithdrawalMethod,
|
||||
IbanNumber = m.IbanNumber ?? string.Empty,
|
||||
RequestedAt = Timestamp.FromDateTime(DateTime.SpecifyKind(m.RequestedAt, DateTimeKind.Utc)),
|
||||
ProcessedAt = m.ProcessedAt.HasValue
|
||||
? Timestamp.FromDateTime(DateTime.SpecifyKind(m.ProcessedAt.Value, DateTimeKind.Utc))
|
||||
: null,
|
||||
ProcessedBy = m.ProcessedBy ?? string.Empty,
|
||||
Reason = m.Reason ?? string.Empty,
|
||||
Created = Timestamp.FromDateTime(DateTime.SpecifyKind(m.Created, DateTimeKind.Utc)),
|
||||
BankReferenceId = m.BankReferenceId ?? string.Empty,
|
||||
BankTrackingCode = m.BankTrackingCode ?? string.Empty,
|
||||
PaymentFailureReason = m.PaymentFailureReason ?? string.Empty
|
||||
}) }
|
||||
});
|
||||
|
||||
// GetWithdrawalReportsResponseDto -> GetWithdrawalReportsResponse
|
||||
// config.NewConfig<GetWithdrawalReportsResponseDto, GetWithdrawalReportsResponse>()
|
||||
@@ -237,4 +229,39 @@ public class CommissionProfile : IRegister
|
||||
DisplayText = dto.DisplayText
|
||||
};
|
||||
}
|
||||
|
||||
private static GetUserCommissionPayoutsResponse MapPayoutsResponse(GetUserPayoutsResponseDto src)
|
||||
{
|
||||
var response = new GetUserCommissionPayoutsResponse
|
||||
{
|
||||
MetaData = new BackOffice.BFF.Protobuf.Common.MetaData
|
||||
{
|
||||
CurrentPage = src.MetaData.CurrentPage,
|
||||
PageSize = src.MetaData.PageSize,
|
||||
TotalCount = src.MetaData.TotalCount,
|
||||
TotalPage = src.MetaData.TotalPage
|
||||
}
|
||||
};
|
||||
|
||||
foreach (var m in src.Models ?? new List<GetUserPayoutsResponseModel>())
|
||||
{
|
||||
response.Models.Add(new UserCommissionPayoutModel
|
||||
{
|
||||
Id = m.Id,
|
||||
UserId = m.UserId,
|
||||
UserName = m.UserName ?? "",
|
||||
WeekDefinitionId = m.WeekDefinitionId,
|
||||
WeekDisplayName = m.WeekDisplayName ?? "",
|
||||
BalancesEarned = m.BalancesEarned,
|
||||
ValuePerBalance = m.ValuePerBalance,
|
||||
TotalAmount = m.TotalAmount,
|
||||
Status = m.Status,
|
||||
WithdrawalMethod = m.WithdrawalMethod,
|
||||
IbanNumber = m.IbanNumber ?? "",
|
||||
Created = Timestamp.FromDateTime(DateTime.SpecifyKind(m.Created, DateTimeKind.Utc))
|
||||
});
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,5 +60,9 @@ public class GeneralMapping : IRegister
|
||||
|
||||
config.NewConfig<byte[], Google.Protobuf.ByteString>()
|
||||
.MapWith(src => Google.Protobuf.ByteString.CopyFrom(src));
|
||||
|
||||
// MediatR Unit to Google.Protobuf.Empty
|
||||
config.NewConfig<MediatR.Unit, Google.Protobuf.WellKnownTypes.Empty>()
|
||||
.MapWith(_ => new Google.Protobuf.WellKnownTypes.Empty());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
|
||||
FROM 194.5.195.53:32082/dotnet/aspnet:9.0 AS base
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
FROM 194.5.195.53:32082/dotnet/sdk:9.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["BackOffice.BFF.WebApi/NuGet.config", "NuGet.config"]
|
||||
|
||||
+2
-5
@@ -11,8 +11,7 @@
|
||||
},
|
||||
"GrpcChannelOptions": {
|
||||
"FMSMSAddress": "https://dl.afrino.co",
|
||||
"CMSMSAddress": "https://cms.kbs1.ir"
|
||||
// "CMSMSAddress": "https://localhost:32846"
|
||||
"CMSMSAddress": "http://cms-svc"
|
||||
},
|
||||
"Authentication": {
|
||||
"Authority": "https://ids.domain.com/",
|
||||
@@ -21,9 +20,7 @@
|
||||
"Kavenegar": {
|
||||
"Sender": "1000001110100",
|
||||
"ApiKey": "497263626F32626A48685A6137524C4F78575A766E4C74694A556B79317648424964655030682B554545413D"
|
||||
}
|
||||
}
|
||||
,
|
||||
},
|
||||
"Seq": {
|
||||
"ServerUrl": "http://seq-svc:5341",
|
||||
"ApiKey": ""
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>true</IsPackable>
|
||||
<PackageId>Foursat.BackOffice.BFF.Commission.Protobuf</PackageId>
|
||||
<Version>0.0.13</Version>
|
||||
<Version>0.0.15</Version>
|
||||
<Authors>FourSat</Authors>
|
||||
<Company>FourSat</Company>
|
||||
<Product>BackOffice.BFF.Commission.Protobuf</Product>
|
||||
|
||||
@@ -279,15 +279,20 @@ message UserWeeklyBalanceModel
|
||||
{
|
||||
int64 id = 1;
|
||||
int64 user_id = 2;
|
||||
int64 week_definition_id = 3;
|
||||
string week_display_name = 4;
|
||||
int32 left_leg_balances = 5;
|
||||
int32 right_leg_balances = 6;
|
||||
int32 total_balances = 7;
|
||||
int64 weekly_pool_contribution = 8;
|
||||
google.protobuf.Timestamp calculated_at = 9;
|
||||
bool is_expired = 10;
|
||||
google.protobuf.Timestamp created = 11;
|
||||
string user_full_name = 3; // نام کامل کاربر
|
||||
int64 week_definition_id = 4;
|
||||
string week_display_name = 5;
|
||||
int32 left_leg_new_members = 6; // اعضای جدید چپ این هفته
|
||||
int32 left_leg_carryover = 7; // باقیمانده چپ از هفته قبل
|
||||
int32 left_leg_total = 8; // مجموع چپ (NewMembers + Carryover)
|
||||
int32 right_leg_new_members = 9; // اعضای جدید راست این هفته
|
||||
int32 right_leg_carryover = 10; // باقیمانده راست از هفته قبل
|
||||
int32 right_leg_total = 11; // مجموع راست (NewMembers + Carryover)
|
||||
int32 total_balances = 12; // تعداد تعادل = MIN(چپ, راست)
|
||||
int64 weekly_pool_contribution = 13;
|
||||
google.protobuf.Timestamp calculated_at = 14;
|
||||
bool is_expired = 15;
|
||||
google.protobuf.Timestamp created = 16;
|
||||
}
|
||||
|
||||
// GetAllWeeklyPools Query
|
||||
|
||||
Reference in New Issue
Block a user