Consul: Budget change phases automatically

Created on 11 Jan 2018  路  4Comments  路  Source: consul/consul

Background

Now to change the phase of a budget it's necessary to do it manually on admin panel.

What we need

Change automatically of phase using star_date and end_date defined for each phase on admin panel.

  • We can use 00:00h to change between phases.
Admin Budgets Community Interest Good first issue help wanted

All 4 comments

+1 Desde Castell贸n!

https://github.com/AjuntamentdeCastello/consul

Aqu铆 tambi茅n nos vendr铆a bien esta funcionalidad, aqu铆 en Castell贸n los cambios de fase suelen ser a medianoche, si no son autom谩ticos, alguien tiene que conectarse al portal para realizar el cambio a mano.

Gracias.

If it were possible it will be nice that not only the day but the time/hour could be introduced too. This is because some times the next phase starts after a public presentation.

@rzido we've contemplated that requirement while planning this and its possible at a technical level, but the performance of the app would decrease a bit as it would imply an extra query to the database for each time a page related with budgets would be requested.

Initially the plan is to implement this feature with a fixed hour at the file https://github.com/consul/consul/blob/master/config/schedule.rb#L26 (that will launch the phase changing code) as both Madrid and Castello are okey with that solution, as normally only 2-3 phases have a newsconference (initial & final and maybe results) at a variable time, and the rest of the 9 phases just ends at night.

On a technical level, the variable hour solution implementation I imagined is to look for the current Budget's phase dynamically by overriding Budget#phase string attribute with a call to the database that will find exactly now in which phase range we're on. The only alternative I see is to launch every minute or so with schedule.rb the phase changing code but that's far worse as it would query about 1440 times a day... compared to once each time a user visits a budget related page 馃 it may depend of the amount of users & usage of a fork to choose which is the worst in performance... but for sure both are bad for the response time of the app & database.

So I would carefully evaluate if its really important to allow a non-technical person to be able to change through admin panel the time of the phase changes (variable hour), compared to having to change the schedule.rb file time (fixed hour) if needed, and deploy it to server as soon as the presentation time is known. That is obviously in the scenario that your fork has dedicated/hired/maintenance developers that can do that task on request. Do you still think it would be neccessary for your fork?

@bertocq It will be ok if we could change it in a configuration file (schedurle.rb) and deploy it to server, as you propose.

Was this page helpful?
0 / 5 - 0 ratings