create generic import script that handles the shape of the system data from csv files
Opened this issue · 1 comments
amir-kedis commented
- Generic module that handles the parsing and gets the data
- driver scripts
- these driver scripts are the following
- one takes a whole directory of sheets and imports them
- one that takes a single sheet and imports it
Sheets has 2 types:
- Captains sheet has only 1 sheet
- Scouts sheets has many sheets
Captains sheets requirements:
- First you will parse the captains sheet for sectors finding the unique names of sectors - split them into sectorBaseName and sectorSuffixName if a sector has only 1 work make the suffix name "أ"
- parsing the captains is as a follows if a captain didn't provide a phone number ignore his row
- if the number starts with a 2 or +2 remove it
- insert all the captains with the rest of the data insuring that they are linked right with there sectors
- There exist a hidden requirements here that you need to search for a solution for how would you assign the created sectors with unitcaptainids I tried to help you by putting after each unit captains the units the belong to his unit
Regarding parsing the scouts data:
- Make the name unique if the name is not unique add the id as a suffix for now
- Remove +2 or 2 from phone number
- Parse the dates in different formats
- if a scout does not have a enrollDate make it now
shehab299 commented
in progress