<?php

namespace App\Http\Controllers\Remarks;

use App\Classes\ValueObjects\Constants\RemarkRefundReason;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class ListRefundRemarksController
{
    /**
     * @param Request $request
     * @return JsonResponse
     */
    public function list(Request $request): JsonResponse {
        // $allReasons = RemarkRefundReason::REFUND_REASONS;
        // $returnArray = [];
        // foreach ($allReasons as $reason => $category) {
        //     $returnArray[] = [
        //         'name' => $reason
        //     ];
        // }
        // $row['payload']["data"] = $returnArray;

        $allReasons = RemarkRefundReason::REFUND_REASONS;
        $row['payload']['data'] = array_keys($allReasons);
        return response()->json($row);
    }
}
