feat(time): add span-based attendance tracking under 2.0
This commit is contained in:
@@ -302,6 +302,20 @@ export const buildTenantFullExport = async (
|
||||
addRows(tables, "auth_profile_teams", await loadRows(client, "auth_profile_teams", "profile_id = any($1::uuid[])", [profileIds]))
|
||||
}
|
||||
|
||||
// Span children have no tenant column; include them through their scoped parent IDs.
|
||||
const timeSpanIds = collectIds(tables.staff_time_spans || [], "id")
|
||||
if (timeSpanIds.length) {
|
||||
for (const table of ["staff_time_span_breaks", "staff_time_span_projects", "staff_time_span_history"]) {
|
||||
if (columnsByTable.has(table)) {
|
||||
addRows(tables, table, await loadRows(client, table, "span_id = any($1::uuid[])", [timeSpanIds]))
|
||||
}
|
||||
}
|
||||
}
|
||||
const legacyTimeIds = collectIds(tables.staff_time_entries || [], "id")
|
||||
if (legacyTimeIds.length && columnsByTable.has("staff_time_entry_connects")) {
|
||||
addRows(tables, "staff_time_entry_connects", await loadRows(client, "staff_time_entry_connects", "time_entry_id = any($1::uuid[])", [legacyTimeIds]))
|
||||
}
|
||||
|
||||
const communicationRoomIds = collectIds(tables.communication_rooms || [], "id")
|
||||
if (communicationRoomIds.length) {
|
||||
addRows(tables, "communication_room_members", await loadRows(client, "communication_room_members", "room_id = any($1::uuid[])", [communicationRoomIds]))
|
||||
|
||||
Reference in New Issue
Block a user