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

allow a plan like Key Deposit to be dependent on other plans #28

Open
thoel opened this issue Jan 26, 2015 · 5 comments
Open

allow a plan like Key Deposit to be dependent on other plans #28

thoel opened this issue Jan 26, 2015 · 5 comments

Comments

@thoel
Copy link

thoel commented Jan 26, 2015

It would be very nice if the Key Deposit plan would automatically set if any housing plan were chosen. (And then automatically clear if all the housing options were cleared.) One way to specify this would be to add a new plan option, perhaps called "Dependent" (or "Automatic"). For our purposes making this plan dependent on all other plans with the same plan_category_id and a lower cat_order would suffice. The user should not be able to change this setting directly, perhaps by also setting Disabled and Show Disabled.

@jaredbeck
Copy link
Member

Interesting idea, Tim. I can see how it would be helpful for registrars. Unfortunately, it's not a simple feature.

Rex, if you do decide to take this on, Tim is describing a Directed Acyclic Graph.

For example:

dag

Representing a graph in a relational database is a well-studied topic. A simple design would be a table like plan_dependencies with a parent_plan_id and a child_plan_id. I think this is referred to as an "Adjacency List". I don't recommend using cat_order for this, because that would ascribe more than one meaning to a datum.

If you allow the registrar to define the graph, you have to detect and prevent cycles.

As I expect this feature to save registrars a few hours each year, and take 20 hours to build (well), I think it should be a low priority, unless it just strikes your fancy as an interesting problem. :)

@rcristal
Copy link
Member

Interesting. Looks like a good opportunity to use graph theory.

@thoel
Copy link
Author

thoel commented Apr 21, 2015

Implementing a full Directed Acyclic Graph model is certainly appealing from a computer science standpoint, and would offer a lot of power and flexibility. Unfortunately, it would also require a lot of work to implement, a lot of effort to use correctly, and might provide too much rope.

The Key Deposit problem comes up most years and has already cost our Congress team more than a few hours. Providing a simple solution would be very useful. It's true that using cat_order for this new feature would ascribe a second meaning to this datum, but only when the new feature is being used. The trade-off is the feature becomes easy to implement, easy to use, and only creates a minor limitation that room options must appear before Key Deposit.

@jaredbeck
Copy link
Member

What if there were another column, like plans.dependency_order (there's probably a better name)? Given the following records:

dependency_order name
10 A
null B
10 C
20 D
30 E

Then, if either A or C were selected, both D and E would be required.

It's not the most flexible system, but it would be easy to implement.

@thoel
Copy link
Author

thoel commented Apr 23, 2015

As an admin, I would prefer the original suggestion because it is easiest to use and does exactly what I want for Key Deposit. The most recent suggestion would certainly work, but the admin would have to set a dependency_order value in each of the room plans.

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

No branches or pull requests

3 participants