version: 2
models:
  - name: FS_ARTIST_ROSTER_DBT
    description: '{{ doc("FS_ARTIST_ROSTER_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - ARTIST_GP_ID
            - VENDOR_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
      - dbt_utils.expression_is_true:
          expression: "IS_SME_REP_OWNER IS NOT NULL"
          config:
            where: "VENDOR_BRAND_NAME = 'sme'"
      - dbt_utils.expression_is_true:
          expression: "IRL_COUNTRY_CODES IS NOT NULL"
          config:
            where: "IS_SME_REP_OWNER = FALSE"
      - dbt_utils.expression_is_true:
          expression: "IRL_COUNTRY_CODES IS NULL"
          config:
            where: "IS_SME_REP_OWNER = TRUE"
    columns:
      - name: ARTIST_GP_ID
        description: Artist Global Participant ID
        data_tests:
          - not_null
      - name: ARTIST_NAME
        description: Artist Global Participant Name
        data_tests:
          - not_null
      - name: ARTIST_SPOTIFY_ID
        description: Artist Global Participant Spotify ID
        data_tests:
          - not_null
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: VENDOR_NAME
        description: Vendor Name
        data_tests:
          - not_null
      - name: VENDOR_BRAND_NAME
        description: Vendor Brand Name
        data_tests:
          - not_null
      - name: IS_SME_REP_OWNER
        description: Vendor Brand Name
      - name: IRL_COUNTRY_CODES
        description: List of IRL country codes (ISO2)
      - name: CREATED_AT
        description: Timestamp when the roster record was originally created
  - name: FS_SME_REP_OWNER_ARTIST_ROSTER_DBT
    description: '{{ doc("FS_SME_REP_OWNER_ARTIST_ROSTER_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - ARTIST_GP_ID
            - VENDOR_ID
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: ARTIST_GP_ID
        description: Artist Global Participant ID
        data_tests:
          - not_null
      - name: ARTIST_NAME
        description: Artist Global Participant Name
        data_tests:
          - not_null
      - name: ARTIST_SPOTIFY_ID
        description: Artist Global Participant Spotify ID
        data_tests:
          - not_null
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: VENDOR_NAME
        description: Vendor Name
        data_tests:
          - not_null
      - name: STATUS
        description: Artist status in the roster of a given label. Filled in with INACTIVE only for a few labels, is ACTIVE for the rest of the labels.
      - name: CREATED_AT
        description: Timestamp when the roster record was originally created
  - name: FS_SME_IRL_REP_ARTIST_ROSTER_DBT
    description: '{{ doc("FS_SME_IRL_REP_ARTIST_ROSTER_DBT") }}'
    data_tests:
      - dbt_utils.unique_combination_of_columns:
          combination_of_columns:
            - ARTIST_GP_ID
            - VENDOR_ID
            - IRL_COUNTRY_CODE
      - dbt_expectations.expect_table_row_count_to_be_between:
          min_value: 1
    columns:
      - name: ARTIST_GP_ID
        description: Artist Global Participant ID
        data_tests:
          - not_null
      - name: ARTIST_NAME
        description: Artist Global Participant Name
        data_tests:
          - not_null
      - name: ARTIST_SPOTIFY_ID
        description: Artist Global Participant Spotify ID
        data_tests:
          - not_null
      - name: VENDOR_ID
        description: Vendor ID
        data_tests:
          - not_null
      - name: VENDOR_NAME
        description: Vendor Name
        data_tests:
          - not_null
      - name: IRL_COUNTRY_CODE
        description: Country code where a label has IRL rights for the artist
        data_tests:
          - not_null
      - name: CREATED_AT
        description: Timestamp when the roster record was originally created
