Adding_Multi_Players - MukeshKumar101/IPL_Auction GitHub Wiki

Problem statement:

To create a page to add multiple players from local files consisting of new player's data.

Events required:

  • onSearchFileFromLocal()
  • onSelectFileFromLocal()
  • onUpload()
  • onMappingInputValue()
  • onSubmit()

onSearchFileFromLocal():

This event will be triggered when the browse file button is selected from the player's page

Possibilities:

  • cancelledWithoutSelectingAnyFile()
  • desiredFileIsFound()
  • desiredFileIsNotFound()

Jobs to be done:

  1. Open the user's local machine directory.

onSelectFileFromLocal():

This event will be triggered once a file is been selected from the local directory (proceeded from onSearchFileFromLocal())

Supported file extensions: .xlxs, .xls, .cvv

Possiblities:

  • selectedFileWithUnsupportedFormat()
    • Jobs to be done:
      1. Display error with message "file is unsupported" in the player's page

  • selectedFileWithSupportedFormat()
    • Jobs to be done:
      1. The path of the file must be set in the file-path-input

onUpload()

This event will be triggered when the user confirms the path in the file-path-input and clicks upload

Pre-requisite: A valid file-path must be provided in the file-path-input

Possibilities:

  • invalidPathIsProvided() (hard-coded by user)

    • Jobs to be done:
      1. Display error with message "Provide a valid path"
  • providedPathWithUnsupportedFile() (hard-coded by user)

    • Jobs to be done:
      1. Display error with message "file is unsupported"
  • uploadsWithValidPath()

    • Jobs to be done:
      1. Make a post-api-call to convert the raw fetched data to a prepared list of players data
      2. Set the prepared data to the player's input(can be random)
  • uploadsWithoutInternet()

    • Jobs to be done:
      1. Display error with the message "Connection could not be established, please check the internet!"

onMappingInputValue()

This event will is used to map the player's details(input-name) with the column of the prepared/fetched data (output of the upload())

Pre-requisite: input values should have been set(positive scenerio of onUpload() should have occured)

Possiblities:

  • mappedWithWrongColumn()

    • Jobs to be done:
      1. Display error with message "unsupported input value"
  • mappedWithMatchingColumn()

    • Jobs to be done:
      1. Set the selected column value to the corresponding input field

onSubmit()

This event will be triggered to store the player details(data) to the database.

Pre-requisite: All player-input-fields must be filled (onMappingInputValue() with positive scenerio)

Possibilities:

  • submitWithoutInternet()

    • Jobs to be done:
      1. Display an error with the message "Connection could not be established, please check the internet!"
  • submitWithoutInternet()

    • Jobs to be done:
      1. Request a post-API-call to store the player's details.
      2. clear all the input fields