Skip to main content

Generating a report via Reporting (Ruby)

  1. Open a terminal/shell

  2. Open your Reporting project (Ruby)

  3. Make sure you have connected to the remote Cassandra database kubectl port-forward -n cassandra cassandra-cassandra-0 9042:9042

  4. Set your version of Ruby rvm use 2.6.1

  5. Run bundle exec rails c

  6. You should now be in the Ruby interactive terminal

    Try test:
    Agency.where(agency_id:'{uuid goes here}')
  7. Run a report, for example: TenancySchedule.call('{agency_id}','excel')

  8. Copy the report: cp /tmp/commissionreport-1657684190624.xlsx commissionreport-1657684190624.xlsx

  9. When using dates please use:

    Format: '%Y-%m-%d'
    Special Note: “2021-10-31&.to_date&.end_of_day (You have to add &.to_date&.end_of_day to make sure time is added to the date obj)

Option 2: Jump into the pod

Using REPL execute the report remotely.

  1. Tunnel into the reporting pod using:

    kubectl -n banking exec -it reporting-images-web-0 bash
    # bundle exec rails c
  2. Then choose the report you want to generate and run it:

    TenancySchedule.call('{agency_id}','excel')

    AgencyGroupCommissionSplit.call("754cceb6-f295-4d05-85c8-9d7ca4edeb1b", '2022-11-1'&.to_date&.end_of_day,'2022-11-31'&.to_date&.end_of_day,"excel")
  3. Then copy the report to your local drive:

    kubectl cp banking/reporting-images-web-0:/tmp/deposit-report-f64fc8d1-e3b7-4269-9787-fc7e3699feb3.xlsx /tmp/deposit-report/deposit-report-f64fc8d1-e3b7-4269-9787-fc7e3699feb3.xlsx