Files
sam-api/database/seeders/Dummy/DummyPopupSeeder.php
hskwon 8686b199ee feat: 더미 데이터 시더 추가 및 회계 관련 마이그레이션
- DummyDataSeeder 및 개별 시더 추가 (Client, BadDebt, Deposit 등)
- payments.paid_at nullable 마이그레이션
- subscriptions 취소 컬럼 추가
- clients 테이블 bad_debt 컬럼 제거
- PlanController, ClientService 수정
- 불필요한 claudedocs, flow-test 파일 정리
2025-12-24 08:54:52 +09:00

107 lines
5.2 KiB
PHP

<?php
namespace Database\Seeders\Dummy;
use App\Models\Popups\Popup;
use Database\Seeders\DummyDataSeeder;
use Illuminate\Database\Seeder;
class DummyPopupSeeder extends Seeder
{
public function run(): void
{
$tenantId = DummyDataSeeder::TENANT_ID;
$userId = DummyDataSeeder::USER_ID;
$popups = [
[
'target_type' => 'all',
'target_id' => null,
'title' => '시스템 점검 안내',
'content' => '<p>안녕하세요.</p><p>2025년 1월 15일(수) 02:00 ~ 06:00 동안 시스템 점검이 예정되어 있습니다.</p><p>점검 시간 동안 서비스 이용이 제한될 수 있으니 양해 부탁드립니다.</p>',
'status' => 'active',
'started_at' => now()->subDays(5),
'ended_at' => now()->addDays(10),
],
[
'target_type' => 'all',
'target_id' => null,
'title' => '신규 기능 업데이트 안내',
'content' => '<p>새로운 기능이 추가되었습니다!</p><ul><li>대시보드 개선</li><li>보고서 내보내기 기능</li><li>알림 설정 강화</li></ul><p>자세한 내용은 도움말을 확인해 주세요.</p>',
'status' => 'active',
'started_at' => now()->subDays(3),
'ended_at' => now()->addDays(30),
],
[
'target_type' => 'all',
'target_id' => null,
'title' => '연말 휴무 안내',
'content' => '<p>2024년 연말 휴무 일정을 안내드립니다.</p><p><strong>휴무 기간</strong>: 12월 30일(월) ~ 1월 1일(수)</p><p>새해 복 많이 받으세요!</p>',
'status' => 'inactive',
'started_at' => now()->subMonth(),
'ended_at' => now()->subDays(20),
],
[
'target_type' => 'department',
'target_id' => 1,
'title' => '부서 회의 안내',
'content' => '<p>이번 주 금요일 오후 2시에 정기 회의가 있습니다.</p><p><strong>장소</strong>: 3층 회의실</p><p><strong>안건</strong>: 1분기 실적 검토</p>',
'status' => 'active',
'started_at' => now(),
'ended_at' => now()->addDays(7),
],
[
'target_type' => 'all',
'target_id' => null,
'title' => '보안 업데이트 필수 안내',
'content' => '<p><strong>중요!</strong></p><p>보안 강화를 위해 비밀번호 변경이 필요합니다.</p><p>최근 3개월 이내 비밀번호를 변경하지 않으신 분은 마이페이지에서 변경해 주세요.</p>',
'status' => 'active',
'started_at' => now()->subDays(1),
'ended_at' => now()->addDays(14),
],
[
'target_type' => 'all',
'target_id' => null,
'title' => '서비스 이용약관 변경 안내',
'content' => '<p>서비스 이용약관이 2025년 2월 1일부터 변경됩니다.</p><p>주요 변경 사항:</p><ul><li>개인정보 처리방침 개정</li><li>서비스 이용 조건 명확화</li></ul><p>변경된 약관은 공지사항에서 확인하실 수 있습니다.</p>',
'status' => 'active',
'started_at' => now(),
'ended_at' => now()->addDays(45),
],
[
'target_type' => 'department',
'target_id' => 2,
'title' => '영업팀 워크샵 안내',
'content' => '<p>영업팀 상반기 워크샵이 예정되어 있습니다.</p><p><strong>일시</strong>: 2025년 2월 15일(토)</p><p><strong>장소</strong>: 추후 공지</p><p>많은 참여 바랍니다!</p>',
'status' => 'active',
'started_at' => now()->addDays(5),
'ended_at' => now()->addDays(50),
],
[
'target_type' => 'all',
'target_id' => null,
'title' => '모바일 앱 출시 안내',
'content' => '<p>SAM 모바일 앱이 출시되었습니다!</p><p>앱스토어와 구글플레이에서 "SAM"을 검색해 주세요.</p><p>모바일에서도 편리하게 업무를 처리하세요.</p>',
'status' => 'inactive',
'started_at' => now()->subMonths(2),
'ended_at' => now()->subMonth(),
],
];
foreach ($popups as $popup) {
Popup::create([
'tenant_id' => $tenantId,
'target_type' => $popup['target_type'],
'target_id' => $popup['target_id'],
'title' => $popup['title'],
'content' => $popup['content'],
'status' => $popup['status'],
'started_at' => $popup['started_at'],
'ended_at' => $popup['ended_at'],
'created_by' => $userId,
]);
}
$this->command->info(' ✓ popups: ' . count($popups) . '건 생성');
}
}