hypothesis / lms

LTI app for integrating with learning management systems
BSD 2-Clause "Simplified" License
46 stars 14 forks source link

Task to export calculated numbers of the monthly reports back to HubSpot #6439

Closed marcospri closed 1 month ago

marcospri commented 1 month ago

For:

This PR needs a follow up to schedule the task in h-periodic.

To summarize the process we:

now, with this commit we:

Testing

Describing here the process I followed locally to test this end to end.

refresh_hubspot_data.delay()

update hubspot_company set lms_organization_id = 'local.lms.org.FFIHD9f1RwyLPfx14zM_7Q' where id = 11;

select * from organization_usage_report where organization_id in (1,2);
 id | organization_id |     tag      |                                   key                                   |   since    |   until    | unique_users | report |          created           |          updated           | unique_teachers 
----+-----------------+--------------+-------------------------------------------------------------------------+------------+------------+--------------+--------+----------------------------+----------------------------+-----------------
 11 |               1 | monthly-deal | local.lms.org.LDtcl7EUTeW2UERPJLAVtA-monthly-deal-2023-01-01-2023-07-31 | 2023-01-01 | 2023-07-31 |            0 | []     | 2024-06-18 10:33:22.193294 | 2024-06-18 10:33:22.193294 |               0
  2 |               2 | monthly-deal | local.lms.org.LDtcl7EUTeW2UERPJLAVtA-monthly-deal-2023-01-01-2024-01-31 | 2023-01-01 | 2024-01-31 |            0 | []     | 2024-06-18 10:29:28.260707 | 2024-06-18 10:29:28.260707 |               0
from lms.tasks.hubspot import export_companies_contract_billables; 
export_companies_contract_billables.delay()

Screenshot from 2024-07-10 15-09-17

marcospri commented 1 month ago

Merged the naming suggestions :+1:

Run the task locally to make sure everything lines up. A new import was created here https://app.hubspot.com/import/21081992

sentry-io[bot] commented 1 month ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎