Compare commits
6 Commits
b71d948e0e
...
99c0da4ecc
| Author | SHA1 | Date | |
|---|---|---|---|
| 99c0da4ecc | |||
| 0bab1d857e | |||
| 84c519060f | |||
| a429a2328a | |||
| c53056c750 | |||
| dadd0ee66c |
+1
-26
@@ -44,8 +44,7 @@ public class GetMyCommissionPayoutsQueryHandler : IRequestHandler<GetMyCommissio
|
||||
BalancesEarned = (int)p.BalancesEarned,
|
||||
TotalAmount = p.TotalAmount,
|
||||
AmountFormatted = FormatCurrency(p.TotalAmount),
|
||||
Status = MapStatus(p.Status),
|
||||
StatusBadgeColor = GetStatusColor(p.Status),
|
||||
Status = p.Status,
|
||||
CalculatedDate = p.Created?.ToDateTime() ?? DateTime.UtcNow,
|
||||
DatePersian = FormatPersianDate(p.Created?.ToDateTime())
|
||||
}).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)
|
||||
{
|
||||
return $"{amount:N0} تومان";
|
||||
|
||||
+2
-7
@@ -41,14 +41,9 @@ public class CommissionPayoutDto
|
||||
public string AmountFormatted { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// وضعیت (Pending/Calculated/Paid/Withdrawn)
|
||||
/// وضعیت (0=Pending=1,Paid=2,WithdrawRequested=3,Withdrawn=4,PaymentFailed= 5,Cancelled)
|
||||
/// </summary>
|
||||
public string Status { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// رنگ Badge
|
||||
/// </summary>
|
||||
public string StatusBadgeColor { get; set; } = string.Empty;
|
||||
public int Status { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// تاریخ محاسبه
|
||||
|
||||
@@ -18,10 +18,13 @@ public class CommissionProfile : IRegister
|
||||
.Map(dest => dest.Status, src => src.Status);
|
||||
|
||||
config.NewConfig<ProtoDto.GetMyWeeklyBalancesRequest, GetMyWeeklyBalancesQuery>()
|
||||
.Map(dest => dest.PageNumber, src => src.PageNumber)
|
||||
.Map(dest => dest.PageSize, src => src.PageSize)
|
||||
.Map(dest => dest.WeekDefinitionId, src => src.WeekDefinitionId != null ? (long?)src.WeekDefinitionId.Value : null)
|
||||
.Map(dest => dest.OnlyActive, src => src.OnlyActive);
|
||||
.MapWith(src => new GetMyWeeklyBalancesQuery
|
||||
{
|
||||
PageNumber = src.PageNumber,
|
||||
PageSize = src.PageSize,
|
||||
WeekDefinitionId = src.WeekDefinitionId,
|
||||
OnlyActive = src.OnlyActive
|
||||
});
|
||||
|
||||
// Response mappings
|
||||
config.NewConfig<GetMyCommissionPayoutsResponseDto, ProtoDto.GetMyCommissionPayoutsResponse>()
|
||||
@@ -36,7 +39,6 @@ public class CommissionProfile : IRegister
|
||||
.Map(dest => dest.TotalAmount, src => src.TotalAmount)
|
||||
.Map(dest => dest.AmountFormatted, src => src.AmountFormatted)
|
||||
.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.DatePersian, src => src.DatePersian);
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class UserWalletService : UserWalletContract.UserWalletContractBase
|
||||
}
|
||||
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)
|
||||
{
|
||||
|
||||
+8
-1
@@ -10,11 +10,18 @@
|
||||
}
|
||||
},
|
||||
"GrpcChannelOptions": {
|
||||
"CMSMSAddress": "https://cms.kbs1.ir",
|
||||
"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": ""
|
||||
}
|
||||
}
|
||||
@@ -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,7 +10,7 @@
|
||||
}
|
||||
},
|
||||
"GrpcChannelOptions": {
|
||||
"CMSMSAddress": "http://cms-svc",
|
||||
"CMSMSAddress": "https://cms.foursat.afrino.co",
|
||||
"PYMSMSAddress": "https://ipg.afrino.co"
|
||||
},
|
||||
"CmsSignalR": {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>0.0.3</Version>
|
||||
<Version>0.0.4</Version>
|
||||
<PackageId>Foursat.FrontOffice.BFF.Commission.Protobuf</PackageId>
|
||||
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
|
||||
@@ -63,10 +63,9 @@ message CommissionPayoutModel
|
||||
int32 balances_earned = 4;
|
||||
int64 total_amount = 5;
|
||||
string amount_formatted = 6;
|
||||
string status = 7;
|
||||
string status_badge_color = 8;
|
||||
google.protobuf.Timestamp calculated_date = 9;
|
||||
string date_persian = 10;
|
||||
int32 status = 7; // 0=Pending, 1=Paid, 2=WithdrawRequested, 3=Withdrawn, 4=PaymentFailed, 5=Cancelled
|
||||
google.protobuf.Timestamp calculated_date = 8;
|
||||
string date_persian = 9;
|
||||
}
|
||||
|
||||
// ============ GetMyWeeklyBalances ============
|
||||
|
||||
Reference in New Issue
Block a user