feat(time): add span-based attendance tracking under 2.0

This commit is contained in:
2026-10-03 15:55:45 +02:00
parent 4c67ddd908
commit 677ae0f4fb
32 changed files with 1681 additions and 47 deletions

View File

@@ -7,7 +7,7 @@ const setupPage = async () => {
const checks = await Promise.all(profiles.map(async (profile) => {
try {
const spans = await useNuxtApp().$api(`/api/staff/time/spans?targetUserId=${profile.user_id || profile.id}`)
const openSpan = (spans || []).find((s) => !s.endedAt && s.type === "work")
const openSpan = (spans || []).find((s) => !s.endedAt && ["work", "pause"].includes(s.type))
if (openSpan) return { profile: profile.id }
} catch (e) {
return null