Refactor repository and SQL procedures; add repo tests

This commit is contained in:
Aaron Po
2026-01-25 23:26:40 -05:00
parent a56ea77861
commit 68ff549635
28 changed files with 573 additions and 430 deletions

View File

@@ -1,6 +1,5 @@
CREATE OR ALTER PROCEDURE dbo.USP_CreateUserVerification
@UserAccountID uniqueidentifier,
@VerificationDateTime datetime = NULL
CREATE OR ALTER PROCEDURE dbo.USP_CreateUserVerification @UserAccountID_ UNIQUEIDENTIFIER,
@VerificationDateTime DATETIME = NULL
AS
BEGIN
SET NOCOUNT ON;
@@ -11,10 +10,13 @@ BEGIN
BEGIN TRANSACTION;
EXEC USP_GetUserAccountByID @UserAccountId = @UserAccountID_;
IF @@ROWCOUNT = 0
THROW 50001, 'Could not find a user with that id', 1;
INSERT INTO dbo.UserVerification
(UserAccountId, VerificationDateTime)
VALUES
(@UserAccountID, @VerificationDateTime);
(UserAccountId, VerificationDateTime)
VALUES (@UserAccountID_, @VerificationDateTime);
COMMIT TRANSACTION;
END