CreateDocumentLink for new transactions
This commit is contained in:
parent
04c0b7fc0e
commit
374fdd231b
@ -1,7 +1,6 @@
|
|||||||
using EnotaryoPH.Data;
|
using EnotaryoPH.Data;
|
||||||
using EnotaryoPH.Data.Constants;
|
using EnotaryoPH.Data.Entities;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
|
|
||||||
namespace EnotaryoPH.Web.Pages.Principal.Dashboard
|
namespace EnotaryoPH.Web.Pages.Principal.Dashboard
|
||||||
{
|
{
|
||||||
@ -20,8 +19,9 @@ namespace EnotaryoPH.Web.Pages.Principal.Dashboard
|
|||||||
{
|
{
|
||||||
var user = _notaryoDBContext.Users.FirstOrDefault(u => u.User_UID == _currentUserService.GetUser_UID());
|
var user = _notaryoDBContext.Users.FirstOrDefault(u => u.User_UID == _currentUserService.GetUser_UID());
|
||||||
|
|
||||||
_notaryoDBContext.Transactions.Include(t => t.TransactionDocument);
|
var userTransactions = _notaryoDBContext.Transactions
|
||||||
var userTransactions = _notaryoDBContext.Transactions.Where(e => e.PrincipalID == user.UserID).ToList();
|
.Include(t => t.TransactionDocument)
|
||||||
|
.Where(e => e.PrincipalID == user.UserID).ToList();
|
||||||
CompletedDocuments = userTransactions
|
CompletedDocuments = userTransactions
|
||||||
.Where(ut => ut.Status == nameof(TransactionStatus.Completed))
|
.Where(ut => ut.Status == nameof(TransactionStatus.Completed))
|
||||||
.Select(ut => new DashboardItem
|
.Select(ut => new DashboardItem
|
||||||
@ -39,7 +39,7 @@ namespace EnotaryoPH.Web.Pages.Principal.Dashboard
|
|||||||
Date = ut.TransactionDate,
|
Date = ut.TransactionDate,
|
||||||
Status = ut.Status,
|
Status = ut.Status,
|
||||||
Type = ut.TransactionDocument?.DocumentType ?? "UNKNOWN",
|
Type = ut.TransactionDocument?.DocumentType ?? "UNKNOWN",
|
||||||
Link = "#"
|
Link = CreateDocumentLink(ut)
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
IdentificationDocuments = _notaryoDBContext.IdentificationDocuments
|
IdentificationDocuments = _notaryoDBContext.IdentificationDocuments
|
||||||
@ -53,6 +53,12 @@ namespace EnotaryoPH.Web.Pages.Principal.Dashboard
|
|||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string CreateDocumentLink(Transaction tx) => tx.Status switch
|
||||||
|
{
|
||||||
|
nameof(TransactionStatus.New) => $"/Principal/NotaryoSteps/UploadDocument/{tx.Transaction_UID}",
|
||||||
|
_ => "#"
|
||||||
|
};
|
||||||
|
|
||||||
public List<DashboardItem> CompletedDocuments { get; set; }
|
public List<DashboardItem> CompletedDocuments { get; set; }
|
||||||
public List<DashboardItem> IdentificationDocuments { get; set; }
|
public List<DashboardItem> IdentificationDocuments { get; set; }
|
||||||
public List<DashboardItem> IncompleteDocuments { get; set; }
|
public List<DashboardItem> IncompleteDocuments { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user