From 1ad95ff7e87e09b673c1793a088ed1841fc0a25d Mon Sep 17 00:00:00 2001 From: ttipo Date: Tue, 23 Jun 2026 11:47:13 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EC=9D=BC=EC=A0=95=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8(=EC=8B=9C=EB=93=9C)=20=EC=B9=B4=ED=85=8C=EA=B3=A0?= =?UTF-8?q?=EB=A6=AC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기본 카테고리 12종 onModuleInit 시드를 삭제 — 카테고리는 사용자가 직접 추가한다. (dev DB 의 기존 시드 카테고리/일정은 별도로 정리) Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/modules/schedule/schedule.service.ts | 43 ++----------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/backend/src/modules/schedule/schedule.service.ts b/backend/src/modules/schedule/schedule.service.ts index 3f41b5e..3a1d8cf 100644 --- a/backend/src/modules/schedule/schedule.service.ts +++ b/backend/src/modules/schedule/schedule.service.ts @@ -1,9 +1,4 @@ -import { - Injectable, - Logger, - NotFoundException, - type OnModuleInit, -} from '@nestjs/common'; +import { Injectable, NotFoundException } from '@nestjs/common'; import { InjectRepository } from '@nestjs/typeorm'; import { LessThanOrEqual, MoreThanOrEqual, Repository } from 'typeorm'; import { User } from '../user/entities/user.entity'; @@ -41,27 +36,10 @@ export interface ScheduleEventResponse { createdById: string | null; } -// 기본 카테고리 시드 — 최초 1회만 적재(테이블 비어있을 때). label/color/순서. -const DEFAULT_CATEGORIES: { label: string; color: string }[] = [ - { label: '회의', color: '#1d4ed8' }, - { label: '외부 미팅', color: '#0284c7' }, - { label: '채용·면접', color: '#be185d' }, - { label: '사내 행사', color: '#4f46e5' }, - { label: '교육·세미나', color: '#1f9d57' }, - { label: '휴가·부재', color: '#b7791f' }, - { label: '회식·모임', color: '#9333ea' }, - { label: '마감·릴리스', color: '#dc2626' }, - { label: '리뷰·QA', color: '#0d9488' }, - { label: '재무·결산', color: '#475569' }, - { label: '홍보·PR', color: '#ea580c' }, - { label: '기타', color: '#0e9594' }, -]; - // 일정(전사 공유 캘린더) 비즈니스 로직 — 카테고리/일정 CRUD + 참석자 매핑. +// (기본 카테고리 시드 없음 — 카테고리는 사용자가 직접 추가한다) @Injectable() -export class ScheduleService implements OnModuleInit { - private readonly logger = new Logger(ScheduleService.name); - +export class ScheduleService { constructor( @InjectRepository(ScheduleCategory) private readonly categoryRepo: Repository, @@ -70,21 +48,6 @@ export class ScheduleService implements OnModuleInit { private readonly userService: UserService, ) {} - // 기동 시 기본 카테고리 시드(멱등) — 비어있을 때만 적재. dev/prod 공통. - async onModuleInit(): Promise { - const count = await this.categoryRepo.count(); - if (count > 0) return; - const rows = DEFAULT_CATEGORIES.map((c, i) => - this.categoryRepo.create({ - label: c.label, - color: c.color, - sortOrder: i, - }), - ); - await this.categoryRepo.save(rows); - this.logger.log(`기본 일정 카테고리 ${rows.length}건 시드`); - } - // ----- 카테고리 ----- async listCategories(): Promise {