<?php

namespace Modules\Vrc\Services\Contracts;

/**
 * VRC ↔ ERP customers boundary. VRC never touches App\Contact directly; it
 * goes through this contract so customer lookup/creation stays a single,
 * swappable integration point (spec §3.3 / §6.1). Vehicles reference the
 * returned contact by id (erp_customer_id).
 */
interface ContactServiceContract
{
    /** Resolve a customer contact by id within a business, or null. */
    public function find(int $businessId, int $contactId);

    /**
     * Find an existing customer by phone/email within the business, or create
     * one from the given attributes (name, phone, email, source).
     *
     * @return \App\Contact
     */
    public function findOrCreateCustomer(int $businessId, array $attrs);

    /** [id => name] customer dropdown for the business. */
    public function customersDropdown(int $businessId): array;

    /** Display name for a customer id (or '' if not found). */
    public function name(int $businessId, int $contactId): string;
}
