Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for clustered classes in seat availability #5

Open
cmshawns opened this issue Aug 1, 2013 · 2 comments
Open

Account for clustered classes in seat availability #5

cmshawns opened this issue Aug 1, 2013 · 2 comments

Comments

@cmshawns
Copy link
Contributor

cmshawns commented Aug 1, 2013

In ODS:

  • Clustered classes are identified by a value in the [ClusterItemNumber] field.
    For clustered classes:
  • Capacity is pulled from [vw_ClassCluster].[ClusterCapacity]
  • Enrollments is pulled from [vw_ClassCluster].[ClusterEnrolled]

geol106-geog106 clustered

@cmshawns
Copy link
Contributor Author

cmshawns commented Aug 1, 2013

LINQ research:

from s in Vw_Class
//join l in Vw_ClassCluster on string.Concat(s.ClusterItemNumber, s.YearQuarterID) equals l.ClassClusterID
where s.ClassID == "3545B124"
select new {
    s.ClassID,
    IsClustered = s.ClusterItemNumber != null,
    SeatsAvailable = s.ClusterItemNumber != null ?
                        Vw_ClassCluster.Where(l => string.Concat(s.ClusterItemNumber, s.YearQuarterID) == l.ClassClusterID)
                        .Select (l => l.ClusterCapacity - l.ClusterEnrolled)
                        .First()
                    : s.ClassCapacity - s.StudentsEnrolled,
    s.ClassCapacity,
    s.StudentsEnrolled,
    // l.ClusterCapacity,
    // l.ClusterEnrolled,
}

@cmshawns
Copy link
Contributor Author

cmshawns commented Aug 1, 2013

This was done directly in the database for the Class Schedule app, but we still should include this logic in the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant