<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Support\ApiResponse;
use Illuminate\Http\Request;

class LookupController extends Controller
{
    public function currencies(Request $request)
    {
        return ApiResponse::success('Currencies', [
            ['id' => 1, 'currencyName' => 'USD', 'symbol' => '$', 'name' => 'US Dollar'],
            ['id' => 2, 'currencyName' => 'EUR', 'symbol' => '€', 'name' => 'Euro'],
            ['id' => 3, 'currencyName' => 'GBP', 'symbol' => '£', 'name' => 'British Pound'],
            ['id' => 4, 'currencyName' => 'AUD', 'symbol' => 'A$', 'name' => 'Australian Dollar'],
            ['id' => 5, 'currencyName' => 'CAD', 'symbol' => 'C$', 'name' => 'Canadian Dollar'],
            ['id' => 6, 'currencyName' => 'JPY', 'symbol' => '¥', 'name' => 'Japanese Yen'],
            ['id' => 7, 'currencyName' => 'INR', 'symbol' => '₹', 'name' => 'Indian Rupee'],
            ['id' => 8, 'currencyName' => 'PKR', 'symbol' => '₨', 'name' => 'Pakistani Rupee'],
            ['id' => 9, 'currencyName' => 'AED', 'symbol' => 'د.إ', 'name' => 'UAE Dirham'],
            ['id' => 10, 'currencyName' => 'SAR', 'symbol' => '﷼', 'name' => 'Saudi Riyal'],
        ]);
    }

    public function countries(Request $request)
    {
        return ApiResponse::success('Countries', [
            ['id' => 1, 'name' => 'United States', 'code' => 'US'],
            ['id' => 2, 'name' => 'United Kingdom', 'code' => 'GB'],
            ['id' => 3, 'name' => 'Canada', 'code' => 'CA'],
            ['id' => 4, 'name' => 'Australia', 'code' => 'AU'],
            ['id' => 5, 'name' => 'India', 'code' => 'IN'],
            ['id' => 6, 'name' => 'Pakistan', 'code' => 'PK'],
            ['id' => 7, 'name' => 'United Arab Emirates', 'code' => 'AE'],
            ['id' => 8, 'name' => 'Germany', 'code' => 'DE'],
            ['id' => 9, 'name' => 'France', 'code' => 'FR'],
            ['id' => 10, 'name' => 'Japan', 'code' => 'JP'],
        ]);
    }

    public function states(Request $request)
    {
        // Stub — frontend reads `name`, `id`.
        return ApiResponse::success('States', [
            ['id' => 1, 'name' => 'California', 'countryId' => 1],
            ['id' => 2, 'name' => 'New York', 'countryId' => 1],
            ['id' => 3, 'name' => 'England', 'countryId' => 2],
            ['id' => 4, 'name' => 'Ontario', 'countryId' => 3],
            ['id' => 5, 'name' => 'New South Wales', 'countryId' => 4],
            ['id' => 6, 'name' => 'Punjab', 'countryId' => 6],
            ['id' => 7, 'name' => 'Sindh', 'countryId' => 6],
        ]);
    }

    public function businessTypes(Request $request)
    {
        return ApiResponse::success('Business types', [
            ['id' => 1, 'name' => 'Sole Proprietorship'],
            ['id' => 2, 'name' => 'Partnership'],
            ['id' => 3, 'name' => 'LLC'],
            ['id' => 4, 'name' => 'Corporation'],
            ['id' => 5, 'name' => 'Non-Profit'],
        ]);
    }

    public function invoiceTitles(Request $request)
    {
        return ApiResponse::success('Invoice titles', [
            ['id' => 1, 'name' => 'Invoice'],
            ['id' => 2, 'name' => 'Bill'],
            ['id' => 3, 'name' => 'Receipt'],
            ['id' => 4, 'name' => 'Credit Note'],
            ['id' => 5, 'name' => 'Debit Note'],
            ['id' => 6, 'name' => 'Tax Invoice'],
            ['id' => 7, 'name' => 'Proforma Invoice'],
        ]);
    }

    public function invoiceRecordAs(Request $request)
    {
        return ApiResponse::success('Invoice record as', [
            ['id' => 1, 'name' => 'Invoice'],
            ['id' => 2, 'name' => 'Expense'],
            ['id' => 3, 'name' => 'Bill'],
            ['id' => 4, 'name' => 'Purchase Order'],
            ['id' => 5, 'name' => 'Sales Order'],
            ['id' => 6, 'name' => 'Quote'],
        ]);
    }
}
