Eherina\Domain\Client:
  type: entity
  table: eherina_client
  id:
    uuid:
      type: string
      unique: true
      id: true
  fields:
    name:
      type: string
      nullable: false
    city:
      type: string
      nullable: false
    type:
      type: string
      nullable: false

  oneToOne:
    account:
      targetEntity: Nordmind\Security\Application\User\Account
      cascade: ['persist', 'remove']
      onDelete: CASCADE
      inversedBy: profile
      joinColumn:
        name: account_uuid
        referencedColumnName: uuid

  manyToMany:
    products:
        targetEntity: Eherina\Domain\Product
        cascade: ['persist']
        joinTable:
          name: eherina_client_product
          joinColumns:
            client_uuid:
              referencedColumnName: uuid
          inverseJoinColumns:
            product_uuid:
              referencedColumnName: uuid
    events:
      targetEntity: Eherina\Domain\Event
      cascade: ['persist']
      joinTable:
        name: eherina_client_event
        joinColumns:
          client_uuid:
            referencedColumnName: uuid
        inverseJoinColumns:
          event_uuid:
            referencedColumnName: uuid