Skip to content

feat(authorization): Add bulk import for assigning agent managers - #460

Open
code-xpertai[bot] wants to merge 1 commit into
developfrom
feature/bulk-import-managers
Open

feat(authorization): Add bulk import for assigning agent managers#460
code-xpertai[bot] wants to merge 1 commit into
developfrom
feature/bulk-import-managers

Conversation

@code-xpertai

@code-xpertai code-xpertai Bot commented Mar 16, 2026

Copy link
Copy Markdown

Summary

This PR adds bulk import capability to the Agent Authorization page, allowing admins to assign an agent to multiple users at once by uploading a CSV file.

Fixes #417

Changes

Frontend

  • Authorization Component: Added "Bulk Import" button next to the existing "Add" button
  • New Bulk Import Dialog: Created XpertManagerBulkImportComponent with:
    • Drag-and-drop CSV file upload
    • CSV format instructions and downloadable template
    • Preview of found users before confirming
    • Support for Chinese encoding (GBK, GB18030, etc.)

Backend

  • New Endpoint POST /:id/managers/bulk/upload:

    • Accepts CSV file upload
    • Detects file encoding automatically for international support
    • Parses email column and finds matching users
    • Returns list of found users for preview
  • New Endpoint PUT /:id/managers/bulk:

    • Accepts array of user IDs
    • Adds new managers without removing existing ones
    • Prevents duplicate assignments

CSV Format

The CSV file must contain an email column:

email
user1@example.com
user2@example.com

Testing

  • CSV upload with UTF-8 encoding
  • CSV upload with Chinese encoding (GBK)
  • Preview shows found users correctly
  • Duplicate emails are handled gracefully
  • Non-existent emails are ignored (users not found)
  • Existing managers are not duplicated

Screenshot

The new "Bulk Import" button appears next to the "Add" button on the Xpert Managers page.

Add bulk import capability to the Agent Authorization page, allowing admins
to assign an agent to multiple users at once by uploading a CSV file.

Changes:
- Frontend: Add 'Bulk Import' button and dialog component for CSV upload
- Frontend: Preview found users before confirming the import
- Backend: Add CSV upload endpoint with encoding detection for Chinese support
- Backend: Add bulk add managers endpoint to handle multiple user assignments

The CSV file must contain an 'email' column. Users are matched by their
email addresses in the system.

Fixes #417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants