Skip to content

Feature/dashboard occupancy#198

Open
hiuwini wants to merge 2 commits intooscarchapp:mainfrom
hiuwini:feature/dashboard-occupancy
Open

Feature/dashboard occupancy#198
hiuwini wants to merge 2 commits intooscarchapp:mainfrom
hiuwini:feature/dashboard-occupancy

Conversation

@hiuwini
Copy link

@hiuwini hiuwini commented Mar 9, 2026

  • Backend: en DashboardView.get() se calcula occupancy_pct como (\frac{#\text{reservas NEW que ocupan hoy}}{#\text{habitaciones}} \times 100) y se agrega al dict dashboard.

    • Archivo: pms/views.py
  • UI: se añadió una card nueva “% ocupación” en el Dashboard, mostrando {{dashboard.occupancy_pct|floatformat:2}}%.

    • Archivo: pms/templates/dashboard.html
  • Tests unitarios: se agregaron tests para:

    • contar solo reservas NEW que ocupan hoy (checkin <= hoy < checkout)
    • excluir reservas fuera de rango y DEL
    • manejar caso sin habitaciones (0%)

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

Successfully merging this pull request may close these issues.

1 participant