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/models/projectModel.js
Normal file
13
tkpurchase/api/models/projectModel.js
Normal file
@@ -0,0 +1,13 @@
|
||||
const { getPool } = require('./partnerModel');
|
||||
|
||||
async function findActive() {
|
||||
const db = getPool();
|
||||
const [rows] = await db.query(
|
||||
`SELECT project_id, job_no, project_name, site
|
||||
FROM projects
|
||||
WHERE is_active = 1 AND project_status = 'active'
|
||||
ORDER BY project_name`);
|
||||
return rows;
|
||||
}
|
||||
|
||||
module.exports = { findActive };
|
||||
Reference in New Issue
Block a user