bcgov / SIMS

Student Information Management System. Post-Secondary Student Financial Aid System
Apache License 2.0
21 stars 14 forks source link

#3282 - Detect Assessment Offering Dates Change (Part 2) #3294

Closed sh16011993 closed 1 week ago

sh16011993 commented 2 weeks ago

As a part of this PR, the following was completed:

Generated Queries for reference:


-- SELECT 1st

SELECT
    "studentAssessment"."id" AS "studentAssessmentId",
    "offering"."study_start_date" AS "offeringStudyStartDate",
    "offering"."study_end_date" AS "offeringStudyEndDate"
FROM
    "sims"."student_assessments" "studentAssessment"
INNER JOIN "sims"."education_programs_offerings" "offering" ON
    "offering"."id" = "studentAssessment"."offering_id"
INNER JOIN "sims"."applications" "application" ON
    "application"."id" = "studentAssessment"."application_id"
WHERE
    "application"."id" = $1
    AND "studentAssessment"."previous_date_changed_reported_assessment_id" IS NOT NULL
    AND "studentAssessment"."reported_date" IS NOT NULL
ORDER BY
    "studentAssessment"."assessment_date" DESC
LIMIT 1;

-- SELECT 2nd

SELECT
    "studentAssessment"."id" AS "studentAssessmentId",
    "offering"."study_start_date" AS "offeringStudyStartDate",
    "offering"."study_end_date" AS "offeringStudyEndDate"
FROM
    "sims"."student_assessments" "studentAssessment"
INNER JOIN "sims"."education_programs_offerings" "offering" ON
    "offering"."id" = "studentAssessment"."offering_id"
INNER JOIN "sims"."applications" "application" ON
    "application"."id" = "studentAssessment"."application_id"
INNER JOIN "sims"."disbursement_schedules" "disbursementSchedules" ON
    "disbursementSchedules"."student_assessment_id" = "studentAssessment"."id"
WHERE
    "application"."id" = $1
    AND "disbursementSchedules"."disbursement_schedule_status" = $2
ORDER BY
    "studentAssessment"."assessment_date" DESC
LIMIT 1;

-- UPDATE

UPDATE
    "sims"."student_assessments"
SET
    "previous_date_changed_reported_assessment_id" = $1,
    "modifier" = $2,
    "updated_at" = CURRENT_TIMESTAMP
WHERE
    "id" = $3;

Next PR: e2e tests

dheepak-aot commented 1 week ago

Please have look at the comments @sh16011993

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

github-actions[bot] commented 1 week ago

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 20.1% ( 2980 / 14829 )
Methods: 10.3% ( 194 / 1884 )
Lines: 23% ( 2574 / 11192 )
Branches: 12.09% ( 212 / 1753 )
github-actions[bot] commented 1 week ago

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 54.25% ( 453 / 835 )
Methods: 49.02% ( 50 / 102 )
Lines: 58.68% ( 372 / 634 )
Branches: 31.31% ( 31 / 99 )
github-actions[bot] commented 1 week ago

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 82.18% ( 775 / 943 )
Methods: 80% ( 84 / 105 )
Lines: 83.44% ( 670 / 803 )
Branches: 60% ( 21 / 35 )
github-actions[bot] commented 1 week ago

E2E SIMS API Coverage Report

Totals Coverage
Statements: 61.62% ( 4944 / 8023 )
Methods: 58.47% ( 604 / 1033 )
Lines: 66% ( 3932 / 5958 )
Branches: 39.53% ( 408 / 1032 )