diff --git a/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/TransactionStatus/Index.cshtml b/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/TransactionStatus/Index.cshtml new file mode 100644 index 0000000..e761f4b --- /dev/null +++ b/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/TransactionStatus/Index.cshtml @@ -0,0 +1,51 @@ +@page "{Transaction_UID}" +@model EnotaryoPH.Web.Pages.Principal.TransactionStatus.IndexModel +@{ +} + +@section Head { + +} + +
+
+
+
+

@Model.Title

+ +
+
+

Started on @Model.StartedOn.ToShortDateString() @Model.StartedOn.ToShortTimeString().

+

@Model.StatusDescription

+ @if (Model.Signatories.Count > 0) { +
+ + + + + + + + + + @foreach(var row in Model.Signatories) + { + + + + + + } + +
EmailTypeStatus
@row.Email@row.Type@row.Status
+
+ } + +
+
+ + +
+
+
+
\ No newline at end of file diff --git a/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/TransactionStatus/Index.cshtml.cs b/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/TransactionStatus/Index.cshtml.cs new file mode 100644 index 0000000..a8b1b24 --- /dev/null +++ b/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/TransactionStatus/Index.cshtml.cs @@ -0,0 +1,56 @@ +using EnotaryoPH.Data; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace EnotaryoPH.Web.Pages.Principal.TransactionStatus +{ + public class IndexModel : PageModel + { + private readonly NotaryoDBContext _notaryoDBContext; + private readonly ICurrentUserService _currentUserService; + + public IndexModel(NotaryoDBContext notaryoDBContext, ICurrentUserService currentUserService) + { + _notaryoDBContext = notaryoDBContext; + _currentUserService = currentUserService; + } + + public IActionResult OnGet() + { + var user = _notaryoDBContext.Users.First(e => e.User_UID == _currentUserService.GetUser_UID()); + var transaction = _notaryoDBContext + .Transactions + .AsNoTracking() + .Include(e => e.TransactionSignatories) + .Include(e => e.TransactionDocument) + .FirstOrDefault(e => e.Transaction_UID == Transaction_UID && e.PrincipalID == user.UserID); + + if (transaction == null) + { + return NotFound(); + } + + Title = transaction.TransactionDocument.DocumentType; + StartedOn = transaction.CreatedOn.GetValueOrDefault(); + StatusDescription = "Not all signatories have signed up to enotaryo and completed the onboarding process. This transaction cannot proceed until this has been resolved."; + + Signatories = transaction.TransactionSignatories.ConvertAll(s => new SignatoryViewModel + { + Email = s.Email, + Type = s.Type, + Status = s.Status + }); + + return Page(); + } + + [BindProperty(SupportsGet = true)] + public Guid Transaction_UID { get; set; } + + public List Signatories { get; set; } = []; + + public string Title { get; set; } + public DateTime StartedOn { get; set; } + public string StatusDescription { get; set; } + } +} \ No newline at end of file diff --git a/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/TransactionStatus/SignatoryViewModel.cs b/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/TransactionStatus/SignatoryViewModel.cs new file mode 100644 index 0000000..7cf6425 --- /dev/null +++ b/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/TransactionStatus/SignatoryViewModel.cs @@ -0,0 +1,9 @@ +namespace EnotaryoPH.Web.Pages.Principal.TransactionStatus +{ + public class SignatoryViewModel + { + public string Email { get; set; } + public string Status { get; set; } + public string Type { get; set; } + } +} \ No newline at end of file