<?php

namespace App\Http\Controllers\Api\V1;

use App\Http\Controllers\Controller;
use App\Models\PricingPlan;
use Illuminate\Http\JsonResponse;

class PricingController extends Controller
{
    public function index(): JsonResponse
    {
        $plans = PricingPlan::where('status', 'active')
            ->orderBy('id')
            ->get(['code', 'name', 'currency', 'amount', 'period', 'meta']);

        return response()->json([
            'ok' => true,
            'plans' => $plans,
        ]);
    }
}
