Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 28e81041fc | |||
| ecac62d095 | |||
| a8a3d246da | |||
| 0ed694f475 | |||
| 99c0da4ecc | |||
| 0bab1d857e | |||
| 84c519060f | |||
| a429a2328a | |||
| c53056c750 | |||
| dadd0ee66c | |||
| b71d948e0e | |||
| a189340aac |
@@ -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/frontoffice-bff
|
IMAGE_NAME: admin/frontoffice-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/FrontOffice.BFF.git .
|
git clone --depth 1 --branch production http://gitea-svc:3000/admin/FrontOffice.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 FrontOffice.BFF.WebApi/Dockerfile \
|
docker build -f FrontOffice.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/frontoffice-bff && kubectl rollout status deployment/frontoffice-bff --timeout=5m" || echo "Deployment pending"
|
||||||
kubectl rollout restart deployment/frontoffice-bff || echo "Deployment not found"
|
|
||||||
kubectl rollout status deployment/frontoffice-bff --timeout=5m || echo "Rollout pending"
|
|
||||||
|
|||||||
+1
-26
@@ -44,8 +44,7 @@ public class GetMyCommissionPayoutsQueryHandler : IRequestHandler<GetMyCommissio
|
|||||||
BalancesEarned = (int)p.BalancesEarned,
|
BalancesEarned = (int)p.BalancesEarned,
|
||||||
TotalAmount = p.TotalAmount,
|
TotalAmount = p.TotalAmount,
|
||||||
AmountFormatted = FormatCurrency(p.TotalAmount),
|
AmountFormatted = FormatCurrency(p.TotalAmount),
|
||||||
Status = MapStatus(p.Status),
|
Status = p.Status,
|
||||||
StatusBadgeColor = GetStatusColor(p.Status),
|
|
||||||
CalculatedDate = p.Created?.ToDateTime() ?? DateTime.UtcNow,
|
CalculatedDate = p.Created?.ToDateTime() ?? DateTime.UtcNow,
|
||||||
DatePersian = FormatPersianDate(p.Created?.ToDateTime())
|
DatePersian = FormatPersianDate(p.Created?.ToDateTime())
|
||||||
}).ToList();
|
}).ToList();
|
||||||
@@ -59,30 +58,6 @@ public class GetMyCommissionPayoutsQueryHandler : IRequestHandler<GetMyCommissio
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string MapStatus(int status)
|
|
||||||
{
|
|
||||||
return status switch
|
|
||||||
{
|
|
||||||
0 => "Pending",
|
|
||||||
1 => "Calculated",
|
|
||||||
2 => "Paid",
|
|
||||||
3 => "Withdrawn",
|
|
||||||
_ => "Unknown"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetStatusColor(int status)
|
|
||||||
{
|
|
||||||
return status switch
|
|
||||||
{
|
|
||||||
0 => "warning",
|
|
||||||
1 => "info",
|
|
||||||
2 => "success",
|
|
||||||
3 => "success",
|
|
||||||
_ => "default"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string FormatCurrency(long amount)
|
private static string FormatCurrency(long amount)
|
||||||
{
|
{
|
||||||
return $"{amount:N0} تومان";
|
return $"{amount:N0} تومان";
|
||||||
|
|||||||
+2
-7
@@ -41,14 +41,9 @@ public class CommissionPayoutDto
|
|||||||
public string AmountFormatted { get; set; } = string.Empty;
|
public string AmountFormatted { get; set; } = string.Empty;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// وضعیت (Pending/Calculated/Paid/Withdrawn)
|
/// وضعیت (0=Pending=1,Paid=2,WithdrawRequested=3,Withdrawn=4,PaymentFailed= 5,Cancelled)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Status { get; set; } = string.Empty;
|
public int Status { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// رنگ Badge
|
|
||||||
/// </summary>
|
|
||||||
public string StatusBadgeColor { get; set; } = string.Empty;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// تاریخ محاسبه
|
/// تاریخ محاسبه
|
||||||
|
|||||||
+9
-3
@@ -35,17 +35,23 @@ public class GetMyWeeklyBalancesQueryHandler : IRequestHandler<GetMyWeeklyBalanc
|
|||||||
var response = await _context.Commission.GetUserWeeklyBalancesAsync(cmsRequest, cancellationToken: cancellationToken);
|
var response = await _context.Commission.GetUserWeeklyBalancesAsync(cmsRequest, cancellationToken: cancellationToken);
|
||||||
|
|
||||||
// Map list of UserWeeklyBalanceModel to DTO
|
// Map list of UserWeeklyBalanceModel to DTO
|
||||||
|
// Note: CMS proto uses LeftLegTotal/RightLegTotal (sum of NewMembers + Carryover)
|
||||||
var balances = response.Models.Select(b => new WeeklyBalanceItemDto
|
var balances = response.Models.Select(b => new WeeklyBalanceItemDto
|
||||||
{
|
{
|
||||||
Id = b.Id,
|
Id = b.Id,
|
||||||
WeekDefinitionId = b.WeekDefinitionId,
|
WeekDefinitionId = b.WeekDefinitionId,
|
||||||
WeekLabel = b.WeekDisplayName,
|
WeekLabel = b.WeekDisplayName,
|
||||||
LeftLegBalances = b.LeftLegBalances,
|
LeftLegBalances = b.LeftLegTotal, // Changed from LeftLegBalances
|
||||||
RightLegBalances = b.RightLegBalances,
|
RightLegBalances = b.RightLegTotal, // Changed from RightLegBalances
|
||||||
TotalBalances = b.TotalBalances,
|
TotalBalances = b.TotalBalances,
|
||||||
WeeklyPoolContribution = b.WeeklyPoolContribution,
|
WeeklyPoolContribution = b.WeeklyPoolContribution,
|
||||||
CalculatedAt = b.CalculatedAt?.ToDateTime(),
|
CalculatedAt = b.CalculatedAt?.ToDateTime(),
|
||||||
IsExpired = b.IsExpired
|
IsExpired = b.IsExpired,
|
||||||
|
// New fields for carryover info
|
||||||
|
LeftLegCarryover = b.LeftLegCarryover,
|
||||||
|
RightLegCarryover = b.RightLegCarryover,
|
||||||
|
LeftLegNewMembers = b.LeftLegNewMembers,
|
||||||
|
RightLegNewMembers = b.RightLegNewMembers
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
// Calculate summary
|
// Calculate summary
|
||||||
|
|||||||
+20
@@ -89,4 +89,24 @@ public class WeeklyBalanceItemDto
|
|||||||
/// تاریخ شمسی
|
/// تاریخ شمسی
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DatePersian { get; set; } = string.Empty;
|
public string DatePersian { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// انتقالی پای چپ از هفته قبل
|
||||||
|
/// </summary>
|
||||||
|
public int LeftLegCarryover { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// انتقالی پای راست از هفته قبل
|
||||||
|
/// </summary>
|
||||||
|
public int RightLegCarryover { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// اعضای جدید پای چپ این هفته
|
||||||
|
/// </summary>
|
||||||
|
public int LeftLegNewMembers { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// اعضای جدید پای راست این هفته
|
||||||
|
/// </summary>
|
||||||
|
public int RightLegNewMembers { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using CMSMicroservice.Protobuf.Protos.UserAddress;
|
|||||||
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
||||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||||
|
using CMSMicroservice.Protobuf.Protos.AppVersion;
|
||||||
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;
|
||||||
@@ -63,6 +64,9 @@ public interface IApplicationContractContext
|
|||||||
|
|
||||||
// Geography System (GMS)
|
// Geography System (GMS)
|
||||||
CityContract.CityContractClient Cities { get; }
|
CityContract.CityContractClient Cities { get; }
|
||||||
|
|
||||||
|
// App Version System
|
||||||
|
AppVersionContract.AppVersionContractClient AppVersion { get; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PYMS
|
#region PYMS
|
||||||
|
|||||||
+8
@@ -0,0 +1,8 @@
|
|||||||
|
using FrontOffice.BFF.Configuration.Protobuf.Protos.AppVersion;
|
||||||
|
|
||||||
|
namespace FrontOffice.BFF.Application.ConfigurationCQ.Queries.GetAppVersion;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// دریافت نسخه اپلیکیشن برای بررسی نیاز به پاک کردن کش
|
||||||
|
/// </summary>
|
||||||
|
public record GetAppVersionQuery(string AppName, string? CurrentClientVersion) : IRequest<GetAppVersionResponseDto>;
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
using CMSMicroservice.Protobuf.Protos.AppVersion;
|
||||||
|
|
||||||
|
namespace FrontOffice.BFF.Application.ConfigurationCQ.Queries.GetAppVersion;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// هندلر دریافت نسخه اپلیکیشن از CMS
|
||||||
|
/// </summary>
|
||||||
|
public class GetAppVersionQueryHandler : IRequestHandler<GetAppVersionQuery, GetAppVersionResponseDto>
|
||||||
|
{
|
||||||
|
private readonly IApplicationContractContext _context;
|
||||||
|
|
||||||
|
public GetAppVersionQueryHandler(IApplicationContractContext context)
|
||||||
|
{
|
||||||
|
_context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<GetAppVersionResponseDto> Handle(GetAppVersionQuery request, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var cmsRequest = new GetAppVersionRequest
|
||||||
|
{
|
||||||
|
AppName = request.AppName
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(request.CurrentClientVersion))
|
||||||
|
{
|
||||||
|
cmsRequest.CurrentClientVersion = request.CurrentClientVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
var response = await _context.AppVersion.GetAppVersionAsync(cmsRequest, cancellationToken: cancellationToken);
|
||||||
|
|
||||||
|
return new GetAppVersionResponseDto
|
||||||
|
{
|
||||||
|
Found = response.Found,
|
||||||
|
AppName = response.AppName,
|
||||||
|
CurrentVersion = response.CurrentVersion,
|
||||||
|
MinRequiredVersion = response.MinRequiredVersion,
|
||||||
|
RequiresFullCacheClear = response.RequiresFullCacheClear,
|
||||||
|
RequiresUpdate = response.RequiresUpdate,
|
||||||
|
UpdateMessage = response.UpdateMessage,
|
||||||
|
ReleaseNotes = response.ReleaseNotes,
|
||||||
|
LastUpdated = response.LastUpdated?.ToDateTime()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
namespace FrontOffice.BFF.Application.ConfigurationCQ.Queries.GetAppVersion;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// DTO پاسخ نسخه اپلیکیشن
|
||||||
|
/// </summary>
|
||||||
|
public class GetAppVersionResponseDto
|
||||||
|
{
|
||||||
|
public bool Found { get; set; }
|
||||||
|
public string AppName { get; set; } = string.Empty;
|
||||||
|
public string CurrentVersion { get; set; } = string.Empty;
|
||||||
|
public string MinRequiredVersion { get; set; } = string.Empty;
|
||||||
|
public bool RequiresFullCacheClear { get; set; }
|
||||||
|
public bool RequiresUpdate { get; set; }
|
||||||
|
public string? UpdateMessage { get; set; }
|
||||||
|
public string? ReleaseNotes { get; set; }
|
||||||
|
public DateTime? LastUpdated { get; set; }
|
||||||
|
}
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
<ProjectReference Include="..\FrontOffice.BFF.Domain\FrontOffice.BFF.Domain.csproj" />
|
<ProjectReference Include="..\FrontOffice.BFF.Domain\FrontOffice.BFF.Domain.csproj" />
|
||||||
<ProjectReference Include="..\Protobufs\FrontOffice.BFF.UserOrder.Protobuf\FrontOffice.BFF.UserOrder.Protobuf.csproj" />
|
<ProjectReference Include="..\Protobufs\FrontOffice.BFF.UserOrder.Protobuf\FrontOffice.BFF.UserOrder.Protobuf.csproj" />
|
||||||
<ProjectReference Include="..\Protobufs\FrontOffice.BFF.Category.Protobuf\FrontOffice.BFF.Category.Protobuf.csproj" />
|
<ProjectReference Include="..\Protobufs\FrontOffice.BFF.Category.Protobuf\FrontOffice.BFF.Category.Protobuf.csproj" />
|
||||||
|
<ProjectReference Include="..\Protobufs\FrontOffice.BFF.Configuration.Protobuf\FrontOffice.BFF.Configuration.Protobuf.csproj" />
|
||||||
<!-- CMS Protobuf for Commission, ClubMembership, NetworkMembership, Configuration -->
|
<!-- CMS Protobuf for Commission, ClubMembership, NetworkMembership, Configuration -->
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
+1
@@ -85,6 +85,7 @@ public class GetMyNetworkTreeQueryHandler : IRequestHandler<GetMyNetworkTreeQuer
|
|||||||
JoinedAt = cmsNode.JoinedAt?.ToDateTime(),
|
JoinedAt = cmsNode.JoinedAt?.ToDateTime(),
|
||||||
IsClubActive = cmsNode.IsClubActive,
|
IsClubActive = cmsNode.IsClubActive,
|
||||||
ActivationWeekDefinitionId = cmsNode.ActivationWeekDefinitionId,
|
ActivationWeekDefinitionId = cmsNode.ActivationWeekDefinitionId,
|
||||||
|
ReferralCode = cmsNode.ReferralCode,
|
||||||
LeftChild = leftChild != null ? BuildNodeRecursive(leftChild, allNodes, nodeDict, level + 1) : null,
|
LeftChild = leftChild != null ? BuildNodeRecursive(leftChild, allNodes, nodeDict, level + 1) : null,
|
||||||
RightChild = rightChild != null ? BuildNodeRecursive(rightChild, allNodes, nodeDict, level + 1) : null
|
RightChild = rightChild != null ? BuildNodeRecursive(rightChild, allNodes, nodeDict, level + 1) : null
|
||||||
};
|
};
|
||||||
|
|||||||
+5
@@ -84,4 +84,9 @@ public class NetworkNodeDto
|
|||||||
/// شماره هفته فعالسازی
|
/// شماره هفته فعالسازی
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long? ActivationWeekDefinitionId { get; set; }
|
public long? ActivationWeekDefinitionId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// کد معرف کاربر
|
||||||
|
/// </summary>
|
||||||
|
public string? ReferralCode { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -92,6 +92,7 @@ public class GetSubordinateTreeQueryHandler : IRequestHandler<GetSubordinateTree
|
|||||||
IsActive = cmsNode.IsActive,
|
IsActive = cmsNode.IsActive,
|
||||||
JoinedAt = cmsNode.JoinedAt?.ToDateTime(),
|
JoinedAt = cmsNode.JoinedAt?.ToDateTime(),
|
||||||
IsClubActive = cmsNode.IsClubActive,
|
IsClubActive = cmsNode.IsClubActive,
|
||||||
|
ReferralCode = cmsNode.ReferralCode,
|
||||||
ActivationWeekDefinitionId = cmsNode.ActivationWeekDefinitionId,
|
ActivationWeekDefinitionId = cmsNode.ActivationWeekDefinitionId,
|
||||||
LeftChild = leftChild != null ? BuildNodeRecursive(leftChild, allNodes, nodeDict, level + 1) : null,
|
LeftChild = leftChild != null ? BuildNodeRecursive(leftChild, allNodes, nodeDict, level + 1) : null,
|
||||||
RightChild = rightChild != null ? BuildNodeRecursive(rightChild, allNodes, nodeDict, level + 1) : null
|
RightChild = rightChild != null ? BuildNodeRecursive(rightChild, allNodes, nodeDict, level + 1) : null
|
||||||
|
|||||||
+1
@@ -31,4 +31,5 @@ public class GetSubordinateTreeResponseDto
|
|||||||
/// شناسه parent برای بازگشت به عقب
|
/// شناسه parent برای بازگشت به عقب
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public long? ParentUserId { get; set; }
|
public long? ParentUserId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Afrino.PYMSMicroservice.Protobuf" Version="0.0.11" />
|
<PackageReference Include="Afrino.PYMSMicroservice.Protobuf" Version="0.0.11" />
|
||||||
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.156" />
|
<PackageReference Include="Foursat.CMSMicroservice.Protobuf" Version="0.0.162" />
|
||||||
<PackageReference Include="Google.Protobuf" Version="3.33.0" />
|
<PackageReference Include="Google.Protobuf" Version="3.33.0" />
|
||||||
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.54.0" />
|
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.54.0" />
|
||||||
<PackageReference Include="Grpc.Tools" Version="2.76.0">
|
<PackageReference Include="Grpc.Tools" Version="2.76.0">
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using CMSMicroservice.Protobuf.Protos.UserAddress;
|
|||||||
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
using CMSMicroservice.Protobuf.Protos.UserCarts;
|
||||||
using CMSMicroservice.Protobuf.Protos.Commission;
|
using CMSMicroservice.Protobuf.Protos.Commission;
|
||||||
using CMSMicroservice.Protobuf.Protos.Configuration;
|
using CMSMicroservice.Protobuf.Protos.Configuration;
|
||||||
|
using CMSMicroservice.Protobuf.Protos.AppVersion;
|
||||||
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;
|
||||||
@@ -90,6 +91,9 @@ public class ApplicationContractContext : IApplicationContractContext
|
|||||||
|
|
||||||
// Geography System (GMS)
|
// Geography System (GMS)
|
||||||
public CityContract.CityContractClient Cities => GetService<CityContract.CityContractClient>();
|
public CityContract.CityContractClient Cities => GetService<CityContract.CityContractClient>();
|
||||||
|
|
||||||
|
// App Version System
|
||||||
|
public AppVersionContract.AppVersionContractClient AppVersion => GetService<AppVersionContract.AppVersionContractClient>();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region PYMS
|
#region PYMS
|
||||||
|
|||||||
@@ -18,10 +18,13 @@ public class CommissionProfile : IRegister
|
|||||||
.Map(dest => dest.Status, src => src.Status);
|
.Map(dest => dest.Status, src => src.Status);
|
||||||
|
|
||||||
config.NewConfig<ProtoDto.GetMyWeeklyBalancesRequest, GetMyWeeklyBalancesQuery>()
|
config.NewConfig<ProtoDto.GetMyWeeklyBalancesRequest, GetMyWeeklyBalancesQuery>()
|
||||||
.Map(dest => dest.PageNumber, src => src.PageNumber)
|
.MapWith(src => new GetMyWeeklyBalancesQuery
|
||||||
.Map(dest => dest.PageSize, src => src.PageSize)
|
{
|
||||||
.Map(dest => dest.WeekDefinitionId, src => src.WeekDefinitionId != null ? (long?)src.WeekDefinitionId.Value : null)
|
PageNumber = src.PageNumber,
|
||||||
.Map(dest => dest.OnlyActive, src => src.OnlyActive);
|
PageSize = src.PageSize,
|
||||||
|
WeekDefinitionId = src.WeekDefinitionId != null ? src.WeekDefinitionId.Value : null,
|
||||||
|
OnlyActive = src.OnlyActive
|
||||||
|
});
|
||||||
|
|
||||||
// Response mappings
|
// Response mappings
|
||||||
config.NewConfig<GetMyCommissionPayoutsResponseDto, ProtoDto.GetMyCommissionPayoutsResponse>()
|
config.NewConfig<GetMyCommissionPayoutsResponseDto, ProtoDto.GetMyCommissionPayoutsResponse>()
|
||||||
@@ -36,7 +39,6 @@ public class CommissionProfile : IRegister
|
|||||||
.Map(dest => dest.TotalAmount, src => src.TotalAmount)
|
.Map(dest => dest.TotalAmount, src => src.TotalAmount)
|
||||||
.Map(dest => dest.AmountFormatted, src => src.AmountFormatted)
|
.Map(dest => dest.AmountFormatted, src => src.AmountFormatted)
|
||||||
.Map(dest => dest.Status, src => src.Status)
|
.Map(dest => dest.Status, src => src.Status)
|
||||||
.Map(dest => dest.StatusBadgeColor, src => src.StatusBadgeColor)
|
|
||||||
.Map(dest => dest.CalculatedDate, src => Timestamp.FromDateTime(DateTime.SpecifyKind(src.CalculatedDate, DateTimeKind.Utc)))
|
.Map(dest => dest.CalculatedDate, src => Timestamp.FromDateTime(DateTime.SpecifyKind(src.CalculatedDate, DateTimeKind.Utc)))
|
||||||
.Map(dest => dest.DatePersian, src => src.DatePersian);
|
.Map(dest => dest.DatePersian, src => src.DatePersian);
|
||||||
|
|
||||||
@@ -53,6 +55,10 @@ public class CommissionProfile : IRegister
|
|||||||
.Map(dest => dest.WeekDisplayName, src => src.WeekLabel)
|
.Map(dest => dest.WeekDisplayName, src => src.WeekLabel)
|
||||||
.Map(dest => dest.LeftLegBalances, src => src.LeftLegBalances)
|
.Map(dest => dest.LeftLegBalances, src => src.LeftLegBalances)
|
||||||
.Map(dest => dest.RightLegBalances, src => src.RightLegBalances)
|
.Map(dest => dest.RightLegBalances, src => src.RightLegBalances)
|
||||||
|
.Map(dest => dest.LeftLegCarryover, src => src.LeftLegCarryover)
|
||||||
|
.Map(dest => dest.RightLegCarryover, src => src.RightLegCarryover)
|
||||||
|
.Map(dest => dest.LeftLegNewMembers, src => src.LeftLegNewMembers)
|
||||||
|
.Map(dest => dest.RightLegNewMembers, src => src.RightLegNewMembers)
|
||||||
.Map(dest => dest.TotalBalances, src => src.TotalBalances)
|
.Map(dest => dest.TotalBalances, src => src.TotalBalances)
|
||||||
.Map(dest => dest.WeeklyPoolContribution, src => src.WeeklyPoolContribution)
|
.Map(dest => dest.WeeklyPoolContribution, src => src.WeeklyPoolContribution)
|
||||||
.Map(dest => dest.IsExpired, src => src.IsExpired)
|
.Map(dest => dest.IsExpired, src => src.IsExpired)
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ public class NetworkMembershipProfile : IRegister
|
|||||||
.Map(dest => dest.LeftChild, src => src.LeftChild)
|
.Map(dest => dest.LeftChild, src => src.LeftChild)
|
||||||
.Map(dest => dest.RightChild, src => src.RightChild)
|
.Map(dest => dest.RightChild, src => src.RightChild)
|
||||||
.Map(dest => dest.Level, src => src.Level)
|
.Map(dest => dest.Level, src => src.Level)
|
||||||
|
.Map(dest => dest.ReferralCode, src => src.ReferralCode)
|
||||||
.Map(dest => dest.HasChildren, src => src.HasChildren)
|
.Map(dest => dest.HasChildren, src => src.HasChildren)
|
||||||
.Map(dest => dest.IsActive, src => src.IsActive)
|
.Map(dest => dest.IsActive, src => src.IsActive)
|
||||||
.Map(dest => dest.JoinedAt, src => src.JoinedAt.HasValue ? Timestamp.FromDateTime(DateTime.SpecifyKind(src.JoinedAt.Value, DateTimeKind.Utc)) : null)
|
.Map(dest => dest.JoinedAt, src => src.JoinedAt.HasValue ? Timestamp.FromDateTime(DateTime.SpecifyKind(src.JoinedAt.Value, DateTimeKind.Utc)) : null)
|
||||||
|
|||||||
@@ -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 ["FrontOffice.BFF.WebApi/NuGet.config", "NuGet.config"]
|
COPY ["FrontOffice.BFF.WebApi/NuGet.config", "NuGet.config"]
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
using FrontOffice.BFF.WebApi.Common.Services;
|
||||||
|
using FrontOffice.BFF.Application.ConfigurationCQ.Queries.GetAppVersion;
|
||||||
|
using FrontOffice.BFF.Configuration.Protobuf.Protos.AppVersion;
|
||||||
|
|
||||||
|
namespace FrontOffice.BFF.WebApi.Services;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// سرویس نسخه اپلیکیشن - برای بررسی نیاز به پاک کردن کش
|
||||||
|
/// </summary>
|
||||||
|
public class AppVersionGrpcService : AppVersionContract.AppVersionContractBase
|
||||||
|
{
|
||||||
|
private readonly IDispatchRequestToCQRS _dispatchRequestToCQRS;
|
||||||
|
|
||||||
|
public AppVersionGrpcService(IDispatchRequestToCQRS dispatchRequestToCQRS)
|
||||||
|
{
|
||||||
|
_dispatchRequestToCQRS = dispatchRequestToCQRS;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// دریافت نسخه اپلیکیشن
|
||||||
|
/// </summary>
|
||||||
|
public override async Task<GetAppVersionResponse> GetAppVersion(GetAppVersionRequest request, ServerCallContext context)
|
||||||
|
{
|
||||||
|
return await _dispatchRequestToCQRS.Handle<GetAppVersionRequest, GetAppVersionQuery, GetAppVersionResponse>(request, context);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,7 +30,7 @@ public class UserWalletService : UserWalletContract.UserWalletContractBase
|
|||||||
}
|
}
|
||||||
public override async Task<Empty> WithdrawBalance(WithdrawBalanceRequest request, ServerCallContext context)
|
public override async Task<Empty> WithdrawBalance(WithdrawBalanceRequest request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
return await _dispatchRequestToCQRS.Handle<WithdrawBalanceRequest, WithdrawBalanceCommand, Empty>(request, context);
|
return await _dispatchRequestToCQRS.Handle<WithdrawBalanceRequest, WithdrawBalanceCommand>(request, context);
|
||||||
}
|
}
|
||||||
public override async Task<GetUserWithdrawalsResponse> GetUserWithdrawals(GetUserWithdrawalsRequest request, ServerCallContext context)
|
public override async Task<GetUserWithdrawalsResponse> GetUserWithdrawals(GetUserWithdrawalsRequest request, ServerCallContext context)
|
||||||
{
|
{
|
||||||
|
|||||||
+9
-2
@@ -10,11 +10,18 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GrpcChannelOptions": {
|
"GrpcChannelOptions": {
|
||||||
"CMSMSAddress": "https://cms.kbs1.ir",
|
"CMSMSAddress": "http://cms-svc",
|
||||||
"PYMSMSAddress": "https://ipg.afrino.co"
|
"PYMSMSAddress": "https://ipg.afrino.co"
|
||||||
|
},
|
||||||
|
"CmsSignalR": {
|
||||||
|
"HubPath": "/hubs/token-notification"
|
||||||
},
|
},
|
||||||
"Authentication": {
|
"Authentication": {
|
||||||
"Authority": "https://ids.domain.com/",
|
"Authority": "https://ids.domain.com/",
|
||||||
"Audience": "domain_api"
|
"Audience": "domain_api"
|
||||||
|
},
|
||||||
|
"Seq": {
|
||||||
|
"ServerUrl": "http://seq-svc:5341",
|
||||||
|
"ApiKey": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"JwtSecurityKey": "TvlZVx5TJaHs8e9HgUdGzhGP2CIidoI444nAj+8+g7c=",
|
||||||
|
"JwtIssuer": "https://localhost",
|
||||||
|
"JwtAudience": "https://localhost",
|
||||||
|
"JwtExpiryInDays": 365,
|
||||||
|
"AllowedHosts": "*",
|
||||||
|
"Kestrel": {
|
||||||
|
"EndpointDefaults": {
|
||||||
|
"Protocols": "Http2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"GrpcChannelOptions": {
|
||||||
|
"CMSMSAddress": "http://cms-svc",
|
||||||
|
"PYMSMSAddress": "https://ipg.afrino.co"
|
||||||
|
},
|
||||||
|
"CmsSignalR": {
|
||||||
|
"HubPath": "/hubs/token-notification"
|
||||||
|
},
|
||||||
|
"Authentication": {
|
||||||
|
"Authority": "https://ids.domain.com/",
|
||||||
|
"Audience": "domain_api"
|
||||||
|
},
|
||||||
|
"Seq": {
|
||||||
|
"ServerUrl": "http://seq-svc:5341",
|
||||||
|
"ApiKey": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GrpcChannelOptions": {
|
"GrpcChannelOptions": {
|
||||||
"CMSMSAddress": "http://cms-svc",
|
"CMSMSAddress": "https://cms.foursat.afrino.co",
|
||||||
"PYMSMSAddress": "https://ipg.afrino.co"
|
"PYMSMSAddress": "https://ipg.afrino.co"
|
||||||
},
|
},
|
||||||
"CmsSignalR": {
|
"CmsSignalR": {
|
||||||
"HubPath": "/hubs/token-notification"
|
"HubPath": "/hubs/token-notification"
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Version>0.0.3</Version>
|
<Version>0.0.6</Version>
|
||||||
<PackageId>Foursat.FrontOffice.BFF.Commission.Protobuf</PackageId>
|
<PackageId>Foursat.FrontOffice.BFF.Commission.Protobuf</PackageId>
|
||||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||||
<DebugSymbols>False</DebugSymbols>
|
<DebugSymbols>False</DebugSymbols>
|
||||||
|
|||||||
@@ -63,10 +63,9 @@ message CommissionPayoutModel
|
|||||||
int32 balances_earned = 4;
|
int32 balances_earned = 4;
|
||||||
int64 total_amount = 5;
|
int64 total_amount = 5;
|
||||||
string amount_formatted = 6;
|
string amount_formatted = 6;
|
||||||
string status = 7;
|
int32 status = 7; // 0=Pending, 1=Paid, 2=WithdrawRequested, 3=Withdrawn, 4=PaymentFailed, 5=Cancelled
|
||||||
string status_badge_color = 8;
|
google.protobuf.Timestamp calculated_date = 8;
|
||||||
google.protobuf.Timestamp calculated_date = 9;
|
string date_persian = 9;
|
||||||
string date_persian = 10;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============ GetMyWeeklyBalances ============
|
// ============ GetMyWeeklyBalances ============
|
||||||
@@ -92,13 +91,17 @@ message WeeklyBalanceModel
|
|||||||
int64 id = 1;
|
int64 id = 1;
|
||||||
int64 week_definition_id = 2;
|
int64 week_definition_id = 2;
|
||||||
string week_display_name = 3;
|
string week_display_name = 3;
|
||||||
int32 left_leg_balances = 4;
|
int32 left_leg_balances = 4; // مجموع پای چپ (NewMembers + Carryover)
|
||||||
int32 right_leg_balances = 5;
|
int32 right_leg_balances = 5; // مجموع پای راست (NewMembers + Carryover)
|
||||||
int32 total_balances = 6;
|
int32 total_balances = 6; // تعداد تعادل = MIN(چپ, راست)
|
||||||
int64 weekly_pool_contribution = 7;
|
int64 weekly_pool_contribution = 7;
|
||||||
bool is_expired = 8;
|
bool is_expired = 8;
|
||||||
google.protobuf.Timestamp calculated_at = 9;
|
google.protobuf.Timestamp calculated_at = 9;
|
||||||
string date_persian = 10;
|
string date_persian = 10;
|
||||||
|
int32 left_leg_carryover = 11; // انتقالی پای چپ از هفته قبل
|
||||||
|
int32 right_leg_carryover = 12; // انتقالی پای راست از هفته قبل
|
||||||
|
int32 left_leg_new_members = 13; // اعضای جدید پای چپ این هفته
|
||||||
|
int32 right_leg_new_members = 14; // اعضای جدید پای راست این هفته
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============ GetWeekDefinitions ============
|
// ============ GetWeekDefinitions ============
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net9.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<Version>0.0.4</Version>
|
<Version>0.0.5</Version>
|
||||||
<PackageId>Foursat.FrontOffice.BFF.NetworkMembership.Protobuf</PackageId>
|
<PackageId>Foursat.FrontOffice.BFF.NetworkMembership.Protobuf</PackageId>
|
||||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||||
<DebugSymbols>False</DebugSymbols>
|
<DebugSymbols>False</DebugSymbols>
|
||||||
|
|||||||
+1
@@ -76,6 +76,7 @@ message NetworkNodeModel
|
|||||||
google.protobuf.Timestamp joined_at = 11;
|
google.protobuf.Timestamp joined_at = 11;
|
||||||
bool is_club_active = 12;
|
bool is_club_active = 12;
|
||||||
google.protobuf.Int64Value activation_week_definition_id = 13;
|
google.protobuf.Int64Value activation_week_definition_id = 13;
|
||||||
|
google.protobuf.StringValue referral_code = 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============ GetMyNetworkStatistics ============
|
// ============ GetMyNetworkStatistics ============
|
||||||
|
|||||||
Reference in New Issue
Block a user