<?php

namespace Modules\Vrc\Services\Contracts;

use Modules\Vrc\Entities\VrcRepairOrder;

/**
 * VRC ↔ ERP invoicing boundary (spec §6.10). A completed repair order
 * generates an ERP sell Transaction; VRC stores its id and reads payment
 * status back. VRC never builds a parallel invoice/payment store.
 */
interface InvoiceServiceContract
{
    /** Generate (or return the existing) ERP invoice for a repair order; returns the transaction id. */
    public function generateFromRepairOrder(VrcRepairOrder $ro, ?int $userId): ?int;

    /**
     * Payment snapshot for the order's ERP invoice.
     *
     * @return array{total:float,paid:float,due:float,status:string,invoice_no:?string}
     */
    public function statusForOrder(VrcRepairOrder $ro): array;
}
