feat: subscriptions
CI / 🧪 Tests Laravel (push) Successful in 2m48s
CI / 🐳 Build & Push Image (push) Successful in 3m0s

This commit is contained in:
2026-08-07 11:53:46 +02:00
parent 99cb0e63e6
commit 2ece4b6e3e
51 changed files with 1489 additions and 254 deletions
+1 -2
View File
@@ -16,8 +16,7 @@ class CreditProductResource extends JsonResource
'id' => $this->id,
'name' => $this->name,
'description' => $this->description,
'type' => $this->type,
'credits' => $this->credits,
'purpose' => $this->purpose,
'amount' => $this->amount,
'currency' => $this->currency,
'formattedAmount' => $this->formattedAmount(),
@@ -0,0 +1,19 @@
<?php
namespace App\Http\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class IdentityVerificationResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'status' => $this->status,
'submittedAt' => $this->submitted_at?->toISOString(),
'reviewedAt' => $this->reviewed_at?->toISOString(),
'rejectionReason' => $this->rejection_reason,
];
}
}
+4 -1
View File
@@ -27,7 +27,10 @@ class UserResource extends JsonResource
'bio' => $this->bio,
'role' => $this->role,
'accountVerified' => $this->account_verified_at !== null,
'aiCreditsBalance' => (int) $this->ai_credits_balance,
'certificationPurchased' => $this->hasPurchasedCertification(),
'canAnalyzeMeals' => $this->canAnalyzeMeals(),
'analysisAccessLevel' => $this->analysisAccessLevel(),
'trialEndsAt' => $this->trial_ends_at?->toISOString(),
'hasActiveSubscription' => $this->subscribed('default'),
'suspendedAt' => $this->suspended_at?->toISOString(),
'physicalActivityLevel' => $this->physical_activity_level,