Refactor the parser in parser/sectionParser.go and parser/professorParser so that the section can reference the list of associated professors using their compound keys (combination of fields that uniquely identify the object) and vice versa.
For example, each section can be identified by:
{
"subject_prefix": XX,
"course_number": YYYY,
"term": 18F,
"section_number": 001,
}
instead of just mongo.Id (Same thing for professor). How you want to set up this compound key is up to you as long as they are unique. You should only be concerned with the connection between course and section.
Refactoring the parser means that you will have to do the following things:
- Refactor the schema of profssor and section over the
nebula-api repo
- Refactor the parsing logic between professor and section (main part)
- Refactor the professor and section validating part in
validator.go
- Refactor the test in
professorParser_test.go, sectionParser_test.go, and validator_test.go.
While you work on this issue, make sure to pull or push to the compound-key branch that I created in both nebula-api & api-tools repo.
Refactor the parser in
parser/sectionParser.goandparser/professorParserso that the section can reference the list of associated professors using their compound keys (combination of fields that uniquely identify the object) and vice versa.For example, each section can be identified by:
instead of just mongo.Id (Same thing for professor). How you want to set up this compound key is up to you as long as they are unique. You should only be concerned with the connection between course and section.
Refactoring the parser means that you will have to do the following things:
nebula-apirepovalidator.goprofessorParser_test.go,sectionParser_test.go, andvalidator_test.go.While you work on this issue, make sure to pull or push to the
compound-keybranch that I created in bothnebula-api&api-toolsrepo.