<?php

namespace Entity\Model;

use Helpers\QueryBuilder\QueryBuilder;
use Modules\Stock\Helper\StringHelper;

class Sarticle extends QueryBuilder
{
    protected string $table = 'SARTICLE with (nolock)';
    protected array $primKey = ['CODE_ART'];
    protected string $primaryKey = 'CODE_ART';

    /**
     * @param array<string,mixed> $stockArticle
     * @return void
     */
    public function processAndMerge(array $stockArticle): void
    {
        StringHelper::toFloat($stockArticle, ['CONV_ART1', 'CONV_ART2', 'CONV_ART3']);
        StringHelper::toBool($stockArticle, ['TRACABLE', 'ART_ACH', 'ART_LOUE', 'EXISTREEL', 'STRATEG']);

        $this->merge($stockArticle);
    }
}
