diff --git a/OtripleS.Web.Api/Services/Foundations/Students/StudentService.Validations.cs b/OtripleS.Web.Api/Services/Foundations/Students/StudentService.Validations.cs index 5dbff509b..9907aa82c 100644 --- a/OtripleS.Web.Api/Services/Foundations/Students/StudentService.Validations.cs +++ b/OtripleS.Web.Api/Services/Foundations/Students/StudentService.Validations.cs @@ -27,17 +27,15 @@ private void ValidateStudentOnRegister(Student student) (Rule: IsInvalidX(student.UpdatedDate), Parameter: nameof(Student.UpdatedDate)), (Rule: IsNotRecent(student.CreatedDate), Parameter: nameof(Student.CreatedDate)), - (Rule: IsNotSame( - firstId: student.UpdatedBy, - secondId: student.CreatedBy, - secondIdName: nameof(Student.CreatedBy)), - Parameter: nameof(Student.UpdatedBy)), - - (Rule: IsNotSame( - firstDate: student.UpdatedDate, - secondDate: student.CreatedDate, - secondDateName: nameof(Student.CreatedDate)), - Parameter: nameof(Student.UpdatedDate)) + (Rule: IsNotSame(firstId: student.UpdatedBy, + secondId: student.CreatedBy, + secondIdName: nameof(Student.CreatedBy)), + Parameter: nameof(Student.UpdatedBy)), + + (Rule: IsNotSame(firstDate: student.UpdatedDate, + secondDate: student.CreatedDate, + secondDateName: nameof(Student.CreatedDate)), + Parameter: nameof(Student.UpdatedDate)) ); } @@ -127,10 +125,10 @@ private void ValidateStudentOnModify(Student student) (Rule: IsNotRecent(student.UpdatedDate), Parameter: nameof(Student.UpdatedDate)), (Rule: IsSame( - firstDate: student.UpdatedDate, - secondDate: student.CreatedDate, - secondDateName: nameof(Student.CreatedDate)), - Parameter: nameof(Student.UpdatedDate)) + firstDate: student.UpdatedDate, + secondDate: student.CreatedDate, + secondDateName: nameof(Student.CreatedDate)), + Parameter: nameof(Student.UpdatedDate)) ); } @@ -138,22 +136,22 @@ public void ValidateAgainstStorageStudentOnModify(Student inputStudent, Student { Validate( (Rule: IsNotSame( - firstDate: inputStudent.CreatedDate, - secondDate: storageStudent.CreatedDate, - secondDateName: nameof(Student.CreatedDate)), - Parameter: nameof(Student.CreatedDate)), - + firstDate: inputStudent.CreatedDate, + secondDate: storageStudent.CreatedDate, + secondDateName: nameof(Student.CreatedDate)), + Parameter: nameof(Student.CreatedDate)), + (Rule: IsSame( - firstDate: inputStudent.UpdatedDate, - secondDate: storageStudent.UpdatedDate, - secondDateName: nameof(Student.UpdatedDate)), - Parameter: nameof(Student.UpdatedDate)), + firstDate: inputStudent.UpdatedDate, + secondDate: storageStudent.UpdatedDate, + secondDateName: nameof(Student.UpdatedDate)), + Parameter: nameof(Student.UpdatedDate)), (Rule: IsNotSame( - firstId: inputStudent.CreatedBy, - secondId: storageStudent.CreatedBy, - secondIdName: nameof(Student.CreatedBy)), - Parameter: nameof(Student.CreatedBy)) + firstId: inputStudent.CreatedBy, + secondId: storageStudent.CreatedBy, + secondIdName: nameof(Student.CreatedBy)), + Parameter: nameof(Student.CreatedBy)) ); } @@ -167,7 +165,7 @@ private bool IsDateNotRecent(DateTimeOffset date) return timeDifference.Duration() > oneMinute; } - + private static void ValidateStudent(Student student) { if (student is null)