<?php

namespace classes;

class Document
{
    /**
     * Retrieves the document status ID based on the given document status code.
     *
     * @param string $documentStatusCode The code representing the document status.
     * @param MysqliVeu $database The database connection instance.
     * @return int The ID corresponding to the document status code.
     */
    public static function getDocumentStatusId(string $documentStatusCode, MysqliVeu $database): int
    {
        $documentStatusCode = strtoupper($documentStatusCode);

        $sql = "SELECT id FROM document_status WHERE document_status_code = ?";

        $result = $database->queryParamsRow($sql, [$documentStatusCode]);

        return (int) $result['id'];
    }
}
