services:
    pim_connector.writer.file.csv_user_group:
        class: '%pim_connector.writer.file.csv.class%'
        arguments:
            - '@pim_connector.array_converter.standard_to_flat.user_group'
            - '@pim_connector.factory.flat_item_buffer'
            - '@pim_connector.writer.file.flat_item_buffer_flusher'

    pim_connector.writer.file.xlsx_user_group:
        class: '%pim_connector.writer.file.xlsx.class%'
        arguments:
            - '@pim_connector.array_converter.standard_to_flat.user_group'
            - '@pim_connector.factory.flat_item_buffer'
            - '@pim_connector.writer.file.flat_item_buffer_flusher'

    pim_connector.writer.file.csv_user_role:
        class: '%pim_connector.writer.file.csv.class%'
        arguments:
            - '@pim_connector.array_converter.standard_to_flat.user_role'
            - '@pim_connector.factory.flat_item_buffer'
            - '@pim_user.writer.file.user_role.flat_item_buffer_flusher'

    pim_connector.writer.file.xlsx_user_role:
        class: '%pim_connector.writer.file.xlsx.class%'
        arguments:
            - '@pim_connector.array_converter.standard_to_flat.user_role'
            - '@pim_connector.factory.flat_item_buffer'
            - '@pim_user.writer.file.user_role.flat_item_buffer_flusher'

    pim_connector.writer.file.csv_user:
        class: 'Akeneo\UserManagement\Component\Connector\Writer\File\CsvUserWriter'
        arguments:
            - '@pim_connector.array_converter.standard_to_flat.user'
            - '@pim_connector.factory.flat_item_buffer'
            - '@pim_user.writer.file.flat_item_buffer_flusher'
            - '@akeneo_file_storage.repository.file_info'
            - '@akeneo_file_storage.file_storage.filesystem_provider'
            - '@pim_connector.writer.file.media_exporter_path_generator'

    pim_connector.writer.file.xlsx_user:
        class: 'Akeneo\UserManagement\Component\Connector\Writer\File\XlsxUserWriter'
        arguments:
            - '@pim_connector.array_converter.standard_to_flat.user'
            - '@pim_connector.factory.flat_item_buffer'
            - '@pim_user.writer.file.flat_item_buffer_flusher'
            - '@akeneo_file_storage.repository.file_info'
            - '@akeneo_file_storage.file_storage.filesystem_provider'
            - '@pim_connector.writer.file.media_exporter_path_generator'

    pim_user.writer.file.flat_item_buffer_flusher:
        class: '%pim_connector.writer.file.flat_item_buffer_flusher.class%'
        arguments:
            - '@pim_connector.writer.file.default.column_presenter'
            - '@pim_user.writer.file.column_sorter'

    pim_user.writer.file.column_sorter:
        class: '%pim_connector.writer.file.default.column_sorter.class%'
        arguments:
            - '@pim_connector.array_converter.field_splitter'
            - [ 'username', 'email' ]

    pim_user.writer.file.user_role.flat_item_buffer_flusher:
        class: '%pim_connector.writer.file.flat_item_buffer_flusher.class%'
        arguments:
            - '@pim_connector.writer.file.default.column_presenter'
            - '@pim_user.writer.file.user_role.column_sorter'

    pim_user.writer.file.user_role.column_sorter:
        class: '%pim_connector.writer.file.default.column_sorter.class%'
        arguments:
            - '@pim_connector.array_converter.field_splitter'
            - [ 'role', 'label' ]

    pim_connector.writer.database.user_role_with_permission:
        class: 'Akeneo\UserManagement\Component\Connector\Writer\Database\RoleWithPermissionsWriter'
        arguments:
            - '@pim_user.saver.role_with_permissions'
            - '@akeneo_storage_utils.doctrine.object_detacher'
