Skip to content

Conversation

@cosmostevens
Copy link
Collaborator

Here's the Business Uploader!

  • Get Business/getAll: Returns List of all the Business documents in MongoDB
  • Put Business/insert: Adds a single business to MongoDB, if a business with the same id already exists it overwrites all the data. Returns that single Business document for confirmation.
  • Put Business/insertAll: Adds a List of businesses to MongoDB, if a business with the same id already exists it overwrites all the data. Returns that List of Businesses document for confirmation. This is most useful for transferring the edited backup database to the live Master database.
  • Put Business/update: Adds a single business to MongoDB, if a business with the same id already exists it overwrites all changed the data. Returns that single Business document for confirmation.
  • Put Business/updateAll: Adds a List of businesses to MongoDB, if a business with the same website already exists it merges the data. Returns that List of Businesses document for confirmation. This is most useful for uploading new data to a preexisting database.

Note: All of these functions are protected by ADMIN level authorization.

Process:

  1. Clean up data using DataBaseBuilder. This formats data in uniform manner, matches preexisting businesses with incoming data of the same business.
  2. Take cleaned data and upload it to "TestEthicliTwo" database using "Business/updateAll". This is a backup database and is the only one we change data in. The updateAll call merges the new data with the old data without any data loss.
  3. Run "Business/getAll" command on "TestEthicliTwo". Take returned data and run it through FindDuplicateData program. This double checks that there aren't any businesses with duplicate websites. Sometimes a few can sneak through the cracks. for the ones that do, go in and manually merge the data.
  4. Once this process is complete, run another "Business/getAll" call to get the fully processed/cleaned data. Go into MongoDB and delete the business data in "TestEthicli". Run "Business/insertAll" with the processed/cleaned data. This is a test run for uploading the data to the main database. If everything works correctly we continue to the final upload.
  5. Final Upload: delete old business in "Ethicli" database. As soon as the delete is confirmed, run "Business/insertAll" with processed data into the "Ethicli" database. Time is of the essence. This process takes about 20 seconds.

Edit Process Data:.....................TestRun Upload:..................Master DataBase:
.............|.................................................|...........................................|
.............V................................................V...........................................V
...TestEthicliTwo------------------>TestEthicli------------------>Ethicli

@cosmostevens cosmostevens linked an issue Jan 20, 2021 that may be closed by this pull request
@CubeOfCheese
Copy link
Owner

Seeing your detailed notes on the api made me think of this:
https://www.baeldung.com/spring-rest-docs

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.

Add Business Uploader

3 participants