App\Entity\Dossier:
    type: entity
    repositoryClass: App\Repository\DossierRepository
    table: dossier
    indexes:
        idx_dossier_num_dossier:
            columns: [ num_dossier ]
        idx_dossier_date:
            columns: [ date_dossier ]
        idx_dossier_status:
            columns: [ status ]
        idx_dossier_client:
            columns: [ client_id ]
        idx_dossier_vehicule:
            columns: [ vehicule_id ]
    uniqueConstraints:
        unique_num_dossier:
            columns: [ num_dossier ]
    fields:
        id:
            id: true
            type: integer
            unsigned: false
            nullable: false
            generator:
                strategy: IDENTITY
        numIncrement:
            type: integer
            nullable: false
            column: num_increment
        numDossier:
            type: string
            length: 50
            fixed: false
            nullable: false
            column: num_dossier
        dateDossier:
            type: datetime
            nullable: false
            column: date_dossier
        titre:
            type: string
            length: 255
            fixed: false
            nullable: false
        description:
            type: text
            nullable: true
        status:
            type: string
            length: 50
            fixed: false
            nullable: false
            options:
                default: 'EN_PREPARATION'
        priorite:
            type: string
            length: 20
            fixed: false
            nullable: true
            options:
                default: 'NORMALE'
        dateOuverture:
            type: datetime
            nullable: true
            column: date_ouverture
        dateCloture:
            type: datetime
            nullable: true
            column: date_cloture
        expert1Status:
            type: string
            length: 50
            fixed: false
            nullable: true
            column: expert1_status
        expert1Notes:
            type: text
            nullable: true
            column: expert1_notes
        expert2Status:
            type: string
            length: 50
            fixed: false
            nullable: true
            column: expert2_status
        expert2Notes:
            type: text
            nullable: true
            column: expert2_notes
        expert3Status:
            type: string
            length: 50
            fixed: false
            nullable: true
            column: expert3_status
        expert3Notes:
            type: text
            nullable: true
            column: expert3_notes
        expertValidationFinale:
            type: boolean
            nullable: false
            options:
                default: false
            column: expert_validation_finale
        montantEstime:
            type: decimal
            precision: 10
            scale: 2
            nullable: true
            column: montant_estime
        montantFinal:
            type: decimal
            precision: 10
            scale: 2
            nullable: true
            column: montant_final
        observations:
            type: text
            nullable: true
        dateTimeCreation:
            type: datetime
            nullable: false
            column: date_time_creation
        dateTimeModification:
            type: datetime
            nullable: false
            column: date_time_modification
    manyToOne:
        client:
            targetEntity: Client
            inversedBy: dossiers
            joinColumn:
                name: client_id
                referencedColumnName: id
                nullable: false
        vehicule:
            targetEntity: Vehicule
            inversedBy: dossiers
            joinColumn:
                name: vehicule_id
                referencedColumnName: id
                nullable: false
        assurance:
            targetEntity: Organisme
            joinColumn:
                name: assurance_id
                referencedColumnName: id
                nullable: true
                onDelete: SET NULL
        expert1:
            targetEntity: Organisme
            joinColumn:
                name: expert1_id
                referencedColumnName: id
                nullable: true
                onDelete: SET NULL
        expert2:
            targetEntity: Organisme
            joinColumn:
                name: expert2_id
                referencedColumnName: id
                nullable: true
                onDelete: SET NULL
        expert3:
            targetEntity: Organisme
            joinColumn:
                name: expert3_id
                referencedColumnName: id
                nullable: true
                onDelete: SET NULL
        magasin:
            targetEntity: Magasin
            inversedBy: dossiers
            joinColumn:
                name: magasin_id
                referencedColumnName: id
                nullable: false
        utilisateur:
            targetEntity: Utilisateur
            inversedBy: dossiers
            joinColumn:
                name: utilisateur_id
                referencedColumnName: id
                nullable: false
    oneToMany:
        devis:
            targetEntity: Devis
            mappedBy: dossier
            cascade: ['persist']
        commandes:
            targetEntity: Commande
            mappedBy: dossier
            cascade: ['persist']
        achats:
            targetEntity: Achat
            mappedBy: dossier
            cascade: ['persist']
        reparations:
            targetEntity: Reparation
            mappedBy: dossier
            cascade: ['persist']
        ventes:
            targetEntity: Vente
            mappedBy: dossier
            cascade: ['persist']
        documents:
            targetEntity: DossierDocument
            mappedBy: dossier
            cascade: ['persist', 'remove']
    lifecycleCallbacks:
        prePersist: [setDateTimeCreationValue, setDateTimeModificationValue]
        preUpdate: [setDateTimeModificationValue]
