<?php

namespace Entity\Model;

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

class CampaignModel extends QueryBuilder
{
    public string $table = 'CAMP_ENT WITH(NOLOCK)';
    protected string $primaryKey = 'ID_CAMP';
    public string $titre;

    public function getArchitecture(\Helpers\Trad\ITrad $trad)
    {
        return  [
            'ID_CAMP' =>
            [
                'nomChamp' => $trad->t('Identifiant'),
                'type' => 'FLOAT',
                'obligatoire' => true
            ],
            'LIBELLE' =>
            [
                'nomChamp' => $trad->t('Libellée campagne'),
                'type' => 'TEXTE',
                'taille' => 120,
            ],
            'DESCRIPT' =>
            [
                'nomChamp' => $trad->t('Description'),
                'type' => 'TEXTAREA',
                'taille' => 3000,
            ],
            'TOUTESTE' =>
            [
                'nomChamp' => $trad->t('Toutes sociétés'),
                'type' => 'RADIO',
            ],
            'ID_GRILLE' =>
            [
                'nomChamp' => $trad->t('Catégorie'),
                'type' => 'TEXTE',
                'taille' => 10,
            ],
            'STATUT' =>
            [
                'nomChamp' => $trad->t('Statut'),
                'type' => 'TEXTE',
                'taille' => 1,
            ],
            'CREEEPAR' =>
            [
                'nomChamp' => $trad->t('Créée par'),
                'type' => 'TEXTE',
                'taille' => 30,
            ],
            'DTECREAT' =>
            [
                'nomChamp' => $trad->t('Créée le'),
                'type' => 'DATE',
                'taille' => 8,
                'genre' => 'float',
            ],
            'DTEVALID' =>
            [
                'nomChamp' => $trad->t('Date de début'),
                'type' => 'DATE',
                'taille' => 8,
                'genre' => 'float',
            ],
            'DTEFIN' =>
            [
                'nomChamp' => $trad->t('Date de fin'),
                'type' => 'DATE',
                'taille' => 8,
                'genre' => 'float',
            ],
        ];
    }
}
