id: d7_node_programme
label: Node Programme
migration_group: popsu
audit: true
migration_tags:
  - Drupal 7
  - Content
  - Popsu

source:
  plugin: d7_node_programme
  node_type: popsu_special
  batch_size: 500
  # high_water_property:
  #   name: changed
  #   alias: n

destination:
  plugin: entity:node


process:
  # nid: nid
  type:
    plugin: default_value
    default_value: programme
  created: created
  changed: changed

  uid:
    plugin: default_value
    default_value: 34

  title: term_title

  'body/value': body
  'body/summary': body_summary
  'body/format':
    plugin: default_value
    default_value: 'wysiwyg'

  # https://understanddrupal.com/articles/introduction-paragraphs-migrations-drupal
  # pseudo_field_textes:
  #   plugin: migration_lookup
  #   migration: d7_paragraphe_texts_programme
  #   source: text_paragraphe_id
  # field_textes:
  #   plugin: sub_process
  #   source:
  #     - '@pseudo_field_textes'
  #   process:
  #     target_id: '0'
  #     target_revision_id: '1'

  # field_textes:
  #   plugin: sub_process
  #   source:
  #     - text_paragraphe
  #   process:
  #     target_id: '0'
  #     target_revision_id: '1'

  field_textes: text_paragraphe

  field_sous_parties: sous_parties

  field_partenaires: partenaires

  field_fichier:
    plugin: sub_process
    source: fichiers
    process:
      target_id:
        plugin: migration_lookup
        migration: d7_allpublicfiles
        source: fid
        no_stub: true
      display: display
      description: description

migration_dependencies:
  required:
    - d7_allpublicfiles
    - d7_users
