<?php
// ============================================================
// ILabForm Interface
// Every lab-specific form handler must implement this.
// ============================================================
interface ILabForm {

    /**
     * Return the SQL to create this lab's custom table (if not exists).
     */
    public function getTableSchema(): string;

    /**
     * Validate POST data. Return array of error strings (empty = valid).
     */
    public function validate(array $post): array;

    /**
     * Save/update form data. Returns the saved form's ID.
     */
    public function save(int $requestId, int $officerId, int $labId, array $post): int;

    /**
     * Load saved form data by request_id. Returns row array or null.
     */
    public function load(int $requestId): ?array;

    /**
     * Is the form ready for certificate generation?
     */
    public function isSubmitted(array $formData): bool;
}
