<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Inertia\Inertia;

class ShopSubscriptionController extends Controller
{
    public function index()
    {
        $shopUser = Auth::guard('shop')->user();

        return Inertia::render('Shop/Subscription/Index', [
            'shopUser' => [
                'id' => $shopUser->id,
                'shop_name' => $shopUser->shop_name,
                'plan_type' => $shopUser->plan_type,
                'plan_expiry_date' => $shopUser->plan_expiry_date,
                'plan_status' => $shopUser->plan_status,
                'remaining_free_orders' => $shopUser->remainingFreeOrders(),
                'can_create_order' => $shopUser->canCreateOrder(),
                'is_expired' => $shopUser->isExpired(),
            ],
        ]);
    }
}
