{#- Context variables:
   - company: str (e.g., "ACME Bank")
   - industry: str (e.g., "fsi")
   - catalog: str (e.g., "acme_fsi_demo")
   - bundle_name: str (e.g., "acme-bank-fsi-demo")
   - app_name: str (e.g., "acme-bank-fsi-app")
   - warehouse_id: str
   - workspace_host: str
   - databricks_profile: str | None
   - lakebase_url: str | None
   - notification_email: str
-#}
resources:
  jobs:
    {{ bundle_name | replace('-', '_') }}_data_generation:
      name: {{ bundle_name }}_data_generation

      tasks:
        - task_key: setup_catalog
          notebook_task:
            notebook_path: ${workspace.file_path}/src/data_generation/setup_catalog
            source: WORKSPACE
            base_parameters:
              catalog: ${var.catalog}
          environment_key: data_gen_env

        - task_key: generate_sample
          notebook_task:
            notebook_path: ${workspace.file_path}/src/data_generation/structured/generate_sample
            source: WORKSPACE
            base_parameters:
              catalog: ${var.catalog}
          environment_key: data_gen_env
          depends_on:
            - task_key: setup_catalog

        # ---------------------------------------------------------------
        # Entity generation tasks — added by /build-next after Phase 0
        # Example pattern for each entity:
        #
        # - task_key: generate_<entity_name>
        #   notebook_task:
        #     notebook_path: ${workspace.file_path}/src/data_generation/structured/generate_<entity_name>
        #     source: WORKSPACE
        #     base_parameters:
        #       catalog: ${var.catalog}
        #   environment_key: data_gen_env
        #   depends_on:
        #     - task_key: setup_catalog
        # ---------------------------------------------------------------

      queue:
        enabled: true

      environments:
        - environment_key: Default
          spec:
            environment_version: "4"

        - environment_key: data_gen_env
          spec:
            dependencies:
              - -r
                ${workspace.file_path}/requirements.txt
              - faker
              - pyarrow
            environment_version: "4"

      performance_target: PERFORMANCE_OPTIMIZED

      email_notifications:
        on_failure:
          - ${var.notification_email}

      tags:
        project: ${bundle.name}
        component: data_generation
        environment: ${bundle.target}
