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,
|
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>
|
||||||
/// تاریخ محاسبه
|
/// تاریخ محاسبه
|
||||||
|
|||||||
@@ -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,
|
||||||
|
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);
|
||||||
|
|
||||||
|
|||||||
@@ -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.4</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 ============
|
||||||
|
|||||||
Reference in New Issue
Block a user