App\Entity\Ticket:
    type: entity
    repositoryClass: App\Repository\TicketRepository
    table: ticket
    indexes:
        idx_ticket_magasin:
            columns: [ magasin_id ]
        idx_ticket_utilisateur:
            columns: [ utilisateur_id ]
        idx_ticket_statut:
            columns: [ statut ]
        idx_ticket_priorite:
            columns: [ priorite ]
        idx_ticket_categorie:
            columns: [ categorie ]
        idx_ticket_date_creation:
            columns: [ date_time_creation ]
    fields:
        id:
            id: true
            type: integer
            unsigned: false
            nullable: false
            generator:
                strategy: IDENTITY
        numero:
            type: string
            length: 30
            nullable: false
        sujet:
            type: string
            length: 255
            nullable: false
        description:
            type: text
            nullable: false
        statut:
            type: string
            length: 30
            nullable: false
        priorite:
            type: string
            length: 20
            nullable: false
        categorie:
            type: string
            length: 30
            nullable: false
        dateTimeCreation:
            type: datetime
            nullable: false
            column: date_time_creation
        dateTimeModification:
            type: datetime
            nullable: false
            column: date_time_modification
    manyToOne:
        utilisateur:
            targetEntity: Utilisateur
            joinColumn:
                name: utilisateur_id
                referencedColumnName: id
                nullable: false
        magasin:
            targetEntity: Magasin
            joinColumn:
                name: magasin_id
                referencedColumnName: id
                nullable: false
        assignePar:
            targetEntity: Utilisateur
            joinColumn:
                name: assigne_par_id
                referencedColumnName: id
                nullable: true
        assigne:
            targetEntity: Utilisateur
            joinColumn:
                name: assigne_id
                referencedColumnName: id
                nullable: true
    oneToMany:
        messages:
            targetEntity: TicketMessage
            mappedBy: ticket
            cascade: [persist, remove]
            orphanRemoval: true
            orderBy:
                dateTimeCreation: ASC
        piecesJointes:
            targetEntity: TicketPieceJointe
            mappedBy: ticket
            cascade: [persist, remove]
            orphanRemoval: true
            orderBy:
                dateUpload: ASC
