<?php

namespace Entity\Model;

use Helpers\QueryBuilder\QueryBuilder;
use Helpers\Trad\Trad;

class Articles extends QueryBuilder
{
    protected string $table = 'ARTICLES with (nolock)';
    protected string $primaryKey = 'CODE_ART';
    protected string $libelle = 'DESIGN';

    public function getArchitecture(\Helpers\Trad\ITrad $trad)
    {
        return  [
            'CODE_ART' => [
                'nomChamp' => $trad->t('Code article'),
                'type' => 'varchar',
                'taille' => 13,
                'obligatoire' => true
            ],
            'DESIGN' => [
                'nomChamp' => $trad->t('Design'),
                'type' => 'varchar',
                'taille' => 60,
                'obligatoire' => true
            ],
            'DTE_COUT' => [
                'nomChamp' => $trad->t('Date Coût'),
                'type' => 'char',
                'taille' => 8,
                'obligatoire' => true
            ],
            'CUM_COUT' => [
                'nomChamp' => $trad->t('CUM_COUT'),
                'type' => 'float',
                'taille' => 2,
                'obligatoire' => false
            ],
            'SSFAM' => [
                'nomChamp' => $trad->t('Code article'),
                'type' => 'varchar',
                'taille' => 7,
                'obligatoire' => true
            ],
            'UNIT' => [
                'nomChamp' => $trad->t('Unité'),
                'type' => 'varchar',
                'taille' => 7,
                'obligatoire' => true
            ],
            'CLASSE' => [
                'nomChamp' => $trad->t('Classe'),
                'type' => 'varchar',
                'taille' => 1,
                'obligatoire' => true
            ],
            'ZONE_NUM' => [
                'nomChamp' => $trad->t('Zone Numérique'),
                'type' => 'float',
                'taille' => 13,
                'obligatoire' => true
            ],
            'ZONEALPHA' => [
                'nomChamp' => $trad->t('Zone alpha numérique'),
                'type' => 'varchar',
                'taille' => 15,
                'obligatoire' => true
            ],
            'STOCKE' => [
                'nomChamp' => $trad->t('Stock'),
                'type' => 'int',
                'taille' => 1,
                'obligatoire' => true
            ],
            'DTEVALMIN' => [
                'nomChamp' => $trad->t('Date minimum'),
                'type' => 'date',
                'taille' => 8,
                'obligatoire' => true
            ],
            'DTEVALMAX' => [
                'nomChamp' => $trad->t('Date maximum'),
                'type' => 'date',
                'taille' => 13,
                'obligatoire' => true
            ],
            'CTRL_QUA' => [
                'nomChamp' => $trad->t('Contrôle qualité'),
                'type' => 'varchar',
                'taille' => 3,
                'obligatoire' => true
            ],
            'TXTVA' => [
                'nomChamp' => $trad->t('Txt Tva'),
                'type' => 'float',
                'taille' => 8,
                'obligatoire' => true
            ],
            'CODEFAB' => [
                'nomChamp' => $trad->t('Code Fab'),
                'type' => 'varchar',
                'taille' => 12,
                'obligatoire' => true
            ],
            'CODEGAM' => [
                'nomChamp' => $trad->t('Code Gam'),
                'type' => 'varchar',
                'taille' => 7,
                'obligatoire' => true
            ],
            'REFARTFAB' => [
                'nomChamp' => $trad->t('REFARTFAB'),
                'type' => 'varchar',
                'taille' => 30,
                'obligatoire' => true
            ],
            'TYPEGAM' => [
                'nomChamp' => $trad->t('TYPEGAM'),
                'type' => 'varchar',
                'taille' => 30,
                'obligatoire' => true
            ],
            'PRXBLBAS' => [
                'nomChamp' => 'PRXBLBAS',
                'type' => 'float',
                'taille' => 5,
                'obligatoire' => true
            ],
            'DMAJBAS' => [
                'nomChamp' => $trad->t('DMAJBAS'),
                'type' => 'char',
                'taille' => 8,
                'obligatoire' => true
            ],
            'IMAGART' => [
                'nomChamp' => $trad->t('Image Article'),
                'type' => 'varchar',
                'taille' => 8,
                'obligatoire' => true
            ],
            'DOUANES' => [
                'nomChamp' => $trad->t('DOUANES'),
                'type' => 'char',
                'taille' => 8,
                'obligatoire' => true
            ],
            // TODO CONTINUER DEV
        
        ];
    }
}
