kshitij10496 / hercules

The mighty hero helping you build projects on top of IIT Kharagpur's academic data
https://hercules-10496.herokuapp.com/api/v1/static/index.html
MIT License
34 stars 18 forks source link

Make sure that a faculty can't be taking multiple subjects in same time on validation #46

Closed themousepotato closed 5 years ago

themousepotato commented 5 years ago

Check this instance:

        {
            "course": {
                "name": "GRAPH THEORY AND ALGORITHMS",
                "code": "MA60041",
                "credits": 4
            },
            "slot": {
                "time": {
                    "day": "Monday",
                    "time": "12 PM"
                },
                "slot": "D4"
            },
            "rooms": [
                "NR223"
            ]
        },
        {
            "course": {
                "name": "GRAPH THEORY AND ALGORITHMS",
                "code": "MA61003",
                "credits": 4
            },
            "slot": {
                "time": {
                    "day": "Monday",
                    "time": "12 PM"
                },
                "slot": "D4"
            },
            "rooms": [
                "NR223"
            ]
        }
    ],

Here, MA60041 and MA61003 appears to be different but, under the same name GRAPH THEORY AND ALGORITHMS, same time 12 PM. Write validation conditions for such cases. @kshitij10496 WDYT?

kshitij10496 commented 5 years ago

This is actually not a bug. What this duplication means is that a particular course has multiple course codes.

themousepotato commented 5 years ago

A validation should be there, no? Say wimp uses hercules for the data. It confuses the app as a faculty can't take multiple subjects at the same time. How can I particular course have multiple course codes. One of them should be outdated, no?

kshitij10496 commented 5 years ago

How can I particular course have multiple course codes.

Basically, different course codes refer to the academic batch registered for the course. For example, my batch uses the course code "MA51121" for this particular course while the 2 years M.Sc use a different one. Essentially, the mapping between a course and course codes is one-to-many. In order to port this to wimp, we can simply iterate over the list of course and fetch only the rooms and do not bother with the course details.