diff --git a/EnotaryoPH/EnotaryoPH.Web/Common/Models/IdentificationDocumentModelMapper.cs b/EnotaryoPH/EnotaryoPH.Web/Common/Models/IdentificationDocumentModelMapper.cs
index 749fc5b..015f590 100644
--- a/EnotaryoPH/EnotaryoPH.Web/Common/Models/IdentificationDocumentModelMapper.cs
+++ b/EnotaryoPH/EnotaryoPH.Web/Common/Models/IdentificationDocumentModelMapper.cs
@@ -6,12 +6,13 @@ namespace EnotaryoPH.Web.Common.Models
{
internal static IdentificationDocument ToEntity(this IdentificationDocumentModel model, int userID)
{
+ var now = DateTime.UtcNow;
var entity = new IdentificationDocument
{
- UploadedOn = DateTime.UtcNow,
+ UploadedOn = now,
UserID = userID,
- IdentificationDocument_UID = Guid.NewGuid(),
- CreatedOn = DateTime.UtcNow
+ IdentificationDocument_UID = Guid.CreateVersion7(now),
+ CreatedOn = now
};
return model.ToEntity(entity);
diff --git a/EnotaryoPH/EnotaryoPH.Web/EnotaryoPH.Web.csproj b/EnotaryoPH/EnotaryoPH.Web/EnotaryoPH.Web.csproj
index ce9e5ae..f8e25ef 100644
--- a/EnotaryoPH/EnotaryoPH.Web/EnotaryoPH.Web.csproj
+++ b/EnotaryoPH/EnotaryoPH.Web/EnotaryoPH.Web.csproj
@@ -9,7 +9,10 @@
+
+
+
diff --git a/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/IdentificationDocument/IdentificationDocument.cshtml.cs b/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/IdentificationDocument/IdentificationDocument.cshtml.cs
index 15fe248..abab491 100644
--- a/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/IdentificationDocument/IdentificationDocument.cshtml.cs
+++ b/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/IdentificationDocument/IdentificationDocument.cshtml.cs
@@ -4,7 +4,6 @@ using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
-using Microsoft.EntityFrameworkCore;
using NsEntities = EnotaryoPH.Data.Entities;
namespace EnotaryoPH.Web.Pages.Principal.IdentificationDocument
@@ -84,7 +83,7 @@ namespace EnotaryoPH.Web.Pages.Principal.IdentificationDocument
{
entity.UserID = user.UserID;
entity.CreatedOn = DateTime.UtcNow;
- entity.IdentificationDocument_UID = Guid.NewGuid();
+ entity.IdentificationDocument_UID = Guid.CreateVersion7(DateTime.UtcNow);
_notaryoDBContext.Add(entity);
}
_notaryoDBContext.SaveChanges();
diff --git a/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/NotaryoSteps/TakeSelfie.cshtml.cs b/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/NotaryoSteps/TakeSelfie.cshtml.cs
index 45b824c..368cdbc 100644
--- a/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/NotaryoSteps/TakeSelfie.cshtml.cs
+++ b/EnotaryoPH/EnotaryoPH.Web/Pages/Principal/NotaryoSteps/TakeSelfie.cshtml.cs
@@ -1,6 +1,5 @@
using System.ComponentModel.DataAnnotations;
using EnotaryoPH.Data;
-using EnotaryoPH.Data.Constants;
using EnotaryoPH.Data.Entities;
using Exadel.Compreface.Clients.CompreFaceClient;
using Exadel.Compreface.DTOs.FaceVerificationDTOs.FaceVerification;
@@ -45,7 +44,7 @@ namespace EnotaryoPH.Web.Pages.Principal.NotaryoSteps
selfieEntity = new TransactionSelfie
{
CreatedOn = DateTime.UtcNow,
- TransactionSelfie_UID = Guid.NewGuid(),
+ TransactionSelfie_UID = Guid.CreateVersion7(DateTime.UtcNow),
UserID = user.UserID
};
TransactionSelfie_UID = selfieEntity.TransactionSelfie_UID.Value;
@@ -101,13 +100,13 @@ namespace EnotaryoPH.Web.Pages.Principal.NotaryoSteps
CreatedOn = DateTime.UtcNow,
PrincipalID = user.UserID,
Status = nameof(TransactionStatus.New),
- Transaction_UID = Guid.NewGuid()
+ Transaction_UID = Guid.CreateVersion7(DateTime.UtcNow)
};
_notaryoDBContext.Transactions.Add(newTransaction);
selfieEntity.Transaction = newTransaction;
_notaryoDBContext.SaveChanges();
- return RedirectToPage($"/Principal/NotaryoSteps/UploadDocument/{newTransaction.Transaction_UID}");
+ return Redirect($"/Principal/NotaryoSteps/UploadDocument/{newTransaction.Transaction_UID}");
}
ModelState.AddModelError("", "Face Verification Failed");
}
diff --git a/EnotaryoPH/EnotaryoPH.Web/Pages/Register.cshtml.cs b/EnotaryoPH/EnotaryoPH.Web/Pages/Register.cshtml.cs
index 71ae9b2..fd95741 100644
--- a/EnotaryoPH/EnotaryoPH.Web/Pages/Register.cshtml.cs
+++ b/EnotaryoPH/EnotaryoPH.Web/Pages/Register.cshtml.cs
@@ -3,7 +3,6 @@ using EnotaryoPH.Data;
using EnotaryoPH.Data.Entities;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
-using Microsoft.EntityFrameworkCore;
namespace EnotaryoPH.Web.Pages
{
@@ -68,7 +67,7 @@ namespace EnotaryoPH.Web.Pages
Rollnumber = RollNumber,
Status = "New",
CreatedOn = DateTime.UtcNow,
- Lawyer_UID = Guid.NewGuid()
+ Lawyer_UID = Guid.CreateVersion7(DateTime.UtcNow)
};
_notaryoDBContext.Lawyers.Add(newLawyer);
}