Renamed some of the goal fields to align with business logic

This commit is contained in:
ivan-pelly
2026-03-14 16:30:17 -07:00
parent 7f91e2e557
commit 4d9b83c327
50 changed files with 279 additions and 149 deletions
@@ -5,7 +5,7 @@ BEGIN
s.`identifier` AS `studentIdentifier`,
b.`id_benchmark` AS `benchmarkId`,
b.`id_goal` AS `goalId`,
g.`title` AS `goalTitle`,
g.`category` AS `goalCategory`,
b.`benchmark` AS `benchmark`,
u.`name` AS `createdByName`,
b.`created_at` AS `createdAt`,
+1 -1
View File
@@ -5,9 +5,9 @@ BEGIN
goalId,
goalParentId,
studentId,
title,
description,
category,
baseline,
progressEventCount
FROM v_goal_card
ORDER BY goalId;
+1 -1
View File
@@ -5,9 +5,9 @@ BEGIN
goalId,
goalParentId,
studentId,
title,
description,
category,
baseline,
progressEventCount
FROM v_goal_card
WHERE goalId = p_id_goal
@@ -5,9 +5,9 @@ BEGIN
s.`identifier` AS `studentIdentifier`,
vc.`goalId`,
vc.`goalParentId`,
vc.`title`,
vc.`description`,
vc.`category`,
vc.`baseline`,
vc.`progressEventCount`,
vc.`benchmarkCount`
FROM `v_goal_card` vc
+5 -5
View File
@@ -4,9 +4,9 @@ CREATE DEFINER=`root`@`%` PROCEDURE `sp_Goal_Insert`(
IN p_id_goal_parent CHAR(36),
IN p_id_student CHAR(36),
IN p_id_user_created CHAR(36),
IN p_title VARCHAR(255),
IN p_description TEXT,
IN p_category VARCHAR(100)
IN p_category VARCHAR(255),
IN p_baseline TEXT
)
BEGIN
INSERT INTO goal
@@ -15,9 +15,9 @@ BEGIN
id_goal_parent,
id_student,
id_user_created,
title,
description,
category,
baseline,
created_at,
updated_at
)
@@ -27,9 +27,9 @@ BEGIN
p_id_goal_parent,
p_id_student,
p_id_user_created,
p_title,
p_description,
p_category,
p_baseline,
UTC_TIMESTAMP(),
UTC_TIMESTAMP()
);
@@ -38,9 +38,9 @@ BEGIN
id_goal_parent,
id_student,
id_user_created,
title,
description,
category,
baseline,
created_at,
updated_at
FROM goal
+3 -3
View File
@@ -4,9 +4,9 @@ CREATE DEFINER=`root`@`%` PROCEDURE `sp_Goal_Update`(
IN p_id_goal_parent CHAR(36),
IN p_id_student CHAR(36),
IN p_id_user_created CHAR(36),
IN p_title VARCHAR(255),
IN p_description TEXT,
IN p_category VARCHAR(100)
IN p_category VARCHAR(255),
IN p_baseline TEXT
)
BEGIN
UPDATE goal
@@ -14,9 +14,9 @@ BEGIN
id_goal_parent = COALESCE(p_id_goal_parent, id_goal_parent),
id_student = COALESCE(p_id_student, id_student),
id_user_created = COALESCE(p_id_user_created, id_user_created),
title = COALESCE(p_title, title),
description = COALESCE(p_description, description),
category = COALESCE(p_category, category),
baseline = COALESCE(p_baseline, baseline),
updated_at = UTC_TIMESTAMP()
WHERE id_goal = p_id_goal;
SELECT ROW_COUNT() AS rows_affected;
@@ -0,0 +1,15 @@
DELIMITER ;;
CREATE DEFINER=`root`@`%` PROCEDURE `sp_User_SetPassword`(
IN p_id_user CHAR(36),
IN p_password_hash VARCHAR(255),
IN p_password_salt VARCHAR(255)
)
BEGIN
UPDATE user
SET password_hash = p_password_hash,
password_salt = p_password_salt,
password_updated_at = UTC_TIMESTAMP()
WHERE id_user = p_id_user;
SELECT ROW_COUNT() AS rows_affected;
END;;
DELIMITER ;