The project flow
1. B2C website takes order on Shopify Front End.
2. Shopify captures payment
3. Once a day after review of orders scripts by API check for open orders and partially fulfilled orders
4. Open Orders by order id are compared to remote mongo database(scripts will run on same box for now).
5. If Open Order is not in MongoDB the order is written to database including product price, shipping payment received, state of order, has order been pushed to Big Commerce vendor API and order created.
5a. If Partial Order the ID will be checked and if there each item will be put into system if it doesn't exist and if it has been placed in BigCommerce vendor site by truth state in mongodb.
[login to view URL] script will read current orders in database that state Open/Partial they have not been pushed to bigcommerce site.
6a.A TDD test should check if a random order not in scope of orders on BigCommerce returns a false statement, and a correct item id that has been placed.
6b. When check is fine, script will push new orders that have not been place in BigCommerce account.
6c. Script will receive confirmation and write to MongoDB that order has ben placed and the BigCommerce Order ID(Which is different from the Shopify ID).
7. A separate script will ask the BigCommerce API if a Open/Partial Order has been fulfilled. The script will need to be aware if a order is partially filled, and take the tracking number and place it next to the item fulfilled. Then check again later (either manually or automatically(cron job is fine) until that order is fulfilled.)
8. Final script will check when a order if completely fulfilled based on open status of Shopify and Closed Status on BigCommerce.
8a. When state notes Open/Partial(Shopify) to Fulfilled(BigCommerce) the script will send by API to Shopify the tracking code to the correct order id and close/fulfill the order.
So we need scripts to:
1. read orders from shopify
2. write orders to mongodb database self hosted
3. check if order raises fraud score above (adjustable number 1-100). If above, order is held till approved by user in CLI - eventually website.
4. check if order has been placed in bigcommerce
5. If order has not been placed in bigcommerce system place order
6. check if order is fulfilled
7. when order is fulfilled write to database tracking #
8. check that order is fulfilled on mongodb with tracking number#
9. write tracking number to shopify API order and close order, write out to mondodb order is closed.
We need the source code to be in Python and all the source code.
Also a CLI interface asking if we want to process each order before sending to BigCommerce.
Code must be commented at each function, loop, class, etc. Please break down sections into separate .py files and not one monolithic section of code.