Standard Energy Efficiency Data (SEED) Platform™ is a web-based application that helps organizations easily manage data on the energy performance of large groups of buildings.
Sharing buildings between admins and users on Audit Template is non trivial. Resulting imports from AT might not contain all relevent buildings to the user. The existing city submission endpoint circumvents this issue.
What's this PR do?
Integrates the audit template city submission endpoint into SEED through a batch_get_city_submission_xml function. This is the driving function behind the new functionality, and it performs the following:
returns the submissions from AT for a given city.
finds matching SEED views using custom_id_1 and cycle start/end.
gets xmls from AT for matching SEED views
groups the data by cycles
leverages existing function batch_update_with_building_sync in cycle batches.
Adds the ability to automatically update your inventory on a schedule. This is done through a new model AuditTemplateConfig and accompanying viewset (similar to Salesforce integration).
Adds new org fields audit_template_city_id and audit_template_sync_enabled
Front end modal to start city submission import.
Refactors the existing Audit Template endpoints to use fewer requests to the AT API.
Adds a developer test to aid in future submission related work
Other small refactors
Limitations and Potential Issues
Audit template submission responses do not contain an audit date, all we have is 'updated_at' or 'created_at'. Changing the status of a submission will reset its 'updated_at', this will change the matching view to the view in the current year's cycle. Would 'created_at' make more sense?
Submissions endpoint only returns submissions that are marked as 'Received'
How should this be manually tested?
This can only be tested with an Audit Template account that has submissions. Example: 179D AT account.
make sure AUDIT_TEMPLATE_HOST is pointed to the url associated with your AT account
Because properties are only updated if the Submission's updated_field is more recent than the property's updated field this can only be tested on a cycle containing today's date.
Within the current year's cycle, update properties Custom ID 1s to the Portal IDs on Audit Template cities page
Update submissions to allow matching. To update a submission on Audit Template, click the gear on a submission and change its status to "Review" then back to "Received"
From organization settings > audit template, manually trigger a sync with the "Sync Submissions" button
Properties should have been updated. Total properties updated can be misleading if there are duplicate AT Portal IDs
Test the auto sync function
From org settings > audit template, enable "Audit Template Auto Sync" and set time to the next minute.
Any background context you want to provide?
Sharing buildings between admins and users on Audit Template is non trivial. Resulting imports from AT might not contain all relevent buildings to the user. The existing city submission endpoint circumvents this issue.
What's this PR do?
batch_get_city_submission_xml
function. This is the driving function behind the new functionality, and it performs the following:batch_update_with_building_sync
in cycle batches.audit_template_city_id
andaudit_template_sync_enabled
Limitations and Potential Issues
How should this be manually tested?
This can only be tested with an Audit Template account that has submissions. Example: 179D AT account.
updated_field
is more recent than the property'supdated
field this can only be tested on a cycle containing today's date.Custom ID 1
s to the Portal IDs on Audit Template cities pageWhat are the relevant tickets?
4544
Screenshots (if appropriate)