Skip to content

Commit

Permalink
Merge the latest changes from developer (#713)
Browse files Browse the repository at this point in the history
* Solved an InvalidCastException when using the TenantStaticFileProvider

* Trying to solve the issue #711 by adding existing references of the user and the payment.

* Fixed issue #688 where the sorting by date is not correct in the datatable.

* Added the viewport option trying to fix the tests.

* Set the ExpirationTime to a maximum of 15 years. #675
  • Loading branch information
guerrerotook authored Nov 30, 2022
1 parent d5c5e8d commit c8151d9
Show file tree
Hide file tree
Showing 172 changed files with 20,781 additions and 24,631 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,10 @@ public bool EmailNotificationExits(int paymentId)
/// <summary>
/// Adds the payment notification to the database.
/// </summary>
/// <param name="userId">User id.</param>
/// <param name="paymentId">PaymentId.</param>
public void AddEmailNotification(string userId, int paymentId)
/// <param name="user">User.</param>
/// <param name="payment">Payment.</param>
public void AddEmailNotification(WebUser user, BasePayment payment)
{
WebUser? user = this.userRepository.FindUserById(userId);
BasePayment? payment = this.DbContext.Payments.Where(p => p.Id == paymentId).FirstOrDefault();

if (user != null && payment != null)
{
this.DbContext.PaymentNotifications.Add(new PaymentNotifications()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public override BrowserNewContextOptions ContextOptions()

options.Locale = "en-US";
options.RecordVideoDir = "videos/";
options.ScreenSize = new ScreenSize() { Width = 1980, Height = 1080 };
options.ViewportSize = new ViewportSize() { Width = 1980, Height = 1080 };
return options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected async Task SendInvoiceEmail(int donationId, string transactionKey, int
{ "PublicId", donation.PublicId.ToString() },
{ "ConfirmedPayment.Status", donation.ConfirmedPayment.Status },
});
this.context.PaymentNotificationRepository.AddEmailNotification(donation.User.Id, donation.ConfirmedPayment.Id);
this.context.PaymentNotificationRepository.AddEmailNotification(donation.User, donation.ConfirmedPayment);
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ public IActionResult Get(int multibankId, string key)
configuration))
{
context.PaymentNotificationRepository.AddEmailNotification(
user.Id,
multibanco.Id);
user,
multibanco);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
columns: [
{ "data": "Id" },
{ "data": "DonationDate", render: function ( data, type, row ) {
return moment(new Date(data)).format("DD/MM/YYYY HH:mm");
return moment(new Date(data)).format("DD/MM/YYYY");
}},
{ "data": "FoodBank" },
{ "data": "DonationAmount", render: $.fn.dataTable.render.number(',', '.', 2, '', '') },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
columns: [
{ "data": "Id" },
{ "data": "Created", render: function ( data, type, row ) {
return moment(new Date(data)).format("DD/MM/YYYY HH:mm");
return moment(new Date(data)).format("DD/MM/YYYY");
}},
{ "data": "ExpirationTime", render: function ( data, type, row ) {
return moment(new Date(data)).format("DD/MM/YYYY HH:mm");
return moment(new Date(data)).format("DD/MM/YYYY");
}},
{ "data": "StartTime", render: function ( data, type, row ) {
return moment(new Date(data)).format("DD/MM/YYYY HH:mm");
return moment(new Date(data)).format("DD/MM/YYYY");
}},
{ "data": "SubscriptionType" },
{ "data": "Status",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private DateTime ConvertFrequencyToDateTime(PaymentSubscription.FrequencyEnum fr
new SinglePaymentRequestCapture("Alimente esta ideia Donation subscription", transactionKey)))
{
Key = transactionKey,
ExpirationTime = DateTime.UtcNow.AddYears(5).GetEasyPayDateTimeString(),
ExpirationTime = DateTime.UtcNow.AddYears(value: 15).GetEasyPayDateTimeString(),
Currency = PaymentSubscription.CurrencyEnum.EUR,
Customer = new Customer()
{
Expand Down
6 changes: 3 additions & 3 deletions BancoAlimentar.AlimentaEstaIdeia.Web/libman.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "[email protected].0",
"library": "[email protected].2",
"destination": "wwwroot/lib/bootstrap/"
},
{
"library": "[email protected].0",
"library": "[email protected].1",
"destination": "wwwroot/lib/jquery/"
},
{
"library": "[email protected].3",
"library": "[email protected].5",
"destination": "wwwroot/lib/jquery-validation/"
},
{
Expand Down
Loading

0 comments on commit c8151d9

Please sign in to comment.