Skip to content

Commit 165e2aa

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

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
@@ -3,6 +3,7 @@
33
*/
44
export interface TodayScheduleResponseDto {
55
workLogId: string;
6+
storeId: string | null; // 알바 공고 기반 근무의 근무지 ID (수동 등록 시 null)
67
status: 'scheduled' | 'working' | 'done' | 'settled' | 'absent';
78
statusLabel: string; // "예정", "근무 중", "근무 완료", "정산 완료", "결근"
89
workplace: string; // "CU 홍대 점"

src/repository/work_log_repository.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class WorkLogRepository {
112112
alba_posting: {
113113
hourly_rate: number | null;
114114
store: {
115+
store_id: Uint8Array;
115116
store_name: string | null;
116117
};
117118
} | null;
@@ -141,6 +142,7 @@ class WorkLogRepository {
141142
hourly_rate: true,
142143
store: {
143144
select: {
145+
store_id: true,
144146
store_name: true,
145147
},
146148
},

src/service/work_log_service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ class WorkLogService {
6161
);
6262

6363
// alba_posting이 있으면 사용, 없으면 schedule에서 fallback
64+
let storeId: string | null = null;
6465
let workplace = '';
6566
let hourlyWage = 0;
6667

6768
if (log.alba_posting) {
69+
storeId = bufferToUuid(log.alba_posting.store.store_id);
6870
workplace = log.alba_posting.store.store_name || '';
6971
hourlyWage = log.alba_posting.hourly_rate || 0;
7072
} else if (log.user_alba_schedule_id) {
@@ -89,6 +91,7 @@ class WorkLogService {
8991

9092
return {
9193
workLogId: bufferToUuid(log.user_work_log_id),
94+
storeId,
9295
status,
9396
statusLabel: STATUS_LABELS[status] || '알 수 없음',
9497
workplace,

0 commit comments

Comments
 (0)