Skip to content

Commit 6eb1d42

Browse files
committed
feat(work_log): GET /api/work-logs/today 응답에 workplaceName 필드 추가
1 parent 165e2aa commit 6eb1d42

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/DTO/work_log_dto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export interface TodayScheduleResponseDto {
77
status: 'scheduled' | 'working' | 'done' | 'settled' | 'absent';
88
statusLabel: string; // "예정", "근무 중", "근무 완료", "정산 완료", "결근"
99
workplace: string; // "CU 홍대 점"
10+
workplaceName: string | null; // 근무지 별칭 (사용자 지정 이름)
1011
startTime: string; // "14:00"
1112
endTime: string; // "18:00"
1213
workHours: number; // 4

src/repository/work_log_repository.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ class WorkLogRepository {
119119
user_alba_schedule: {
120120
address: string | null;
121121
category: string | null;
122+
workplace_name: string | null;
122123
} | null;
123124
}[]
124125
> {
@@ -152,6 +153,7 @@ class WorkLogRepository {
152153
select: {
153154
address: true,
154155
category: true,
156+
workplace_name: true,
155157
},
156158
},
157159
},

src/service/work_log_service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,12 @@ class WorkLogService {
8080

8181
let address = '';
8282
let category = '';
83+
let workplaceName: string | null = null;
8384

8485
if (log.user_alba_schedule) {
8586
address = log.user_alba_schedule.address || '';
8687
category = log.user_alba_schedule.category || '';
88+
workplaceName = log.user_alba_schedule.workplace_name || null;
8789
}
8890

8991
const totalWage = Math.round(hourlyWage * workHours);
@@ -93,6 +95,7 @@ class WorkLogService {
9395
workLogId: bufferToUuid(log.user_work_log_id),
9496
storeId,
9597
status,
98+
workplaceName,
9699
statusLabel: STATUS_LABELS[status] || '알 수 없음',
97100
workplace,
98101
startTime,

0 commit comments

Comments
 (0)