2025-08-20 15:26:05 +08:00
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Validation\Rule;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Schema(
|
|
|
|
|
* schema="OrderSongRequest",
|
|
|
|
|
* required={"song_id","status","api_token"},
|
|
|
|
|
* @OA\Property(property="song_id", type="integer", example=1),
|
|
|
|
|
* @OA\Property(property="status", type="string", enum={"NotPlayed", "InsertPlayback", "Skipped"},example="NotPlayed"),
|
|
|
|
|
* @OA\Property(property="from_by", type="string", example="介面,ERP之類的說明"),
|
|
|
|
|
* @OA\Property(property="api_token", type="string", example="da9cdb88a60a377bba9fc53f09dd07838eb6f4f355d63f4927c711e7aaae3104"),
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
class OrderSongRequest extends ApiRequest
|
|
|
|
|
{
|
|
|
|
|
public function rules(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
|
|
|
|
|
'api_token' => [
|
|
|
|
|
'required',
|
|
|
|
|
Rule::exists('room_sessions', 'api_token')
|
|
|
|
|
->where(fn ($q) => $q->whereIn('status', ['active', 'maintain']))
|
|
|
|
|
],
|
2025-08-21 18:20:37 +08:00
|
|
|
|
'song_id' => 'required|exists:song_library_cache,song_id',
|
2025-08-20 15:26:05 +08:00
|
|
|
|
'status' => 'required|in:NotPlayed,InsertPlayback,Skipped',
|
|
|
|
|
'from_by' => 'nullable',
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|