Skip to content

Upload Process Map

richardbirkin edited this page Jul 5, 2024 · 2 revisions

IMG_2092

  • From the HTML Form we POST the upload to /page/upload.php
  • Read first row and convert to headings
  • Identify the file source from statement heading map
  • Strip NULL bits
  • Assign the columns for import
  • Store the file in the user's Unique ID folder

THEN

  • Grab the user's Banking Currency from User Settings
    • If Banking Currency = NULL, THEN load statement currency map and set currency based on statement currency
  • Create the upload in dB
  • Process upload into Usages
    • create product/artist map in memory
    • create temp csv files for data dump
    • internal lookup map for ISRC/UPC/Title
    • go over each row of uploaded file
    • extract the data we need
    • fill in the gaps from the internal lookup map
    • store original earning in original currency in the dB
    • add to temp csv
    • create currency exchange object from historical exchange rates
    • get exchange rate for earning week
    • add currency conversions to temp csv
    • commit temp csv's to dB
  • Caclulate un-cached earings for each product
  • Change product UPC/ISRC to somethign useful via third party API