PM_Console/backend/database/seeders/TaskSeeder.php

389 خطوط
19 KiB
PHP

<?php
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class TaskSeeder extends Seeder
{
public function run(): void
{
$users = DB::table('users')->pluck('id', 'email');
$projects = DB::table('projects')->pluck('id');
$now = now();
$tasks = [
// Project 1 - سامانه مدیریت منابع انسانی (8 tasks)
[
'title' => 'طراحی و پیاده‌سازی ماژول حضور و غیاب',
'description' => 'طراحی پایگاه داده و پیاده‌سازی API های مربوط به ثبت و مدیریت حضور و غیاب پرسنل',
'project_id' => $projects[0],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'high',
'status' => 'in_progress',
'start_date' => '2026-01-10',
'due_date' => '2026-03-15',
'estimated_time' => 320.00,
'actual_time' => 280.00,
'tags' => json_encode(['HR', 'API', 'attendance']),
'sort_order' => 1,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'پیاده‌سازی ماژول حقوق و دستمزد',
'description' => 'محاسبه خودکار حقوق، کسورات، مالیات و بیمه پرسنل بر اساس قوانین کار',
'project_id' => $projects[0],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'urgent',
'status' => 'todo',
'start_date' => '2026-03-16',
'due_date' => '2026-05-30',
'estimated_time' => 400.00,
'actual_time' => 0.00,
'tags' => json_encode(['HR', 'payroll', 'financial']),
'sort_order' => 2,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'طراحی داشبورد مدیریتی منابع انسانی',
'description' => 'طراحی و پیاده‌سازی داشبورد تحلیلی با نمودارهای حضور، غیاب و عملکرد پرسنل',
'project_id' => $projects[0],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'medium',
'status' => 'review',
'start_date' => '2026-02-01',
'due_date' => '2026-04-01',
'estimated_time' => 200.00,
'actual_time' => 180.00,
'tags' => json_encode(['dashboard', 'charts', 'analytics']),
'sort_order' => 3,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'مدیریت درخواست‌های مرخصی',
'description' => 'سیستم ثبت، تأیید و مدیریت درخواست‌های مرخصی با قابلیت تعریف انواع مرخصی',
'project_id' => $projects[0],
'assignee_id' => $users['observer@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'high',
'status' => 'done',
'start_date' => '2026-01-05',
'due_date' => '2026-02-20',
'estimated_time' => 180.00,
'actual_time' => 190.00,
'tags' => json_encode(['HR', 'leave', 'workflow']),
'sort_order' => 4,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'یکپارچه‌سازی با سامانه بانک اطلاعاتی',
'description' => 'اتصال و همگام‌سازی داده‌های پرسنلی با سامانه‌های موجود سازمان',
'project_id' => $projects[0],
'assignee_id' => null,
'reporter_id' => $users['manager@pm.com'],
'priority' => 'high',
'status' => 'waiting',
'start_date' => '2026-03-01',
'due_date' => '2026-04-15',
'estimated_time' => 160.00,
'actual_time' => 20.00,
'tags' => json_encode(['integration', 'API', 'database']),
'sort_order' => 5,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'گزارش‌گیری پیشرفته منابع انسانی',
'description' => 'ایجاد گزارشات سفارشی و آماری با قابلیت خروجی اکسل و PDF',
'project_id' => $projects[0],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'low',
'status' => 'todo',
'start_date' => '2026-05-01',
'due_date' => '2026-06-15',
'estimated_time' => 240.00,
'actual_time' => 0.00,
'tags' => json_encode(['reporting', 'excel', 'pdf']),
'sort_order' => 6,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'مدیریت ارزیابی عملکرد پرسنل',
'description' => 'طراحی فرم‌های ارزیابی و فرآیند بازخورد ۳۶۰ درجه',
'project_id' => $projects[0],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'medium',
'status' => 'todo',
'start_date' => '2026-04-01',
'due_date' => '2026-05-01',
'estimated_time' => 300.00,
'actual_time' => 0.00,
'tags' => json_encode(['HR', 'evaluation', '360']),
'sort_order' => 7,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'تست و استقرار نسخه اولیه',
'description' => 'انجام تست‌های یکپارچه‌سازی و استقرار در محیط آزمایشگاهی',
'project_id' => $projects[0],
'assignee_id' => $users['observer@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'high',
'status' => 'waiting',
'start_date' => '2026-06-01',
'due_date' => '2026-07-01',
'estimated_time' => 160.00,
'actual_time' => 0.00,
'tags' => json_encode(['testing', 'deployment', 'staging']),
'sort_order' => 8,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
// Project 2 - اپلیکیشن موبایل فروشگاهی (7 tasks)
[
'title' => 'طراحی صفحه اصلی اپلیکیشن',
'description' => 'طراحی رابط کاربری صفحه اصلی با نمایش محصولات پرطرفدار، دسته‌بندی‌ها و بنرهای تبلیغاتی',
'project_id' => $projects[1],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'high',
'status' => 'in_progress',
'start_date' => '2026-02-15',
'due_date' => '2026-03-20',
'estimated_time' => 200.00,
'actual_time' => 160.00,
'tags' => json_encode(['mobile', 'ui', 'home']),
'sort_order' => 1,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'پیاده‌سازی سبد خرید و پرداخت',
'description' => 'پیاده‌سازی سبد خرید، اعمال تخفیف و اتصال به درگاه پرداخت آنلاین',
'project_id' => $projects[1],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'urgent',
'status' => 'in_progress',
'start_date' => '2026-03-01',
'due_date' => '2026-04-30',
'estimated_time' => 350.00,
'actual_time' => 200.00,
'tags' => json_encode(['payment', 'cart', 'checkout']),
'sort_order' => 2,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'سیستم اعلان‌های هوشمند',
'description' => 'پیاده‌سازی اعلان‌های push برای تخفیف‌ها، وضعیت سفارش و پیشنهادات ویژه',
'project_id' => $projects[1],
'assignee_id' => null,
'reporter_id' => $users['manager@pm.com'],
'priority' => 'medium',
'status' => 'todo',
'start_date' => '2026-04-15',
'due_date' => '2026-06-01',
'estimated_time' => 250.00,
'actual_time' => 0.00,
'tags' => json_encode(['notification', 'push', 'firebase']),
'sort_order' => 3,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'مدیریت حساب کاربری و پروفایل',
'description' => 'صفحات ثبت‌نام، ورود، ویرایش پروفایل و مدیریت آدرس‌ها',
'project_id' => $projects[1],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'high',
'status' => 'review',
'start_date' => '2026-02-20',
'due_date' => '2026-03-25',
'estimated_time' => 180.00,
'actual_time' => 190.00,
'tags' => json_encode(['auth', 'profile', 'user']),
'sort_order' => 4,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'طراحی پنل مدیریت فروشگاه',
'description' => 'داشبورد مدیریت محصولات، سفارشات، مشتریان و گزارشات فروش',
'project_id' => $projects[1],
'assignee_id' => $users['observer@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'medium',
'status' => 'todo',
'start_date' => '2026-05-01',
'due_date' => '2026-07-01',
'estimated_time' => 400.00,
'actual_time' => 0.00,
'tags' => json_encode(['admin', 'dashboard', 'management']),
'sort_order' => 5,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'یکپارچه‌سازی با درگاه‌های پرداخت',
'description' => 'اتصال به درگاه‌های پرداخت زرین‌پال، ملت و سامان',
'project_id' => $projects[1],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'urgent',
'status' => 'waiting',
'start_date' => '2026-03-01',
'due_date' => '2026-03-30',
'estimated_time' => 200.00,
'actual_time' => 50.00,
'tags' => json_encode(['payment', 'gateway', 'integration']),
'sort_order' => 6,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'بهینه‌سازی عملکرد و کاهش مصرف باتری',
'description' => 'بهینه‌سازی درخواست‌های شبکه، کش کردن داده‌ها و کاهش مصرف منابع',
'project_id' => $projects[1],
'assignee_id' => null,
'reporter_id' => $users['manager@pm.com'],
'priority' => 'low',
'status' => 'todo',
'start_date' => '2026-07-01',
'due_date' => '2026-08-15',
'estimated_time' => 160.00,
'actual_time' => 0.00,
'tags' => json_encode(['performance', 'optimization', 'battery']),
'sort_order' => 7,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
// Project 3 - بازطراحی وبسایت شرکتی (5 tasks)
[
'title' => 'تحلیل و جمع‌آوری نیازمندی‌ها',
'description' => 'جلسات با کارفرما برای جمع‌آوری نیازمندی‌های دقیق و انتظارات از وبسایت جدید',
'project_id' => $projects[2],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'high',
'status' => 'in_progress',
'start_date' => '2026-05-01',
'due_date' => '2026-05-20',
'estimated_time' => 80.00,
'actual_time' => 60.00,
'tags' => json_encode(['analysis', 'requirements', 'meeting']),
'sort_order' => 1,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'طراحی وایرفریم و نمونه اولیه',
'description' => 'طراحی وایرفریم صفحات اصلی و نمونه اولیه قابل کلیک در Figma',
'project_id' => $projects[2],
'assignee_id' => $users['member@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'high',
'status' => 'todo',
'start_date' => '2026-05-21',
'due_date' => '2026-06-10',
'estimated_time' => 160.00,
'actual_time' => 0.00,
'tags' => json_encode(['design', 'wireframe', 'figma']),
'sort_order' => 2,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'پیاده‌سازی فرانت‌اند با ری‌اکت',
'description' => 'توسعه فرانت‌اند وبسایت با استفاده از React و Tailwind CSS',
'project_id' => $projects[2],
'assignee_id' => null,
'reporter_id' => $users['manager@pm.com'],
'priority' => 'medium',
'status' => 'todo',
'start_date' => '2026-06-11',
'due_date' => '2026-07-20',
'estimated_time' => 320.00,
'actual_time' => 0.00,
'tags' => json_encode(['frontend', 'react', 'tailwind']),
'sort_order' => 3,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'توسعه بک‌اند و مدیریت محتوا',
'description' => 'پیاده‌سازی پنل مدیریت محتوا و API های مورد نیاز',
'project_id' => $projects[2],
'assignee_id' => $users['observer@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'medium',
'status' => 'todo',
'start_date' => '2026-06-20',
'due_date' => '2026-07-25',
'estimated_time' => 240.00,
'actual_time' => 0.00,
'tags' => json_encode(['backend', 'CMS', 'API']),
'sort_order' => 4,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
[
'title' => 'بهینه‌سازی سئو و عملکرد',
'description' => 'بهینه‌سازی سرعت بارگذاری، سئوی فنی و دسترسی‌پذیری وبسایت',
'project_id' => $projects[2],
'assignee_id' => $users['observer@pm.com'],
'reporter_id' => $users['manager@pm.com'],
'priority' => 'low',
'status' => 'todo',
'start_date' => '2026-07-20',
'due_date' => '2026-08-05',
'estimated_time' => 100.00,
'actual_time' => 0.00,
'tags' => json_encode(['seo', 'performance', 'optimization']),
'sort_order' => 5,
'created_by' => $users['manager@pm.com'],
'created_at' => $now,
'updated_at' => $now,
],
];
foreach ($tasks as $task) {
DB::table('tasks')->insert($task);
}
}
}