Swapsea/swapsea

Refactor surfguard uploads via Admin UI to use staging table

Opened this issue · 0 comments

The automated SurfGuard report imports (using code in the swapsea-report-scraper repo) push data into staging tables that are then processed by a console job.

The mechanism using file upload via the Admin console was developed earlier and is less reliable since it processed synchronously.

Solution

Change the Admin Ui so it just uploads CSV files to the newer staging tables, and calls the code to transfer that to the target tables

  • StagingAward.transfer
  • StagingUser.transfer
  • StagingPatrolMember.transfer

It's also desirable to have these transfer methods do a little more logging to indicate # records processed, and from which Club.