v7.0.0-beta.2 release
This commit is contained in:
1 parent
6595fd0eb5
commit
fa8eba7a0d
1165 files changed
+107118
-762127
No files matched your search
@@ -1,52 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts\Repositories;
|
||||
|
||||
use App\Models\MailSendLog;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* 메일 발송 이력 리포지토리 인터페이스
|
||||
*/
|
||||
interface MailSendLogRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* 발송 이력을 생성합니다.
|
||||
*
|
||||
* @param array $data 생성 데이터
|
||||
* @return MailSendLog 생성된 발송 이력 모델
|
||||
*/
|
||||
public function create(array $data): MailSendLog;
|
||||
|
||||
/**
|
||||
* 발송 이력 목록을 페이지네이션하여 조회합니다.
|
||||
*
|
||||
* @param array $filters 필터 조건 (module, template_type, status, search, date_from, date_to)
|
||||
* @param int $perPage 페이지 당 항목 수
|
||||
* @return LengthAwarePaginator 페이지네이션 결과
|
||||
*/
|
||||
public function getPaginated(array $filters = [], int $perPage = 20): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* 발송 통계를 조회합니다.
|
||||
*
|
||||
* @return array{total: int, sent: int, failed: int, today: int} 통계 정보
|
||||
*/
|
||||
public function getStatistics(): array;
|
||||
|
||||
/**
|
||||
* 발송 이력을 삭제합니다.
|
||||
*
|
||||
* @param int $id 삭제할 발송 이력 ID
|
||||
* @return bool 삭제 성공 여부
|
||||
*/
|
||||
public function delete(int $id): bool;
|
||||
|
||||
/**
|
||||
* 여러 발송 이력을 일괄 삭제합니다.
|
||||
*
|
||||
* @param array<int> $ids 삭제할 발송 이력 ID 목록
|
||||
* @return int 삭제된 건수
|
||||
*/
|
||||
public function deleteMany(array $ids): int;
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts\Repositories;
|
||||
|
||||
use App\Models\MailTemplate;
|
||||
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
interface MailTemplateRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* ID로 메일 템플릿을 찾습니다.
|
||||
*
|
||||
* @param int $id 메일 템플릿 ID
|
||||
* @return MailTemplate|null 찾은 모델 또는 null
|
||||
*/
|
||||
public function findById(int $id): ?MailTemplate;
|
||||
|
||||
/**
|
||||
* 유형으로 메일 템플릿을 찾습니다.
|
||||
*
|
||||
* @param string $type 템플릿 유형
|
||||
* @return MailTemplate|null 찾은 모델 또는 null
|
||||
*/
|
||||
public function findByType(string $type): ?MailTemplate;
|
||||
|
||||
/**
|
||||
* 활성 상태인 특정 유형 템플릿을 찾습니다.
|
||||
*
|
||||
* @param string $type 템플릿 유형
|
||||
* @return MailTemplate|null 활성 템플릿 또는 null
|
||||
*/
|
||||
public function getActiveByType(string $type): ?MailTemplate;
|
||||
|
||||
/**
|
||||
* 모든 메일 템플릿 목록을 반환합니다.
|
||||
*
|
||||
* @return Collection 메일 템플릿 컬렉션
|
||||
*/
|
||||
public function getAllTemplates(): Collection;
|
||||
|
||||
/**
|
||||
* 메일 템플릿을 수정합니다.
|
||||
*
|
||||
* @param MailTemplate $template 수정 대상
|
||||
* @param array $data 수정 데이터
|
||||
* @return bool 수정 성공 여부
|
||||
*/
|
||||
public function update(MailTemplate $template, array $data): bool;
|
||||
|
||||
/**
|
||||
* 메일 템플릿 목록을 페이지네이션하여 조회합니다.
|
||||
*
|
||||
* @param array $filters 필터 조건
|
||||
* @param int $perPage 페이지 당 항목 수
|
||||
* @return LengthAwarePaginator 페이지네이션 결과
|
||||
*/
|
||||
public function getPaginated(array $filters = [], int $perPage = 20): LengthAwarePaginator;
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts\Repositories;
|
||||
|
||||
use App\Models\NotificationDefinition;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
interface NotificationDefinitionRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* ID로 알림 정의 조회.
|
||||
*
|
||||
* @param int $id
|
||||
* @return NotificationDefinition|null
|
||||
*/
|
||||
public function findById(int $id): ?NotificationDefinition;
|
||||
|
||||
/**
|
||||
* 타입으로 알림 정의 조회.
|
||||
*
|
||||
* @param string $type
|
||||
* @return NotificationDefinition|null
|
||||
*/
|
||||
public function findByType(string $type): ?NotificationDefinition;
|
||||
|
||||
/**
|
||||
* 활성 상태인 특정 타입 알림 정의 조회.
|
||||
*
|
||||
* @param string $type
|
||||
* @return NotificationDefinition|null
|
||||
*/
|
||||
public function getActiveByType(string $type): ?NotificationDefinition;
|
||||
|
||||
/**
|
||||
* 모든 활성 알림 정의 조회.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAllActive(): Collection;
|
||||
|
||||
/**
|
||||
* 활성 알림 정의의 로케일별 라벨 맵을 반환합니다.
|
||||
*
|
||||
* 키: type 식별자, 값: 해당 로케일의 다국어 라벨 (fallback: ko → en → 식별자)
|
||||
* 알림 목록 응답에서 N+1 회피 목적으로 사용됩니다.
|
||||
*
|
||||
* @param string|null $locale 사용자 로케일 (null이면 app locale)
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public function getLabelMap(?string $locale = null): array;
|
||||
|
||||
/**
|
||||
* 전체 알림 정의 목록 조회.
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAll(): Collection;
|
||||
|
||||
/**
|
||||
* 특정 확장의 알림 정의 목록 조회.
|
||||
*
|
||||
* @param string $extensionType
|
||||
* @param string $extensionIdentifier
|
||||
* @return Collection
|
||||
*/
|
||||
public function getByExtension(string $extensionType, string $extensionIdentifier): Collection;
|
||||
|
||||
/**
|
||||
* 알림 정의 수정.
|
||||
*
|
||||
* @param NotificationDefinition $definition
|
||||
* @param array $data
|
||||
* @return NotificationDefinition
|
||||
*/
|
||||
public function update(NotificationDefinition $definition, array $data): NotificationDefinition;
|
||||
|
||||
/**
|
||||
* 페이지네이션 목록 조회.
|
||||
*
|
||||
* @param array $filters
|
||||
* @param int $perPage
|
||||
* @return LengthAwarePaginator
|
||||
*/
|
||||
public function getPaginated(array $filters = [], int $perPage = 20): LengthAwarePaginator;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts\Repositories;
|
||||
|
||||
use App\Models\NotificationLog;
|
||||
use App\Models\User;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
interface NotificationLogRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* ID로 알림 로그 조회.
|
||||
*/
|
||||
public function findById(int $id): ?NotificationLog;
|
||||
|
||||
/**
|
||||
* 알림 로그 생성.
|
||||
*/
|
||||
public function create(array $data): NotificationLog;
|
||||
|
||||
/**
|
||||
* 알림 로그 삭제.
|
||||
*/
|
||||
public function delete(NotificationLog $log): bool;
|
||||
|
||||
/**
|
||||
* 다건 삭제.
|
||||
*
|
||||
* @return int 삭제된 건수
|
||||
*/
|
||||
public function bulkDelete(array $ids): int;
|
||||
|
||||
/**
|
||||
* 페이지네이션 목록 조회.
|
||||
*
|
||||
* @param User|null $scopeUser 스코프 적용 대상 사용자 (null이면 스코프 미적용)
|
||||
*/
|
||||
public function getPaginated(array $filters = [], int $perPage = 20, ?User $scopeUser = null): LengthAwarePaginator;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts\Repositories;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Notifications\DatabaseNotification;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
interface NotificationRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* 사용자의 알림 목록을 페이지네이션으로 조회합니다.
|
||||
*/
|
||||
public function getByUser(User $user, array $filters = [], int $perPage = 20): LengthAwarePaginator;
|
||||
|
||||
/**
|
||||
* 사용자의 미읽음 알림 수를 반환합니다.
|
||||
*/
|
||||
public function getUnreadCount(User $user): int;
|
||||
|
||||
/**
|
||||
* 특정 알림을 읽음 처리합니다.
|
||||
*/
|
||||
public function markAsRead(User $user, string $notificationId): ?DatabaseNotification;
|
||||
|
||||
/**
|
||||
* 지정된 알림들을 일괄 읽음 처리합니다.
|
||||
*
|
||||
* @return int 읽음 처리된 건수
|
||||
*/
|
||||
public function markBatchAsRead(User $user, array $ids): int;
|
||||
|
||||
/**
|
||||
* 사용자의 모든 미읽음 알림을 읽음 처리합니다.
|
||||
*
|
||||
* @return int 읽음 처리된 건수
|
||||
*/
|
||||
public function markAllAsRead(User $user): int;
|
||||
|
||||
/**
|
||||
* 알림을 삭제합니다.
|
||||
*/
|
||||
public function delete(User $user, string $notificationId): bool;
|
||||
|
||||
/**
|
||||
* 사용자의 모든 알림을 삭제합니다.
|
||||
*
|
||||
* @return int 삭제된 알림 수
|
||||
*/
|
||||
public function deleteAll(User $user): int;
|
||||
|
||||
/**
|
||||
* 오래된 알림을 정리합니다.
|
||||
*
|
||||
* @return array{deleted_read: int, deleted_unread: int}
|
||||
*/
|
||||
public function cleanup(int $readRetentionDays, int $unreadRetentionDays): array;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Contracts\Repositories;
|
||||
|
||||
use App\Models\NotificationTemplate;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
|
||||
interface NotificationTemplateRepositoryInterface
|
||||
{
|
||||
/**
|
||||
* ID로 알림 템플릿 조회.
|
||||
*
|
||||
* @param int $id
|
||||
* @return NotificationTemplate|null
|
||||
*/
|
||||
public function findById(int $id): ?NotificationTemplate;
|
||||
|
||||
/**
|
||||
* 알림 정의 ID + 채널로 템플릿 조회.
|
||||
*
|
||||
* @param int $definitionId
|
||||
* @param string $channel
|
||||
* @return NotificationTemplate|null
|
||||
*/
|
||||
public function findByDefinitionAndChannel(int $definitionId, string $channel): ?NotificationTemplate;
|
||||
|
||||
/**
|
||||
* 알림 타입 + 채널로 활성 템플릿 조회.
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $channel
|
||||
* @return NotificationTemplate|null
|
||||
*/
|
||||
public function getActiveByTypeAndChannel(string $type, string $channel): ?NotificationTemplate;
|
||||
|
||||
/**
|
||||
* 특정 알림 정의의 모든 템플릿 조회.
|
||||
*
|
||||
* @param int $definitionId
|
||||
* @return Collection
|
||||
*/
|
||||
public function getByDefinitionId(int $definitionId): Collection;
|
||||
|
||||
/**
|
||||
* 템플릿 수정.
|
||||
*
|
||||
* @param NotificationTemplate $template
|
||||
* @param array $data
|
||||
* @return NotificationTemplate
|
||||
*/
|
||||
public function update(NotificationTemplate $template, array $data): NotificationTemplate;
|
||||
|
||||
/**
|
||||
* 템플릿 생성 또는 수정.
|
||||
*
|
||||
* @param array $attributes
|
||||
* @param array $values
|
||||
* @return NotificationTemplate
|
||||
*/
|
||||
public function updateOrCreate(array $attributes, array $values): NotificationTemplate;
|
||||
}
|
||||
@@ -83,6 +83,17 @@ interface RoleRepositoryInterface
|
||||
*/
|
||||
public function findExtensionRoleByIdentifier(string $identifier, ExtensionOwnerType $extensionType, string $extensionIdentifier): ?Role;
|
||||
|
||||
/**
|
||||
* 확장이 소유한 모든 역할을 조회합니다.
|
||||
*
|
||||
* stale cleanup 진입점에서 현재 DB 에 존재하는 확장 역할 전체를 얻기 위해 사용.
|
||||
*
|
||||
* @param ExtensionOwnerType $extensionType 확장 타입
|
||||
* @param string $extensionIdentifier 확장 식별자
|
||||
* @return Collection 해당 확장 소유 역할 컬렉션
|
||||
*/
|
||||
public function getByExtension(ExtensionOwnerType $extensionType, string $extensionIdentifier): Collection;
|
||||
|
||||
/**
|
||||
* 역할에 권한을 할당합니다.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user