oact io orders in.py

.

oact_io_orders_in.py

  1. Get a list of all operators in the system.
  2. Loop through each "Orders" folder searching for .csv files to import.
  3. Open the files and parse the data (certain data-type conversions and validations).
  4. Insert the orders in blocks of 100 rows. 2 attempts are made (in case of any temporary blockages).
    1. Working with blocks of 100 reduces traffic and increases speed when handling many rows (multiple tens or hundreds of thousands). The tradeoff is that if data for one order is in error, 100 orders will fail (error loging may therefore be approximate). Developers could adjust or remove this block-size, increasing or decreasing based on available system resources, and testing the overall performance of OACT.
  5. For each file, include "receipt" data in the logfile, listing the imported external_id, id, and aggregation_id . The receipt data is semi-colon delimited. This can be printed to a separate file if required, but should not be created in the import folder with a .csv extension.
  6. Lockfile management, error-handling, and logging throughout the whole process, via oact-commons.py.
  • If the GUI experience is tedious during large order-imports, consider introducing a SLEEP command in the import script after each 10.000 rows inserted. This should be unnecessary unless importing multiple 100.000's of rows in a single run.

Backlinks:
OACT-Handbook:3. Functional Specifications:2. Incoming Orders
OACT-Handbook:2. Technical Specification:3. Software Installation Package:2. Program Files Contents
OACT-Handbook:3. Functional Specifications:9. For Technical Users:8. Logging
OACT-Handbook:3. Functional Specifications:9. For Technical Users:2. Data Traffic:Importing to OACT
OACT-Handbook:3. Functional Specifications:9. For Technical Users:7. Architecture and Integration:Integrated Database
OACT-Handbook:2. Technical Specification:4. Installation and Configuration
OACT-Handbook:3. Functional Specifications:9. For Technical Users:7. Architecture and Integration:Disposable PHP and Python
OACT-Handbook:3. Functional Specifications:9. For Technical Users:9. General Storage:System variables