Guardian 확장
📝 초안 (Draft)
이 문서는 검토 중입니다. 내용이 변경될 수 있습니다.
보호자-피보호자 관계를 관리하는 Core Extension입니다.
개요
Guardian 확장은 교육(LMS), 의료, 금융 분야에서 미성년자/환자/피보호자 관리에 활용됩니다. 보호자(Guardian)와 피보호자(Ward) 간의 관계를 생성, 승인, 관리하며, 권한 카테고리별로 접근을 제어합니다.
┌─────────────────────────────────────────────────────────────┐
│ Guardian Extension │
│ │
│ ┌─────────────┐ 요청 ┌─────────────┐ │
│ │ Guardian │ ─────────► │ Ward │ │
│ │ (보호자) │ │ (피보호자) │ │
│ └─────────────┘ └─────────────┘ │
│ │ │ │
│ │ 승인/거절 │ │
│ ◄────────────────────────── │
│ │
│ 상태: pending → approved/rejected → expired │
│ 권한: academic, financial, medical, activity, communication │
└───── ────────────────────────────────────────────────────────┘
활성화
Guardian은 선택적 확장 모듈로, 필요한 프로젝트에서만 활성화합니다.
# .env
CORE_GUARDIAN_ENABLED=true
// config/core.php
'guardian' => [
'enabled' => env('CORE_GUARDIAN_ENABLED', false),
'auto_expire_days' => 365, // 자동 만료 기간 (null = 무기한)
],
구조
packages/core/Extensions/Guardian/
├── Contracts/
│ ├── GuardianInterface.php # Guardian 역할 인터페이스
│ ├── WardInterface.php # Ward(피보호자) 역할 인터페이스
│ └── GuardianServiceInterface.php # 서비스 인터페이스
├── Enums/
│ ├── RelationshipType.php # parent, teacher, mentor, observer
│ ├── RelationshipStatus.php # pending, approved, rejected, expired
│ └── PermissionCategory.php # academic, financial, medical, ...
├── Models/
│ └── GuardianRelationship.php # Eloquent 모델
├── Services/
│ └── GuardianService.php # 비즈니스 로직
├── Traits/
│ ├── HasGuardians.php # Ward에 적용 (피보호자)
│ └── IsGuardian.php # Guardian에 적용 (보호자)
├── Events/
│ ├── RelationshipRequested.php
│ ├── RelationshipApproved.php
│ ├── RelationshipRejected.php
│ └── RelationshipExpired.php
└── Providers/
└── GuardianServiceProvider.php