coupon code system eingeführt. coupons werden vom super admin gemanaged. coupons werden mit paddle synchronisiert und dort validiert. plus: einige mobil-optimierungen im tenant admin pwa.

This commit is contained in:
Codex Agent
2025-11-09 20:26:50 +01:00
parent f3c44be76d
commit 082b78cd43
80 changed files with 4855 additions and 435 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Http\Requests\Tenant;
use App\Support\TenantRequestResolver;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
@@ -22,12 +23,12 @@ class TaskStoreRequest extends FormRequest
*/
public function rules(): array
{
$tenantId = TenantRequestResolver::resolve($this)->id;
return [
'title' => ['required', 'string', 'max:255'],
'description' => ['nullable', 'string'],
'collection_id' => ['nullable', 'exists:task_collections,id', function ($attribute, $value, $fail) {
$tenantId = request()->tenant?->id;
'collection_id' => ['nullable', 'exists:task_collections,id', function ($attribute, $value, $fail) use ($tenantId) {
$accessible = \App\Models\TaskCollection::where('id', $value)
->where(function ($query) use ($tenantId) {
$query->whereNull('tenant_id');
@@ -45,9 +46,8 @@ class TaskStoreRequest extends FormRequest
'priority' => ['nullable', Rule::in(['low', 'medium', 'high', 'urgent'])],
'due_date' => ['nullable', 'date', 'after:now'],
'is_completed' => ['nullable', 'boolean'],
'assigned_to' => ['nullable', 'exists:users,id', function ($attribute, $value, $fail) {
$tenantId = request()->tenant?->id;
if ($tenantId && !\App\Models\User::where('id', $value)->where('tenant_id', $tenantId)->exists()) {
'assigned_to' => ['nullable', 'exists:users,id', function ($attribute, $value, $fail) use ($tenantId) {
if ($tenantId && ! \App\Models\User::where('id', $value)->where('tenant_id', $tenantId)->exists()) {
$fail('Der Benutzer gehört nicht zu diesem Tenant.');
}
}],

View File

@@ -2,6 +2,7 @@
namespace App\Http\Requests\Tenant;
use App\Support\TenantRequestResolver;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
@@ -22,12 +23,12 @@ class TaskUpdateRequest extends FormRequest
*/
public function rules(): array
{
$tenantId = TenantRequestResolver::resolve($this)->id;
return [
'title' => ['sometimes', 'required', 'string', 'max:255'],
'description' => ['sometimes', 'nullable', 'string'],
'collection_id' => ['sometimes', 'nullable', 'exists:task_collections,id', function ($attribute, $value, $fail) {
$tenantId = request()->tenant?->id;
'collection_id' => ['sometimes', 'nullable', 'exists:task_collections,id', function ($attribute, $value, $fail) use ($tenantId) {
$accessible = \App\Models\TaskCollection::where('id', $value)
->where(function ($query) use ($tenantId) {
$query->whereNull('tenant_id');
@@ -45,9 +46,8 @@ class TaskUpdateRequest extends FormRequest
'priority' => ['sometimes', 'nullable', Rule::in(['low', 'medium', 'high', 'urgent'])],
'due_date' => ['sometimes', 'nullable', 'date'],
'is_completed' => ['sometimes', 'boolean'],
'assigned_to' => ['sometimes', 'nullable', 'exists:users,id', function ($attribute, $value, $fail) {
$tenantId = request()->tenant?->id;
if ($tenantId && !\App\Models\User::where('id', $value)->where('tenant_id', $tenantId)->exists()) {
'assigned_to' => ['sometimes', 'nullable', 'exists:users,id', function ($attribute, $value, $fail) use ($tenantId) {
if ($tenantId && ! \App\Models\User::where('id', $value)->where('tenant_id', $tenantId)->exists()) {
$fail('Der Benutzer gehört nicht zu diesem Tenant.');
}
}],