<?php

namespace Modules\Accounts\Services;

use Modules\Accounts\Enums\AccountTypeEnum;
use Modules\Accounts\Repositories\AccountLookupRepository;

class AccountLookupService
{
    protected $acctLookupRepo;

    public function __construct(
        AccountLookupRepository $acctLookupRepo,
    ) {
        $this->acctLookupRepo = $acctLookupRepo;
    }

    public function getAccountTypes(): array
    {
        $types = collect(AccountTypeEnum::cases())->map(fn ($type) => [
                'value' => $type->value,
                'label' => $type->label(),
                'root_code' => $type->rootCode(),
            ]);

        return $types->toArray();
    }
}
