feat: subscriptions
This commit is contained in:
@@ -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,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user