feat: [roadmap] 중장기 계획 메뉴 및 전용 페이지 개발
- 모델: AdminRoadmapPlan, AdminRoadmapMilestone
- 서비스: RoadmapPlanService, RoadmapMilestoneService
- FormRequest: Store/Update Plan/Milestone 4개
- 컨트롤러: Blade(RoadmapController), API(Plan/Milestone) 3개
- 라우트: web.php, api.php에 roadmap 라우트 추가
- Blade 뷰: 대시보드, 목록, 생성, 수정, 상세, 파셜 테이블 6개
- HTMX 기반 필터링/페이지네이션, 마일스톤 인라인 추가/토글
2026-03-02 15:50:20 +09:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models\Admin;
|
|
|
|
|
|
|
|
|
|
use App\Models\User;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
|
|
|
|
|
|
|
|
class AdminRoadmapMilestone extends Model
|
|
|
|
|
{
|
|
|
|
|
use SoftDeletes;
|
|
|
|
|
|
feat: [database] codebridge DB 분리 - 118개 MNG 전용 테이블 connection 설정
- config/database.php에 codebridge connection 추가
- 78개 MNG 전용 모델에 $connection = 'codebridge' 설정
- Admin (15): PM, 로드맵, API Explorer
- Sales (16): 영업파트너, 수수료, 가망고객
- Finance (9): 법인카드, 자금관리, 홈택스
- Barobill (12): 은행/카드 동기화 관리
- Interview (1), ESign (6), Equipment (2)
- AI (3), Audit (3), 기타 (11)
2026-03-07 11:27:18 +09:00
|
|
|
protected $connection = 'codebridge';
|
feat: [roadmap] 중장기 계획 메뉴 및 전용 페이지 개발
- 모델: AdminRoadmapPlan, AdminRoadmapMilestone
- 서비스: RoadmapPlanService, RoadmapMilestoneService
- FormRequest: Store/Update Plan/Milestone 4개
- 컨트롤러: Blade(RoadmapController), API(Plan/Milestone) 3개
- 라우트: web.php, api.php에 roadmap 라우트 추가
- Blade 뷰: 대시보드, 목록, 생성, 수정, 상세, 파셜 테이블 6개
- HTMX 기반 필터링/페이지네이션, 마일스톤 인라인 추가/토글
2026-03-02 15:50:20 +09:00
|
|
|
protected $table = 'admin_roadmap_milestones';
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'plan_id',
|
|
|
|
|
'title',
|
|
|
|
|
'description',
|
|
|
|
|
'status',
|
|
|
|
|
'due_date',
|
|
|
|
|
'completed_at',
|
|
|
|
|
'assignee_id',
|
|
|
|
|
'sort_order',
|
|
|
|
|
'created_by',
|
|
|
|
|
'updated_by',
|
|
|
|
|
'deleted_by',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'plan_id' => 'integer',
|
|
|
|
|
'due_date' => 'date',
|
|
|
|
|
'completed_at' => 'datetime',
|
|
|
|
|
'assignee_id' => 'integer',
|
|
|
|
|
'sort_order' => 'integer',
|
|
|
|
|
'created_by' => 'integer',
|
|
|
|
|
'updated_by' => 'integer',
|
|
|
|
|
'deleted_by' => 'integer',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
public const STATUS_PENDING = 'pending';
|
|
|
|
|
|
|
|
|
|
public const STATUS_COMPLETED = 'completed';
|
|
|
|
|
|
|
|
|
|
public static function getStatuses(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
self::STATUS_PENDING => '진행중',
|
|
|
|
|
self::STATUS_COMPLETED => '완료',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function plan(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(AdminRoadmapPlan::class, 'plan_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function assignee(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(User::class, 'assignee_id');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function creator(): BelongsTo
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getStatusLabelAttribute(): string
|
|
|
|
|
{
|
|
|
|
|
return self::getStatuses()[$this->status] ?? $this->status;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getIsCompletedAttribute(): bool
|
|
|
|
|
{
|
|
|
|
|
return $this->status === self::STATUS_COMPLETED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getDdayAttribute(): ?int
|
|
|
|
|
{
|
|
|
|
|
if (! $this->due_date) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return now()->startOfDay()->diffInDays($this->due_date, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getDueStatusAttribute(): ?string
|
|
|
|
|
{
|
|
|
|
|
if (! $this->due_date || $this->status === self::STATUS_COMPLETED) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
$dday = $this->dday;
|
|
|
|
|
if ($dday < 0) {
|
|
|
|
|
return 'overdue';
|
|
|
|
|
}
|
|
|
|
|
if ($dday <= 7) {
|
|
|
|
|
return 'due_soon';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 'normal';
|
|
|
|
|
}
|
|
|
|
|
}
|