Skip to content

Commit 95333c4

Browse files
Zeff01claude
andcommitted
Change meeting attendance status from 'late' to 'excused'
- Replace 'late' status with 'excused' in MeetingBasedAttendance component - Update SQL migration to support 'excused' status - Excused attendance counts towards points (same as present) - Update UI legend to show "Excused" instead of "Late" 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8646bd0 commit 95333c4

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎apps/codebility/app/home/my-team/[projectId]/_components/MeetingBasedAttendance.tsx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@codev
1717

1818
const ATTENDANCE_POINTS_PER_MEETING = 2;
1919

20-
type AttendanceStatus = "present" | "absent" | "late" | "not_scheduled";
20+
type AttendanceStatus = "present" | "absent" | "excused" | "not_scheduled";
2121

2222
interface AttendanceData {
2323
[key: string]: AttendanceStatus; // key format: "memberId-YYYY-MM-DD"
@@ -153,8 +153,8 @@ const MeetingBasedAttendance = forwardRef<any, MeetingBasedAttendanceProps>(({
153153

154154
let newStatus: AttendanceStatus;
155155
if (currentStatus === "present") newStatus = "absent";
156-
else if (currentStatus === "absent") newStatus = "late";
157-
else if (currentStatus === "late") newStatus = "present";
156+
else if (currentStatus === "absent") newStatus = "excused";
157+
else if (currentStatus === "excused") newStatus = "present";
158158
else newStatus = "absent"; // For not_scheduled, start with absent
159159

160160
setAttendanceData(prev => ({
@@ -190,8 +190,8 @@ const MeetingBasedAttendance = forwardRef<any, MeetingBasedAttendanceProps>(({
190190
project_id: projectId,
191191
date: dateStr,
192192
status: status as any,
193-
check_in: status === "present" || status === "late" ? scheduledMeeting.time : undefined,
194-
check_out: status === "present" || status === "late" ?
193+
check_in: status === "present" || status === "excused" ? scheduledMeeting.time : undefined,
194+
check_out: status === "present" || status === "excused" ?
195195
`${parseInt(scheduledMeeting.time.split(':')[0]) + 1}:${scheduledMeeting.time.split(':')[1]}` : undefined
196196
});
197197
});
@@ -233,7 +233,7 @@ const MeetingBasedAttendance = forwardRef<any, MeetingBasedAttendanceProps>(({
233233
if (!scheduledMeeting) return;
234234

235235
const dateKey = `${memberId}-${selectedYear}-${String(selectedMonth + 1).padStart(2, '0')}-${String(day).padStart(2, '0')}`;
236-
if (attendanceData[dateKey] === "present" || attendanceData[dateKey] === "late") {
236+
if (attendanceData[dateKey] === "present" || attendanceData[dateKey] === "excused") {
237237
count++;
238238
}
239239
});
@@ -260,7 +260,7 @@ const MeetingBasedAttendance = forwardRef<any, MeetingBasedAttendanceProps>(({
260260
return <Circle className="h-4 w-4 sm:h-5 sm:w-5 fill-green-500 text-green-500" />;
261261
case "absent":
262262
return <Circle className="h-4 w-4 sm:h-5 sm:w-5 fill-red-500 text-red-500" />;
263-
case "late":
263+
case "excused":
264264
return <Circle className="h-4 w-4 sm:h-5 sm:w-5 fill-yellow-500 text-yellow-500" />;
265265
case "not_scheduled":
266266
return <Circle className="h-4 w-4 sm:h-5 sm:w-5 fill-gray-300 text-gray-300 dark:fill-gray-600 dark:text-gray-600" />;
@@ -538,7 +538,7 @@ const MeetingBasedAttendance = forwardRef<any, MeetingBasedAttendanceProps>(({
538538
</div>
539539
<div className="flex items-center gap-1">
540540
<Circle className="h-3.5 w-3.5 sm:h-4 sm:w-4 fill-yellow-500 text-yellow-500" />
541-
<span className="text-gray-600 dark:text-gray-400">Late</span>
541+
<span className="text-gray-600 dark:text-gray-400">Excused</span>
542542
</div>
543543
<div className="flex items-center gap-1">
544544
<Circle className="h-3.5 w-3.5 sm:h-4 sm:w-4 fill-red-500 text-red-500" />

‎apps/codebility/supabase/migrations/20250119_create_meetings_table.sql‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS meeting_attendance (
2323
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
2424
meeting_id UUID NOT NULL REFERENCES meetings(id) ON DELETE CASCADE,
2525
codev_id UUID NOT NULL REFERENCES codev(id) ON DELETE CASCADE,
26-
attendance_status TEXT NOT NULL DEFAULT 'pending' CHECK (attendance_status IN ('pending', 'present', 'absent', 'late', 'excused')),
26+
attendance_status TEXT NOT NULL DEFAULT 'pending' CHECK (attendance_status IN ('pending', 'present', 'absent', 'excused')),
2727
join_time TIMESTAMP WITH TIME ZONE,
2828
leave_time TIMESTAMP WITH TIME ZONE,
2929
notes TEXT,
@@ -116,7 +116,6 @@ BEGIN
116116
NEW.scheduled_date,
117117
CASE
118118
WHEN ma.attendance_status = 'present' THEN 'present'::text
119-
WHEN ma.attendance_status = 'late' THEN 'late'::text
120119
WHEN ma.attendance_status = 'excused' THEN 'present'::text
121120
ELSE 'absent'::text
122121
END,

0 commit comments

Comments
 (0)