diff --git a/backend/src/index.js b/backend/src/index.js
index 8725d40..bbfb25a 100644
--- a/backend/src/index.js
+++ b/backend/src/index.js
@@ -7,11 +7,12 @@ import { configRoutes } from './routes/config.js'
import { workforceRoutes } from './routes/workforce.js'
const app = Fastify({ logger: true, trustProxy: true })
+const startedAt = Date.now()
await app.register(cookie)
await app.register(cors, { origin: process.env.CORS_ORIGIN || false, credentials: true })
-app.get('/health', async () => ({ status: 'healthy' }))
+app.get('/health', async () => ({ status: 'healthy', version: process.env.BUILD_VERSION || String(startedAt) }))
await app.register(bookingRoutes)
await app.register(configRoutes)
diff --git a/backend/src/lib/workforce.js b/backend/src/lib/workforce.js
index fb08e55..a533236 100644
--- a/backend/src/lib/workforce.js
+++ b/backend/src/lib/workforce.js
@@ -95,8 +95,6 @@ export async function fetchShifts(from, to, deptIds) {
let breakHrs = 0
if (Array.isArray(s.breaks) && s.breaks.length) {
breakHrs = s.breaks.reduce((sum, b) => sum + (b.finish - b.start) / 3600, 0)
- } else {
- breakHrs = (s.automatic_break_length ?? 0) / 60
}
const shiftHrs = Math.max(0, (s.finish - s.start) / 3600 - breakHrs)
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 471bd86..0e6f108 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -1,5 +1,7 @@
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom'
import { AuthGate } from './components/AuthGate'
+import { UpdateBanner } from './components/UpdateBanner'
+import { useVersionCheck } from './hooks/useVersionCheck'
import { Layout } from './components/Layout'
import { Planner } from './pages/Planner'
import { Settings } from './pages/CategorySettings'
@@ -20,11 +22,15 @@ function AppRoutes({ user }: { user: User }) {
}
export default function App() {
+ const updateAvailable = useVersionCheck('/hk-planner/health')
return (
-