feat(tksupport): 전사 행정지원 서비스 신규 구축 (Phase 1 - 휴가신청)
sso_users 기반 전사 휴가신청/승인/잔여일 관리 서비스. 기존 tkfb의 workers 종속 휴가 기능을 전사 확장. - API: Express + MariaDB, SSO JWT 인증, 자동 마이그레이션 - Web: 대시보드, 휴가 신청/현황/승인 페이지 (보라색 테마) - DB: sp_vacation_requests, sp_vacation_balances 신규 테이블 - Docker: API(30600), Web(30680) 포트 구성 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
42
tksupport/api/db/migrations/001_create_sp_tables.sql
Normal file
42
tksupport/api/db/migrations/001_create_sp_tables.sql
Normal file
@@ -0,0 +1,42 @@
|
||||
-- sso_users에 입사일 추가
|
||||
ALTER TABLE sso_users ADD COLUMN IF NOT EXISTS hire_date DATE NULL COMMENT '입사일';
|
||||
|
||||
-- 전사 휴가 신청
|
||||
CREATE TABLE IF NOT EXISTS sp_vacation_requests (
|
||||
request_id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT NOT NULL COMMENT 'sso_users.user_id',
|
||||
vacation_type_id INT UNSIGNED NOT NULL,
|
||||
start_date DATE NOT NULL,
|
||||
end_date DATE NOT NULL,
|
||||
days_used DECIMAL(4,1) NOT NULL,
|
||||
reason TEXT,
|
||||
status ENUM('pending','approved','rejected','cancelled') DEFAULT 'pending',
|
||||
reviewed_by INT NULL,
|
||||
reviewed_at TIMESTAMP NULL,
|
||||
review_note TEXT,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (user_id) REFERENCES sso_users(user_id),
|
||||
FOREIGN KEY (reviewed_by) REFERENCES sso_users(user_id),
|
||||
FOREIGN KEY (vacation_type_id) REFERENCES vacation_types(id),
|
||||
INDEX idx_user_status (user_id, status),
|
||||
INDEX idx_dates (start_date, end_date)
|
||||
);
|
||||
|
||||
-- 전사 휴가 잔여일
|
||||
CREATE TABLE IF NOT EXISTS sp_vacation_balances (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT NOT NULL COMMENT 'sso_users.user_id',
|
||||
vacation_type_id INT UNSIGNED NOT NULL,
|
||||
year INT NOT NULL,
|
||||
total_days DECIMAL(4,1) DEFAULT 0,
|
||||
used_days DECIMAL(4,1) DEFAULT 0,
|
||||
notes TEXT,
|
||||
created_by INT NOT NULL,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
UNIQUE KEY unique_user_type_year (user_id, vacation_type_id, year),
|
||||
FOREIGN KEY (user_id) REFERENCES sso_users(user_id),
|
||||
FOREIGN KEY (created_by) REFERENCES sso_users(user_id),
|
||||
FOREIGN KEY (vacation_type_id) REFERENCES vacation_types(id)
|
||||
);
|
||||
Reference in New Issue
Block a user