- 공장(카테고리) 및 작업장 CRUD API 구현
- 탭 기반 UI로 공장별 작업장 필터링
- 터치 최적화된 관리자 페이지
- DB 테이블: workplace_categories, workplaces
- 관리자 메뉴에 작업장 관리 추가
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
## 주요 변경사항
### 1. TBM (Tool Box Meeting) 시스템 구축
- **데이터베이스 스키마** (5개 테이블 생성)
- tbm_sessions: TBM 세션 관리
- tbm_team_assignments: 팀 구성 관리
- tbm_safety_checks: 안전 체크리스트 마스터 (17개 항목)
- tbm_safety_records: 안전 체크 기록
- team_handovers: 작업 인계 관리
- **API 엔드포인트** (17개)
- TBM 세션 CRUD
- 팀 구성 관리
- 안전 체크리스트
- 작업 인계
- 통계 및 리포트
- **프론트엔드**
- TBM 관리 페이지 (/pages/work/tbm.html)
- 모달 기반 UI (세션 생성, 팀 구성, 안전 체크)
### 2. 페이지 권한 관리 시스템
- 페이지별 접근 권한 설정 기능
- 관리자 페이지 (/pages/admin/page-access.html)
- 사용자별 페이지 권한 부여/회수
- TBM 페이지 등록 및 권한 연동
### 3. 네비게이션 role 표시 버그 수정
- load-navbar.js: case-insensitive role 매칭 적용
- JWT의 "Admin" role이 "관리자"로 정상 표시
- admin-only 메뉴 항목 정상 표시
### 4. 대시보드 개선
- 작업 현황 테이블 가독성 향상
- 고대비 색상 및 명확한 구분선 적용
- 이모지 제거 및 SVG 아이콘 적용
### 5. 문서화
- TBM 배포 가이드 작성 (docs/TBM_DEPLOYMENT_GUIDE.md)
- 데이터베이스 스키마 상세 기록
- 배포 절차 및 체크리스트 제공
## 기술 스택
- Backend: Node.js, Express, MySQL
- Frontend: Vanilla JavaScript, HTML5, CSS3
- Database: MySQL (InnoDB)
## 파일 변경사항
### 신규 파일
- api.hyungi.net/db/migrations/20260120000000_create_tbm_system.js
- api.hyungi.net/db/migrations/20260120000001_add_tbm_page.js
- api.hyungi.net/models/tbmModel.js
- api.hyungi.net/models/pageAccessModel.js
- api.hyungi.net/controllers/tbmController.js
- api.hyungi.net/controllers/pageAccessController.js
- api.hyungi.net/routes/tbmRoutes.js
- web-ui/pages/work/tbm.html
- web-ui/pages/admin/page-access.html
- web-ui/js/page-access-management.js
- docs/TBM_DEPLOYMENT_GUIDE.md
### 수정 파일
- api.hyungi.net/config/routes.js (TBM 라우트 추가)
- web-ui/js/load-navbar.js (role 매칭 버그 수정)
- web-ui/pages/admin/workers.html (HTML 구조 수정)
- web-ui/pages/dashboard.html (이모지 제거)
- web-ui/css/design-system.css (색상 팔레트 추가)
- web-ui/css/modern-dashboard.css (가독성 개선)
- web-ui/js/modern-dashboard.js (SVG 아이콘 적용)
## 배포 시 주의사항
⚠️ 본 서버 배포 시 반드시 마이그레이션 실행 필요:
```bash
npm run db:migrate
```
상세한 배포 절차는 docs/TBM_DEPLOYMENT_GUIDE.md 참조
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- fix: 로그인 API에서 user.role_name 필드 올바르게 사용 (auth.service.js)
- refactor: navbar 컴포넌트를 최신 dashboard-header 스타일로 전환
- refactor: 구버전 work-report-header 제거 (6개 페이지)
- refactor: load-navbar.js를 최신 헤더 구조에 맞게 업데이트
- style: 파란색 그라데이션 헤더, 실시간 시계, 향상된 프로필 메뉴
- docs: 2026-01-20 개발 로그 추가
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
작업 보고서 표시 여부 대신 계정 연동 기능으로 개선했습니다.
## 주요 변경사항
### 개념 변경
- **이전**: 작업 보고서 표시 여부 (show_in_work_reports)
- **이후**: 계정 생성/연동 기능
### 데이터베이스
- **마이그레이션**: 20260119095549_add_worker_display_fields.js
- show_in_work_reports 컬럼 제거
- employment_status만 유지 (employed/resigned)
- **workerModel**:
- getAll, getById에서 users 테이블 JOIN하여 user_id 조회
- create, update에서 show_in_work_reports 필드 제거
### 백엔드 API
- **workerController.js**:
- createWorker: create_account 체크 시 자동으로 users 테이블에 계정 생성
- username: hangulToRoman으로 한글 이름 변환
- password: 초기 비밀번호 '1234' (bcrypt 해시)
- role: User 역할 자동 할당
- updateWorker:
- create_account=true & 계정 없음 → 계정 생성
- create_account=false & 계정 있음 → 계정 연동 해제 (users.worker_id=NULL)
### 프론트엔드
- **worker-management.html**:
- "작업 보고서 표시" → "🔐 계정 생성/연동"으로 변경
- 체크 시 로그인 계정 자동 생성 안내
- **worker-management.js**:
- 카드 렌더링: user_id 존재 여부로 계정 연동 상태 표시 (🔐 아이콘)
- saveWorker: create_account 필드 전송
- show_in_work_reports 관련 로직 모두 제거
- **daily-work-report.js**:
- 필터링 조건 단순화: 퇴사자만 제외 (employment_status≠resigned)
- 계정 여부와 무관하게 모든 재직자 표시
## 사용 방법
1. 작업자 등록/수정 시 "계정 생성/연동" 체크
2. 자동으로 로그인 계정 생성 (초기 비밀번호: 1234)
3. 계정이 있는 작업자는 나의 대시보드, 연차/출퇴근 관리 가능
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
작업자 관리 페이지에 3가지 상태 관리 기능을 추가했습니다:
1. 작업 보고서 표시 여부 (관리자 등은 작업보고서에 표시 안함)
2. 현장직/사무직 구분 (사무직은 출퇴근 관리 불필요)
3. 퇴사 처리 (퇴사자 별도 표시)
## 주요 변경사항
### 데이터베이스
- **마이그레이션**: 20260119095549_add_worker_display_fields.js
- workers 테이블에 show_in_work_reports (BOOLEAN) 추가
- workers 테이블에 employment_status (ENUM: employed, resigned) 추가
### 백엔드
- **workerModel.js**: create, update 함수에 새로운 필드 처리 로직 추가
### 프론트엔드
- **worker-management.html**: 작업자 모달에 3가지 체크박스 추가
- 작업 보고서에 표시
- 현장직 (활성화) - 사무직과 구분
- 퇴사 처리
- **worker-management.js**:
- 퇴사자 카드 렌더링 시 별도 스타일 적용
- 새 필드 값 로드 및 저장 처리
- **daily-work-report.js**:
- 작업 보고서 작성 시 show_in_work_reports=true이고 퇴사하지 않은 작업자만 표시
## 배포 절차
```bash
cd api.hyungi.net
npm run db:migrate
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
모든 작업자가 개인 계정으로 로그인하여 본인의 연차와 출근 기록을 확인할 수 있는 시스템을 구축했습니다.
주요 기능:
- 작업자-계정 1:1 통합 (기존 작업자 자동 계정 생성)
- 연차 관리 시스템 (연도별 잔액 관리)
- 출근 기록 시스템 (일일 근태 기록)
- 나의 대시보드 페이지 (개인 정보 조회)
데이터베이스:
- workers 테이블에 salary, base_annual_leave 컬럼 추가
- work_attendance_types, vacation_types 테이블 생성
- daily_attendance_records 테이블 생성
- worker_vacation_balance 테이블 생성
- 기존 작업자 자동 계정 생성 (username: 이름 기반)
- Guest 역할 추가
백엔드 API:
- 한글→영문 변환 유틸리티 (hangulToRoman.js)
- UserRoutes에 개인 정보 조회 API 추가
- GET /api/users/me (내 정보)
- GET /api/users/me/attendance-records (출근 기록)
- GET /api/users/me/vacation-balance (연차 잔액)
- GET /api/users/me/work-reports (작업 보고서)
- GET /api/users/me/monthly-stats (월별 통계)
프론트엔드:
- 나의 대시보드 페이지 (my-dashboard.html)
- 연차 정보 위젯 (총/사용/잔여)
- 월별 출근 캘린더
- 근무 시간 통계
- 최근 작업 보고서 목록
- 네비게이션 바에 "나의 대시보드" 메뉴 추가
배포 시 주의사항:
- 마이그레이션 실행 필요
- 자동 생성된 계정 초기 비밀번호: 1234
- 작업자들에게 첫 로그인 후 비밀번호 변경 안내 필요
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Replaced `SELECT *` statements across multiple data models with explicit column lists to improve query performance, reduce data transfer, and increase code clarity. This is part of the Phase 2 refactoring plan.
- Refactored queries in the following models:
- projectModel
- toolsModel
- attendanceModel
- dailyIssueReportModel
- issueTypeModel
- workReportModel
- userModel
- dailyWorkReportModel
fix(api): Add missing volume mounts to docker-compose
Modified docker-compose.yml to mount the `config`, `middlewares`, `utils`, and `services` directories into the API container. This fixes a `MODULE_NOT_FOUND` error that caused the container to crash on startup.
feat(db): Add migration for missing project columns
Created a new database migration to add `is_active`, `project_status`, and `completed_date` columns to the `projects` table, resolving an inconsistency between the model code and the schema.
docs: Add deployment notes
Added a new markdown file to document the testing (macOS, Docker Desktop) and production (Synology NAS, Container Manager) environments.
- Adds knex.js to manage database schema changes systematically.
- Creates an initial migration file based on `hyungi_schema_v2.sql` to represent the current database state.
- Adds npm scripts (`db:migrate`, `db:rollback`, etc.) for easy execution of migration tasks.
- Archives legacy SQL files and old migration scripts into the `db_archive/` directory to prevent confusion and clean up the project structure.