feat(SAM/API): 결재 시더를 DummyDataSeeder에 통합

- ApprovalTestDataSeeder: 테넌트 ID 동적 처리 (DummyDataSeeder.TENANT_ID)
- DummyDataSeeder: 결재 시더 호출 추가
- 결재 양식 3건, 결재 문서 20건, 결재선 ~40건 생성

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-29 15:41:46 +09:00
parent d1ed374acf
commit d7bfb3e5ae
2 changed files with 19 additions and 5 deletions

View File

@@ -16,11 +16,17 @@ class ApprovalTestDataSeeder extends Seeder
*/
public function run(): void
{
$tenantId = 1;
$tenantId = DummyDataSeeder::TENANT_ID;
$now = Carbon::now();
// 사용자 ID 가져오기
$users = DB::table('users')->pluck('id')->toArray();
$this->command->info('');
$this->command->info('📋 결재 데이터 생성...');
// 해당 테넌트의 사용자 ID 가져오기
$users = DB::table('user_tenants')
->where('tenant_id', $tenantId)
->pluck('user_id')
->toArray();
if (count($users) < 3) {
$this->command->error('최소 3명의 사용자가 필요합니다.');
return;

View File

@@ -55,7 +55,12 @@ public function run(): void
Dummy\DummySalarySeeder::class, // 급여
]);
// 4. 기타 데이터
// 4. 결재 데이터
$this->call([
ApprovalTestDataSeeder::class,
]);
// 5. 기타 데이터
$this->command->info('');
$this->command->info('📋 기타 데이터 생성...');
$this->call([
@@ -86,9 +91,12 @@ public function run(): void
['HR', 'leaves', '~50'],
['HR', 'cards', '5'],
['HR', 'salaries', '15'],
['결재', 'approval_forms', '3'],
['결재', 'approvals', '20'],
['결재', 'approval_steps', '~40'],
['기타', 'popups', '8'],
['기타', 'payments', '13'],
['', '총계', '~950'],
['', '총계', '~1,010'],
]
);
}