Skip to content

Commit

Permalink
feat: 주말 사서 근무 추가 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
not-using committed Nov 2, 2023
1 parent 7977179 commit 8fe12cd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/constants/events.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const ATTENDED = 'attended';
export const MEETING = '정기사서회의';
export const SHIFT = '사서근무';
export const SHIFT_WEEKEND = '주말사서근무';
3 changes: 2 additions & 1 deletion src/constants/sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ export const TOGETHER_RANGE = '별첨_월렛 지급 예정 현황!L5:M50'; //
export const RAW_SHEET = '별첨_raw data';
export const ATTENDTYPE = {
정기사서회의: '회의 참석',
사서근무: '사서 근무',
사서근무: '평일 사서',
주말사서근무: '주말 사서',
시간외근무: '시간외 근무',
기타: '기타 이벤트',
};
10 changes: 8 additions & 2 deletions src/services/shift.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SHIFT } from '../constants/events.js';
import { SHIFT, SHIFT_WEEKEND } from '../constants/events.js';
import { TOGETHER_RANGE } from '../constants/sheet.js';
import { confirmMessage } from '../messages/confirmMessage.js';
import {
Expand All @@ -7,9 +7,15 @@ import {
} from '../utils/httpClient.js';
import { sendBlocks } from '../utils/slackChat.js';

const WEEKS = [1, 2, 3, 4, 5];

export const sendShiftConfirmation = async () => {
const today = new Date().toISOString().slice(0, 10);
const message = confirmMessage(SHIFT, today.slice(5, 10));
const isInWeekdays = WEEKS.includes(new Date().getDate());
const message = confirmMessage(
isInWeekdays ? SHIFT : SHIFT_WEEKEND,
today.slice(5, 10)
);

const todayLibrarians = await getTodayLibrariansFromTogether(today);
const todayLibrariansId = await getLibrariansIdFromSheet(todayLibrarians);
Expand Down

0 comments on commit 8fe12cd

Please sign in to comment.