Skip to content

Commit

Permalink
Merging hotfix 0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm360 committed Jan 25, 2022
2 parents 9ab5453 + b0600ae commit c53f6bf
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/EthernaCredit.Services/EthernaCredit.Services.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
Expand All @@ -19,8 +19,8 @@

<ItemGroup>
<PackageReference Include="Etherna.DomainEvents.AspNetCore" Version="1.3.0" />
<PackageReference Include="EthernaACR" Version="0.3.0" />
<PackageReference Include="EthernaServicesClient.AspNetCore" Version="0.3.0-alpha.28" />
<PackageReference Include="EthernaSSL" Version="0.1.0-alpha.18" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Etherna" Version="0.3.0-alpha.7" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Etherna.ACR.Services;
using Etherna.CreditSystem.Domain;
using Etherna.CreditSystem.Domain.Events;
using Etherna.CreditSystem.Services.Domain;
using Etherna.CreditSystem.Services.Views.Emails;
using Etherna.DomainEvents;
using Etherna.ServicesClient.Clients.Sso;
using Etherna.SSL.Services;
using System.Threading.Tasks;

namespace Etherna.CreditSystem.Services.EventHandlers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Etherna.ACR.Services;
using Etherna.CreditSystem.Domain;
using Etherna.CreditSystem.Domain.Events;
using Etherna.CreditSystem.Services.Views.Emails;
using Etherna.DomainEvents;
using Etherna.ServicesClient.Clients.Sso;
using Etherna.SSL.Services;
using System.Threading.Tasks;

namespace Etherna.CreditSystem.Services.EventHandlers
Expand Down
2 changes: 1 addition & 1 deletion src/EthernaCredit.Services/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Etherna.ACR;
using Etherna.CreditSystem.Services.Domain;
using Etherna.DomainEvents;
using Etherna.DomainEvents.AspNetCore;
using Etherna.SSL;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Linq;
Expand Down
6 changes: 5 additions & 1 deletion src/EthernaCredit/Areas/Admin/Pages/Users/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,11 @@
</td>
<td class="align-middle">@user.Id</td>
<td class="align-middle">@user.EtherAddress</td>
<td class="align-middle">@user.Balance</td>
<td class="align-middle">
@user.Balance.ToFinancialString(
allowedDecimals: 4,
suffixSymbol: " CHF",
usePlusSign: true)</td>
<td class="align-middle">@user.HasUnlimitedCredit</td>
</tr>
}
Expand Down
5 changes: 3 additions & 2 deletions src/EthernaCredit/Areas/Admin/Pages/_ViewImports.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
* limitations under the License.
*@

@using Etherna.ACR
@using Etherna.ACR.Pages.SharedModels
@using Etherna.CreditSystem.Areas.Admin
@using Etherna.CreditSystem.Areas.Admin.Pages
@using Etherna.CreditSystem.Configs
@using Etherna.CreditSystem.Domain.Models
@using Etherna.SSL
@using Etherna.SSL.Pages.SharedModels
@using Etherna.CreditSystem.Extensions
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 changes: 2 additions & 2 deletions src/EthernaCredit/Areas/Deposit/Pages/DepositProcess.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
<div class="col-md-6">
@if (Model.SucceededResult)
{
<p>An amount of @Model.DepositAmount.ToFinancialString(prefixSymbol: "$") has been deposited to your account</p>
<p>An amount of @Model.DepositAmount.ToFinancialString(suffixSymbol: " CHF") has been deposited to your account</p>
}
else
{
<p>Sorry, we was not able to deposit an amount of @Model.DepositAmount.ToFinancialString(prefixSymbol: "$") to your account</p>
<p>Sorry, we was not able to deposit an amount of @Model.DepositAmount.ToFinancialString(suffixSymbol: " CHF") to your account</p>
}
<p><a asp-area="Manage" asp-page="index">Return to account</a></p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/EthernaCredit/Areas/Manage/Pages/Deposit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
<form id="deposit" asp-area="Deposit" asp-page="DepositProcess" method="post" class="form-horizontal">
<div>
<p>
@foreach (var amount in new[] { 0.1m, 0.5m, 1m, 5m, 10m })
@foreach (var amount in new[] { 0.5m, 1m, 5m, 10m })
{
<button type="submit"
name="amount"
class="btn btn-primary"
value="@amount">@amount.ToFinancialString(prefixSymbol: "$")</button>
value="@amount">@amount.ToFinancialString(suffixSymbol: " CHF")</button>
}
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/EthernaCredit/Areas/Manage/Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</div>
<div class="mb-3">
<label asp-for="CreditBalance"></label>
<p>@Model.CreditBalance.ToFinancialString(prefixSymbol: "$")</p>
<p>@Model.CreditBalance.ToFinancialString(suffixSymbol: " CHF")</p>
</div>
@if (Model.HasUnlimitedCredit)
{
Expand Down
4 changes: 2 additions & 2 deletions src/EthernaCredit/Areas/Manage/Pages/Logs.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
ViewData["Title"] = "Operation logs";
ViewData["ActivePage"] = ManageNavPages.Logs;

var pageSelectorModel = new PageSelectorModel(Model.CurrentPage, Model.MaxPage);
var pageSelectorModel = new PageSelectorModel(Model.CurrentPage, Model.MaxPage, 1);
}

<h4>@ViewData["Title"]</h4>
Expand All @@ -42,7 +42,7 @@
}
<span>@log.Amount.ToFinancialString(
allowedDecimals: null,
prefixSymbol: "$",
suffixSymbol: " CHF",
usePlusSign: true)</span>
</p>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/EthernaCredit/Areas/Manage/Pages/Logs.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public LogsModel(
public IEnumerable<OperationLogBase> Logs { get; private set; } = Array.Empty<OperationLogBase>();

// Methods.
public async Task OnGetAsync(int p)
public async Task OnGetAsync(int p = 1)
{
// Get user.
var (user, _) = await userService.FindUserAsync(User.GetEtherAddress());
Expand All @@ -57,11 +57,11 @@ public async Task OnGetAsync(int p)
var paginatedLogs = await dbContext.OperationLogs.QueryPaginatedElementsAsync(
elements => elements.Where(l => l.User.Id == user.Id),
l => l.CreationDateTime,
p, DefaultTakeElements,
p - 1, DefaultTakeElements,
true);

CurrentPage = paginatedLogs.CurrentPage;
MaxPage = paginatedLogs.MaxPage;
CurrentPage = paginatedLogs.CurrentPage + 1;
MaxPage = paginatedLogs.MaxPage + 1;
Logs = paginatedLogs.Elements;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/EthernaCredit/Areas/Manage/Pages/Withdraw.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
@if (Model.CanWithdraw)
{
<p>How much do you want to withdraw from your account? (
min: @Model.MinLimit.ToFinancialString(roundMode: MidpointRounding.ToZero, prefixSymbol: "$"),
max: @Model.MaxLimit.ToFinancialString(roundMode: MidpointRounding.ToZero, prefixSymbol: "$"))</p>
min: @Model.MinLimit.ToFinancialString(roundMode: MidpointRounding.ToZero, suffixSymbol: " CHF"),
max: @Model.MaxLimit.ToFinancialString(roundMode: MidpointRounding.ToZero, suffixSymbol: " CHF"))</p>

<form id="withdraw" method="post">
<div class="mb-3">
Expand Down
2 changes: 1 addition & 1 deletion src/EthernaCredit/Areas/Manage/Pages/_ViewImports.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* limitations under the License.
*@

@using Etherna.ACR.Pages.SharedModels
@using Etherna.CreditSystem.Domain.Models
@using Etherna.CreditSystem.Domain.Models.OperationLogs
@using Etherna.CreditSystem.Extensions
@using Etherna.SSL.Pages.SharedModels
@namespace Etherna.CreditSystem.Areas.Manage.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
4 changes: 2 additions & 2 deletions src/EthernaCredit/Areas/Withdraw/Pages/WithdrawProcess.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
<div class="col-md-6">
@if (Model.SucceededResult)
{
<p>An amount of @Model.WithdrawAmount.ToFinancialString(prefixSymbol: "$") has been withdrawn from your account</p>
<p>An amount of @Model.WithdrawAmount.ToFinancialString(suffixSymbol: " CHF") has been withdrawn from your account</p>
}
else
{
<p>Sorry, we was not able to withdraw an amount of @Model.WithdrawAmount.ToFinancialString(prefixSymbol: "$") from your account</p>
<p>Sorry, we was not able to withdraw an amount of @Model.WithdrawAmount.ToFinancialString(suffixSymbol: " CHF") from your account</p>
}
<p><a asp-area="Manage" asp-page="index">Return to account</a></p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/EthernaCredit/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Etherna.SSL.Exceptions;
using Etherna.SSL.Filters;
using Etherna.ACR.Exceptions;
using Etherna.ACR.Filters;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
Expand Down
4 changes: 2 additions & 2 deletions src/EthernaCredit/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using Etherna.ACR.Exceptions;
using Etherna.ACR.Settings;
using Etherna.CreditSystem.Configs;
using Etherna.CreditSystem.Configs.Authorization;
using Etherna.CreditSystem.Configs.Hangfire;
Expand All @@ -26,8 +28,6 @@
using Etherna.MongODM;
using Etherna.MongODM.AspNetCore.UI;
using Etherna.MongODM.Core.Options;
using Etherna.SSL.Exceptions;
using Etherna.SSL.Settings;
using Hangfire;
using Hangfire.Mongo;
using Hangfire.Mongo.Migration.Strategies;
Expand Down

0 comments on commit c53f6bf

Please sign in to comment.