feat: implement AI styling foundation and billing scope rework
This commit is contained in:
26
app/Http/Requests/Api/GuestAiEditStoreRequest.php
Normal file
26
app/Http/Requests/Api/GuestAiEditStoreRequest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Api;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class GuestAiEditStoreRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'style_key' => ['nullable', 'string', 'max:120', 'required_without:prompt'],
|
||||
'prompt' => ['nullable', 'string', 'max:2000', 'required_without:style_key'],
|
||||
'negative_prompt' => ['nullable', 'string', 'max:2000'],
|
||||
'provider_model' => ['nullable', 'string', 'max:120'],
|
||||
'idempotency_key' => ['nullable', 'string', 'max:120'],
|
||||
'session_id' => ['nullable', 'string', 'max:191'],
|
||||
'metadata' => ['nullable', 'array'],
|
||||
];
|
||||
}
|
||||
}
|
||||
22
app/Http/Requests/Tenant/AiEditIndexRequest.php
Normal file
22
app/Http/Requests/Tenant/AiEditIndexRequest.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Tenant;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AiEditIndexRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'status' => ['nullable', 'string', 'max:30'],
|
||||
'safety_state' => ['nullable', 'string', 'max:30'],
|
||||
'per_page' => ['nullable', 'integer', 'min:1', 'max:50'],
|
||||
];
|
||||
}
|
||||
}
|
||||
27
app/Http/Requests/Tenant/AiEditStoreRequest.php
Normal file
27
app/Http/Requests/Tenant/AiEditStoreRequest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Tenant;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class AiEditStoreRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'photo_id' => ['required', 'integer', 'exists:photos,id'],
|
||||
'style_id' => ['nullable', 'integer', 'exists:ai_styles,id', 'required_without:style_key'],
|
||||
'style_key' => ['nullable', 'string', 'max:120', 'required_without:style_id'],
|
||||
'prompt' => ['nullable', 'string', 'max:2000'],
|
||||
'negative_prompt' => ['nullable', 'string', 'max:2000'],
|
||||
'provider_model' => ['nullable', 'string', 'max:120'],
|
||||
'idempotency_key' => ['nullable', 'string', 'max:120'],
|
||||
'metadata' => ['nullable', 'array'],
|
||||
];
|
||||
}
|
||||
}
|
||||
24
app/Http/Requests/Tenant/BillingAddonHistoryRequest.php
Normal file
24
app/Http/Requests/Tenant/BillingAddonHistoryRequest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Tenant;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class BillingAddonHistoryRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'page' => ['nullable', 'integer', 'min:1'],
|
||||
'per_page' => ['nullable', 'integer', 'min:1', 'max:100'],
|
||||
'event_id' => ['nullable', 'integer', 'min:1'],
|
||||
'event_slug' => ['nullable', 'string', 'max:191'],
|
||||
'status' => ['nullable', 'in:pending,completed,failed'],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,16 @@ class EventStoreRequest extends FormRequest
|
||||
'settings.control_room.force_review_uploaders' => ['nullable', 'array'],
|
||||
'settings.control_room.force_review_uploaders.*.device_id' => ['required', 'string', 'max:120'],
|
||||
'settings.control_room.force_review_uploaders.*.label' => ['nullable', 'string', 'max:80'],
|
||||
'settings.ai_editing' => ['nullable', 'array'],
|
||||
'settings.ai_editing.enabled' => ['nullable', 'boolean'],
|
||||
'settings.ai_editing.allow_custom_prompt' => ['nullable', 'boolean'],
|
||||
'settings.ai_editing.allowed_style_keys' => ['nullable', 'array'],
|
||||
'settings.ai_editing.allowed_style_keys.*' => [
|
||||
'string',
|
||||
'max:120',
|
||||
Rule::exists('ai_styles', 'key')->where('is_active', true),
|
||||
],
|
||||
'settings.ai_editing.policy_message' => ['nullable', 'string', 'max:280'],
|
||||
'settings.watermark' => ['nullable', 'array'],
|
||||
'settings.watermark.mode' => ['nullable', Rule::in(['base', 'custom', 'off'])],
|
||||
'settings.watermark.asset' => ['nullable', 'string', 'max:500'],
|
||||
|
||||
Reference in New Issue
Block a user