version: v2
app:
  name: Demo - v2
  application_type: DemoV2
module_directory: modules
logic_modules:
- simple_csv
sources:
  users:
    destination: LocalUser
    source_type: csv
    csv_filepath: sample_data_2.csv
    field_mapping:
      USER_ID:
        destination_field: unique_id
      USER_NAME:
          destination_field: name
      EMAIL:
        destination_field: email
        custom_type: STRING
      IS_ACTIVE:
        destination_field: is_active
        transforms:
          - name: validate_boolean
      LAST_LOGIN:
        destination_field: last_login_at
        transforms:
          - name: date_convert
      LAST_LOGIN-to-created-at:
        destination_field: last_login_at
        source_field: LAST_LOGIN
        transforms:
          - name: date_convert
  roles:
    destination: LocalRole
    source_type: source
    source: users
    field_mapping:
      ROLE:
        destination_field: unique_id
      ROLE-to-name:
          destination_field: name
          source_field: ROLE
    record_transforms_non_stream:
      - user_to_role
