Compare commits

...

7 Commits

Author SHA1 Message Date
masoodafar-web 0336120193 chore: Update production workflow to use Nexus registry (no proxy needed)
Build and Deploy to Production / build-and-deploy (push) Failing after 0s
- Changed Dockerfile base images to use 194.5.195.53:32082 (Nexus)
- Updated workflow to use docker-sshpass image from Nexus
- Removed HTTP_PROXY/HTTPS_PROXY dependencies
- Changed deploy method to SSH instead of kubeconfig
- Registry: 194.5.195.53:30080 (Gitea internal)
- K8S Server: 45.149.79.127 (Production)
2026-01-29 22:04:31 +03:30
masoodafar-web 721207f6a0 feat: update GetUserWeeklyBalances response structure and mappings
Build and Deploy / build (push) Successful in 1m47s
Build and Deploy to Production / build-and-deploy (push) Successful in 2m22s
2025-12-27 22:10:30 +03:30
masoodafar-web ce7683c736 feat: enhance GetWithdrawalRequests response structure and update related mappings
Build and Deploy / build (push) Failing after 1m11s
2025-12-27 21:52:50 +03:30
masoodafar-web f5e7d0c882 feat: add mapping for ProcessWithdrawalRequest to ProcessWithdrawalCommand
Build and Deploy / build (push) Successful in 1m39s
Build and Deploy to Production / build-and-deploy (push) Successful in 1m45s
2025-12-27 07:23:00 +03:30
masoodafar-web 86d1370535 feat: implement mapping for GetUserPayoutsResponseDto to GetUserCommissionPayoutsResponse
Build and Deploy / build (push) Successful in 1m58s
2025-12-27 06:45:59 +03:30
masoodafar-web 92aebb42b5 feat: add mapping for MediatR.Unit to Google.Protobuf.Empty
Build and Deploy / build (push) Successful in 1m48s
2025-12-27 02:38:02 +03:30
masoodafar-web c7fc30c83e feat: update Foursat.CMSMicroservice.Protobuf package version and add mapping for GetAllWeeklyPoolsResponse
Build and Deploy / build (push) Successful in 1m48s
2025-12-26 09:44:58 +03:30
12 changed files with 242 additions and 131 deletions
+24 -39
View File
@@ -6,55 +6,47 @@ on:
- production - production
env: env:
REGISTRY: gitea-svc:3000 REGISTRY: 194.5.195.53:30080
EXTERNAL_REGISTRY: git.foursat.afrino.co
IMAGE_NAME: admin/backoffice-bff IMAGE_NAME: admin/backoffice-bff
K8S_SERVER: 45.149.79.127
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: docker:latest image: 194.5.195.53:32082/docker-sshpass:latest
options: --privileged 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: 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 - name: Start Docker daemon
run: | run: |
mkdir -p /etc/docker mkdir -p /etc/docker
cat > /etc/docker/daemon.json << 'DAEMON' 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 DAEMON
mkdir -p ~/.docker echo "🚀 Starting Docker daemon..."
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
dockerd & 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 - name: Checkout code
run: | run: |
git clone --depth 1 --branch production http://gitea-svc:3000/admin/BackOffice.BFF.git . git clone --depth 1 --branch production http://gitea-svc:3000/admin/BackOffice.BFF.git .
git log -1 --format="%H %s"
- name: Build Docker Image - name: Build Docker Image
run: | run: |
@@ -62,22 +54,15 @@ jobs:
docker build -f BackOffice.BFF.WebApi/Dockerfile \ docker build -f BackOffice.BFF.WebApi/Dockerfile \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \ -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \
-t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:prod \ -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 - name: Push to Registry
run: | 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 }}:${{ github.sha }}
docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:prod 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 - name: Deploy to Production
run: | run: |
mkdir -p ~/.kube sshpass -p "${{ secrets.K8S_SSH_PASSWORD }}" ssh -o StrictHostKeyChecking=no root@${{ env.K8S_SERVER }} \
echo "${{ secrets.KUBECONFIG_PROD }}" | base64 -d > ~/.kube/config "kubectl rollout restart deployment/backoffice-bff && kubectl rollout status deployment/backoffice-bff --timeout=5m" || echo "Deployment pending"
kubectl rollout restart deployment/backoffice-bff || echo "Deployment not found"
kubectl rollout status deployment/backoffice-bff --timeout=5m || echo "Rollout pending"
@@ -10,10 +10,15 @@ public record UserWeeklyBalanceDto
{ {
public long Id { get; init; } public long Id { get; init; }
public long UserId { get; init; } public long UserId { get; init; }
public string UserFullName { get; init; } = string.Empty;
public long WeekDefinitionId { get; init; } public long WeekDefinitionId { get; init; }
public string WeekDisplayName { get; init; } = string.Empty; public string WeekDisplayName { get; init; } = string.Empty;
public int LeftLegBalances { get; init; } public int LeftLegNewMembers { get; init; }
public int RightLegBalances { 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 int TotalBalances { get; init; }
public long WeeklyPoolContribution { get; init; } public long WeeklyPoolContribution { get; init; }
public DateTime? CalculatedAt { get; init; } public DateTime? CalculatedAt { get; init; }
@@ -37,6 +37,35 @@ public class GetWithdrawalRequestsQueryHandler : IRequestHandler<GetWithdrawalRe
} }
var response = await _context.Commissions.GetWithdrawalRequestsAsync(grpcRequest, cancellationToken: cancellationToken); 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()
};
} }
} }
@@ -11,18 +11,19 @@ public record WithdrawalRequestDto
public long Id { get; init; } public long Id { get; init; }
public long UserId { get; init; } public long UserId { get; init; }
public string UserName { get; init; } = string.Empty; 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 long Amount { get; init; }
public int Status { get; init; } public int Status { get; init; }
public string Method { get; init; } = "Bank"; public int WithdrawalMethod { get; init; }
public string? BankAccount { get; init; } public string? IbanNumber { get; init; }
public string? BankName { 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? BankReferenceId { get; init; }
public string? BankTrackingCode { get; init; } public string? BankTrackingCode { get; init; }
public string? PaymentFailureReason { 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 public record MetaDataDto
@@ -1,5 +1,9 @@
using BackOffice.BFF.Application.CommissionCQ.Queries.GetWeeklyPool; 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 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; namespace BackOffice.BFF.Application.Common.Mappings;
@@ -15,9 +19,63 @@ public class CommissionProfile : IRegister
.Map(dest => dest.TotalPoolAmount, src => src.TotalPoolAmount) .Map(dest => dest.TotalPoolAmount, src => src.TotalPoolAmount)
.Map(dest => dest.ValuePerBalance, src => src.ValuePerBalance) .Map(dest => dest.ValuePerBalance, src => src.ValuePerBalance)
.Map(dest => dest.TotalBalances, src => src.TotalBalances) .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> <ItemGroup>
<PackageReference Include="Afrino.FMSMicroservice.Protobuf" Version="0.0.122" /> <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="Google.Protobuf" Version="3.23.3" />
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.54.0" /> <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.GetUserWeeklyBalances;
using BackOffice.BFF.Application.CommissionCQ.Queries.GetAvailableWeeks; using BackOffice.BFF.Application.CommissionCQ.Queries.GetAvailableWeeks;
using BackOffice.BFF.Application.CommissionCQ.Queries.GetUserPayouts; 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 Foursat.BackOffice.BFF.Commission.Protos;
using System.Collections.Generic; using System.Collections.Generic;
@@ -12,6 +14,12 @@ public class CommissionProfile : IRegister
{ {
void IRegister.Register(TypeAdapterConfig config) 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 // GetUserCommissionPayoutsRequest -> GetUserPayoutsQuery
config.NewConfig<GetUserCommissionPayoutsRequest, GetUserPayoutsQuery>() config.NewConfig<GetUserCommissionPayoutsRequest, GetUserPayoutsQuery>()
.MapWith(src => new GetUserPayoutsQuery .MapWith(src => new GetUserPayoutsQuery
@@ -68,34 +76,8 @@ public class CommissionProfile : IRegister
}); });
// GetUserPayoutsResponseDto -> GetUserCommissionPayoutsResponse // GetUserPayoutsResponseDto -> GetUserCommissionPayoutsResponse
// config.NewConfig<GetUserPayoutsResponseDto, GetUserCommissionPayoutsResponse>() config.NewConfig<GetUserPayoutsResponseDto, GetUserCommissionPayoutsResponse>()
// .MapWith(src => new GetUserCommissionPayoutsResponse .MapWith(src => MapPayoutsResponse(src));
// {
// 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
// }) }
// });
// GetAllWeeklyPoolsResponseDto -> GetAllWeeklyPoolsResponse // GetAllWeeklyPoolsResponseDto -> GetAllWeeklyPoolsResponse
config.NewConfig<GetAllWeeklyPoolsResponseDto, GetAllWeeklyPoolsResponse>() config.NewConfig<GetAllWeeklyPoolsResponseDto, GetAllWeeklyPoolsResponse>()
@@ -139,10 +121,15 @@ public class CommissionProfile : IRegister
{ {
Id = m.Id, Id = m.Id,
UserId = m.UserId, UserId = m.UserId,
UserFullName = m.UserFullName ?? string.Empty,
WeekDefinitionId = m.WeekDefinitionId, WeekDefinitionId = m.WeekDefinitionId,
WeekDisplayName = m.WeekDisplayName ?? string.Empty, WeekDisplayName = m.WeekDisplayName ?? string.Empty,
LeftLegBalances = m.LeftLegBalances, LeftLegNewMembers = m.LeftLegNewMembers,
RightLegBalances = m.RightLegBalances, LeftLegCarryover = m.LeftLegCarryover,
LeftLegTotal = m.LeftLegTotal,
RightLegNewMembers = m.RightLegNewMembers,
RightLegCarryover = m.RightLegCarryover,
RightLegTotal = m.RightLegTotal,
TotalBalances = m.TotalBalances, TotalBalances = m.TotalBalances,
WeeklyPoolContribution = m.WeeklyPoolContribution, WeeklyPoolContribution = m.WeeklyPoolContribution,
CalculatedAt = m.CalculatedAt.HasValue CalculatedAt = m.CalculatedAt.HasValue
@@ -154,33 +141,38 @@ public class CommissionProfile : IRegister
}); });
// GetWithdrawalRequestsResponseDto -> GetWithdrawalRequestsResponse // GetWithdrawalRequestsResponseDto -> GetWithdrawalRequestsResponse
// config.NewConfig<GetWithdrawalRequestsResponseDto, GetWithdrawalRequestsResponse>() config.NewConfig<GetWithdrawalRequestsResponseDto, GetWithdrawalRequestsResponse>()
// .MapWith(src => new GetWithdrawalRequestsResponse .MapWith(src => new GetWithdrawalRequestsResponse
// { {
// MetaData = new BackOffice.BFF.Protobuf.Common.MetaData MetaData = new BackOffice.BFF.Protobuf.Common.MetaData
// { {
// CurrentPage = src.MetaData.CurrentPage, CurrentPage = src.MetaData.CurrentPage,
// PageSize = src.MetaData.PageSize, PageSize = src.MetaData.PageSize,
// TotalCount = src.MetaData.TotalCount, TotalCount = src.MetaData.TotalCount,
// TotalPage = src.MetaData.TotalPages TotalPage = src.MetaData.TotalPages
// }, },
// Models = { src.Models.Select(m => new WithdrawalRequestModel Models = { src.Models.Select(m => new WithdrawalRequestModel
// { {
// Id = m.Id, Id = m.Id,
// UserId = m.UserId, UserId = m.UserId,
// UserName = m.UserName ?? string.Empty, UserName = m.UserName ?? string.Empty,
// Amount = m.Amount, WeekDefinitionId = m.WeekDefinitionId,
// Status = m.Status, Amount = m.Amount,
// StatusDisplay = m.StatusDisplay ?? string.Empty, Status = m.Status,
// RequestedAt = Timestamp.FromDateTime(DateTime.SpecifyKind(m.RequestedAt, DateTimeKind.Utc)), WithdrawalMethod = m.WithdrawalMethod,
// ProcessedAt = m.ProcessedAt.HasValue IbanNumber = m.IbanNumber ?? string.Empty,
// ? Timestamp.FromDateTime(DateTime.SpecifyKind(m.ProcessedAt.Value, DateTimeKind.Utc)) RequestedAt = Timestamp.FromDateTime(DateTime.SpecifyKind(m.RequestedAt, DateTimeKind.Utc)),
// : null, ProcessedAt = m.ProcessedAt.HasValue
// ProcessedBy = m.ProcessedBy, ? Timestamp.FromDateTime(DateTime.SpecifyKind(m.ProcessedAt.Value, DateTimeKind.Utc))
// ProcessedByName = m.ProcessedByName ?? string.Empty, : null,
// RejectionReason = m.RejectionReason ?? string.Empty 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 // GetWithdrawalReportsResponseDto -> GetWithdrawalReportsResponse
// config.NewConfig<GetWithdrawalReportsResponseDto, GetWithdrawalReportsResponse>() // config.NewConfig<GetWithdrawalReportsResponseDto, GetWithdrawalReportsResponse>()
@@ -237,4 +229,39 @@ public class CommissionProfile : IRegister
DisplayText = dto.DisplayText 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>() config.NewConfig<byte[], Google.Protobuf.ByteString>()
.MapWith(src => Google.Protobuf.ByteString.CopyFrom(src)); .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());
} }
} }
+2 -2
View File
@@ -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 USER $APP_UID
WORKDIR /app WORKDIR /app
EXPOSE 8080 EXPOSE 8080
EXPOSE 8081 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 ARG BUILD_CONFIGURATION=Release
WORKDIR /src WORKDIR /src
COPY ["BackOffice.BFF.WebApi/NuGet.config", "NuGet.config"] COPY ["BackOffice.BFF.WebApi/NuGet.config", "NuGet.config"]
@@ -11,8 +11,7 @@
}, },
"GrpcChannelOptions": { "GrpcChannelOptions": {
"FMSMSAddress": "https://dl.afrino.co", "FMSMSAddress": "https://dl.afrino.co",
"CMSMSAddress": "https://cms.kbs1.ir" "CMSMSAddress": "http://cms-svc"
// "CMSMSAddress": "https://localhost:32846"
}, },
"Authentication": { "Authentication": {
"Authority": "https://ids.domain.com/", "Authority": "https://ids.domain.com/",
@@ -21,9 +20,7 @@
"Kavenegar": { "Kavenegar": {
"Sender": "1000001110100", "Sender": "1000001110100",
"ApiKey": "497263626F32626A48685A6137524C4F78575A766E4C74694A556B79317648424964655030682B554545413D" "ApiKey": "497263626F32626A48685A6137524C4F78575A766E4C74694A556B79317648424964655030682B554545413D"
} },
}
,
"Seq": { "Seq": {
"ServerUrl": "http://seq-svc:5341", "ServerUrl": "http://seq-svc:5341",
"ApiKey": "" "ApiKey": ""
@@ -6,7 +6,7 @@
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<IsPackable>true</IsPackable> <IsPackable>true</IsPackable>
<PackageId>Foursat.BackOffice.BFF.Commission.Protobuf</PackageId> <PackageId>Foursat.BackOffice.BFF.Commission.Protobuf</PackageId>
<Version>0.0.13</Version> <Version>0.0.15</Version>
<Authors>FourSat</Authors> <Authors>FourSat</Authors>
<Company>FourSat</Company> <Company>FourSat</Company>
<Product>BackOffice.BFF.Commission.Protobuf</Product> <Product>BackOffice.BFF.Commission.Protobuf</Product>
@@ -279,15 +279,20 @@ message UserWeeklyBalanceModel
{ {
int64 id = 1; int64 id = 1;
int64 user_id = 2; int64 user_id = 2;
int64 week_definition_id = 3; string user_full_name = 3; // نام کامل کاربر
string week_display_name = 4; int64 week_definition_id = 4;
int32 left_leg_balances = 5; string week_display_name = 5;
int32 right_leg_balances = 6; int32 left_leg_new_members = 6; // اعضای جدید چپ این هفته
int32 total_balances = 7; int32 left_leg_carryover = 7; // باقیمانده چپ از هفته قبل
int64 weekly_pool_contribution = 8; int32 left_leg_total = 8; // مجموع چپ (NewMembers + Carryover)
google.protobuf.Timestamp calculated_at = 9; int32 right_leg_new_members = 9; // اعضای جدید راست این هفته
bool is_expired = 10; int32 right_leg_carryover = 10; // باقیمانده راست از هفته قبل
google.protobuf.Timestamp created = 11; 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 // GetAllWeeklyPools Query