This PR will introduce a new ComparisonData struct and various enums that work together to create a very modular comparison system.
The ComparisonData struct will allow users to define a comparison that functions through a chain of enums. This chain can get very wordy, so a new interface will need to be created at some point. This will take some time (which we don't have right now) so for now, we will create these comparisons programmatically and defer creation of this page for a later date.
The ComparisonData uses the ComparisonType enum. This contains the brunt of the logic for this structure. By nesting the various enum types, we can define a series of operations that must compare against a single value (the target_value field). Each of the operations implements the Comparison trait, which defines the evaluate function. This function simply takes two ValueTypes: one for the comparison data (the student data for now) and one for the target value. The operations are then performed in their nested order and a boolean value is returned indicating if the comparison succeeded.
I've also decided to create a few extra pages, namely the ScholarshipInfoPage and StudentInfoPage. I've used these to create a testing scholarship and student entry, and then compare them against each other. These are the specific tests I've done:
Student can see that they are eligible for the scholarship
Scholarship provider can see that this student is eligible for their scholarship
These pages are not final products, and should be altered before a production build is required.
This PR will introduce a new `ComparisonData` struct and various enums that work together to create a very modular comparison system.
The `ComparisonData` struct will allow users to define a comparison that functions through a chain of enums. This chain can get very wordy, so a new interface will need to be created at some point. This will take some time (which we don't have right now) so for now, we will create these comparisons programmatically and defer creation of this page for a later date.
The `ComparisonData` uses the `ComparisonType` enum. This contains the brunt of the logic for this structure. By nesting the various enum types, we can define a series of operations that must compare against a single value (the `target_value` field). Each of the operations implements the `Comparison` trait, which defines the `evaluate` function. This function simply takes two `ValueType`s: one for the comparison data (the student data for now) and one for the target value. The operations are then performed in their nested order and a boolean value is returned indicating if the comparison succeeded.
I've also decided to create a few extra pages, namely the `ScholarshipInfoPage` and `StudentInfoPage`. I've used these to create a testing scholarship and student entry, and then compare them against each other. These are the specific tests I've done:
- Student can see that they are eligible for the scholarship
- Scholarship provider can see that this student is eligible for their scholarship
These pages are not final products, and should be altered before a production build is required.
This PR ended up covering a little more than just the comparison structure. It now includes the scholarship entry page and some of the student data. We'll need to look at these in more detail in another PR at a later time.
This PR ended up covering a little more than just the comparison structure. It now includes the scholarship entry page and some of the student data. We'll need to look at these in more detail in another PR at a later time.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR will introduce a new
ComparisonDatastruct and various enums that work together to create a very modular comparison system.The
ComparisonDatastruct will allow users to define a comparison that functions through a chain of enums. This chain can get very wordy, so a new interface will need to be created at some point. This will take some time (which we don't have right now) so for now, we will create these comparisons programmatically and defer creation of this page for a later date.The
ComparisonDatauses theComparisonTypeenum. This contains the brunt of the logic for this structure. By nesting the various enum types, we can define a series of operations that must compare against a single value (thetarget_valuefield). Each of the operations implements theComparisontrait, which defines theevaluatefunction. This function simply takes twoValueTypes: one for the comparison data (the student data for now) and one for the target value. The operations are then performed in their nested order and a boolean value is returned indicating if the comparison succeeded.I've also decided to create a few extra pages, namely the
ScholarshipInfoPageandStudentInfoPage. I've used these to create a testing scholarship and student entry, and then compare them against each other. These are the specific tests I've done:These pages are not final products, and should be altered before a production build is required.
This PR ended up covering a little more than just the comparison structure. It now includes the scholarship entry page and some of the student data. We'll need to look at these in more detail in another PR at a later time.