<?php

namespace Entity\Model;

use Helpers\QueryBuilder\QueryBuilder;

class XtEve extends QueryBuilder
{
    protected string $table = 'XT_EVE with (nolock)';

    /**
     * @param array<mixed> $entity
     */
    public function insertEntity(array $entity):void
    {
        $this->insert([
            'DATEEVT' => date('Ymd'),
            'HEUREEVT' => date('His'),
        ] + $entity);
    }

    public function insertDocAttEvent(string $fourniss, string $docAttNum) :void
    {
        $this->insertEntity([
            'TYPEOBJ' => 'DOCATT',
            'ID_1' => 'FOURNISS',
            'ID_2' => $fourniss,
            'ID_3' => str_pad($docAttNum, 3, '0'),
        ]);
    }
}
