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

Budget change phases automatically #2304

Open
decabeza opened this issue Jan 11, 2018 · 4 comments
Open

Budget change phases automatically #2304

decabeza opened this issue Jan 11, 2018 · 4 comments

Comments

@decabeza
Copy link
Collaborator

decabeza commented Jan 11, 2018

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.
@decabeza decabeza added this to the v0.13 milestone Jan 11, 2018
@decabeza decabeza added this to Next in Roadmap Jan 11, 2018
@bertocq bertocq self-assigned this Jan 11, 2018
@voodoorai2000 voodoorai2000 moved this from Next to Doing in Roadmap Jan 12, 2018
@bertocq bertocq moved this from Doing to Next in Roadmap Jan 25, 2018
@fernando-faubell
Copy link

fernando-faubell commented Jan 25, 2018

+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.

@voodoorai2000 voodoorai2000 removed this from Next in Roadmap Jan 29, 2018
@rzido
Copy link

rzido commented Jan 31, 2018

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.

@bertocq
Copy link
Collaborator

bertocq commented Jan 31, 2018

@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?

@rzido
Copy link

rzido commented Feb 6, 2018

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

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

6 participants