feat: 작업일정 기간 기반 + 프로젝트 연결
- partner_schedules: work_date → start_date/end_date 기간 기반으로 변경 - project_id 컬럼 추가 (projects 테이블 연결, 선택사항) - 프로젝트 조회 API 추가 (GET /projects/active) - 일정 조회 시 기간 겹침 조건으로 필터링 - 체크인 시 기간 내 검증 추가 - 프론트엔드: 시작일/종료일 입력 + 프로젝트 선택 드롭다운 - 마이그레이션 SQL 포함 (scripts/migration-schedule-daterange.sql) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
13
tkpurchase/api/controllers/projectController.js
Normal file
13
tkpurchase/api/controllers/projectController.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const projectModel = require('../models/projectModel');
|
||||
|
||||
async function getActive(req, res) {
|
||||
try {
|
||||
const rows = await projectModel.findActive();
|
||||
res.json({ success: true, data: rows });
|
||||
} catch (err) {
|
||||
console.error('Project getActive error:', err);
|
||||
res.status(500).json({ success: false, error: err.message });
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { getActive };
|
||||
Reference in New Issue
Block a user