optriment/web3-employment

Implement Recipient List Import from CSV

gruz0 opened this issue · 0 comments

gruz0 commented

As a frontend developer, your task is to implement a feature that allows users to upload their recipients list from a CSV file on a specific group page. Users should be able to upload the CSV file from their computer using a popup dialog triggered by an "Import" button.

The following steps outline the expected behavior of the feature:

  1. On the specific group page, a button labeled "Import" should be prominently displayed.
  2. When a user clicks the "Import" button, a popup dialog should appear, prompting them to select a CSV file from their computer.
  3. Upon submitting the file selection in the popup dialog, the frontend should send the CSV file to the backend through a specific API endpoint (POST /api/groups/:group_id/import).
  4. The backend API will then parse the uploaded CSV file, validate its contents, and reject any invalid records.
  5. After successful validation, the backend will insert the valid recipients into the specified group.
  6. The user should receive a confirmation message indicating that the import has been successful.

Validations to be applied to the CSV file are as follows:

  1. Records with empty wallet addresses should be skipped during import.
  2. If the payment amount is invalid (not a number or a negative number), the frontend should insert a value of 0 for that particular recipient.
  3. If a recipient's display name is empty, the frontend should use the associated wallet address in its place.
  4. All values, including wallet addresses, contacts, and display names, should be cleansed of any leading or trailing whitespaces.

Good luck with the implementation! If you encounter any challenges during the development process, don't hesitate to reach out for assistance. We look forward to seeing the successful integration of this essential feature into our platform.