feat: 대시보드 API 및 FCM 푸시 알림 API 구현
Dashboard API: - DashboardController, DashboardService 추가 - /dashboard/summary, /charts, /approvals 엔드포인트 Push Notification API: - FCM 토큰 관리 (등록/해제/목록) - 알림 설정 관리 (유형별 on/off, 알림음 설정) - 알림 유형: deposit, withdrawal, order, approval, attendance, notice, system - 알림음: default, deposit, withdrawal, order, approval, urgent - PushDeviceToken, PushNotificationSetting 모델 - Swagger 문서 추가
This commit is contained in:
45
app/Http/Requests/Push/UpdateSettingsRequest.php
Normal file
45
app/Http/Requests/Push/UpdateSettingsRequest.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Push;
|
||||
|
||||
use App\Models\PushNotificationSetting;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateSettingsRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'settings' => ['required', 'array'],
|
||||
'settings.*.notification_type' => [
|
||||
'required',
|
||||
'string',
|
||||
Rule::in(PushNotificationSetting::getAllTypes()),
|
||||
],
|
||||
'settings.*.is_enabled' => ['required', 'boolean'],
|
||||
'settings.*.sound' => [
|
||||
'nullable',
|
||||
'string',
|
||||
Rule::in(PushNotificationSetting::getAllSounds()),
|
||||
],
|
||||
'settings.*.vibrate' => ['nullable', 'boolean'],
|
||||
'settings.*.show_preview' => ['nullable', 'boolean'],
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'settings.required' => __('error.push.settings_required'),
|
||||
'settings.*.notification_type.required' => __('error.push.type_required'),
|
||||
'settings.*.notification_type.in' => __('error.push.type_invalid'),
|
||||
'settings.*.is_enabled.required' => __('error.push.enabled_required'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user