Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AT submission import #4620

Merged
merged 79 commits into from
Aug 7, 2024
Merged

Add AT submission import #4620

merged 79 commits into from
Aug 7, 2024

Conversation

perryr16
Copy link
Contributor

@perryr16 perryr16 commented Apr 10, 2024

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?

  • 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:
    1. returns the submissions from AT for a given city.
    2. finds matching SEED views using custom_id_1 and cycle start/end.
    3. gets xmls from AT for matching SEED views
    4. groups the data by cycles
    5. 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, audit_template_sync_enabled, audit_template_status_type, and audit_template_conditional_input
  • Front end modal to start city submission import.
  • Updates inventory detail "Update with Audit Template" to use submission endpoints.
  • Adds an "Update with Audit Template" to the Inventory List actions dropdown.
  • 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
  • Removes support for the Audit Template get buildings endpoints. All functions that previously used these endpoints have been deleted or updated to use the submission endpoints
  • 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'. Matches are determined using AT 'created_at' within the cycle start and end. If the audit_template_conditional_input boolean is checked, matches will be limited to those with AT 'updated_at' more recent than SEED 'updated_at '.

How should this be manually tested?

This can only be tested with an Audit Template account that has submissions. Example: 179D AT account.
CONFIGURATION

  • make sure AUDIT_TEMPLATE_HOST is pointed to the url associated with your AT account
  • Configure the following audit template settings in Organization Settings: City ID, Submission Status, & Conditional Input
  • 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 the submission status configured in organization settings.

IMPORT FROM AT

  • From organization settings > audit template, manually trigger a sync with the "Import Submissions" button
  • From data import > Import Audit Template Submissions
  • From inventory detail > actions > Update with Audit Template
  • From inventory list > make a selection > actions > Update with Audit Template
  • Properties should have been updated.

AUTO SYNC

  • From org settings > audit template, enable "Audit Template Auto Sync" and set time to the next minute.
  • Ensure properties were updated.

What are the relevant tickets?

#4544

Screenshots (if appropriate)

Screenshot 2024-07-30 at 12 45 45 PM Screenshot 2024-07-30 at 12 46 17 PM Screenshot 2024-08-07 at 1 08 42 PM

@perryr16 perryr16 added DO NOT MERGE Feature Add this label to new features. This will be reflected in the change log when generated. labels Apr 10, 2024
Copy link
Contributor

@kflemin kflemin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏆🏆🏆

@kflemin kflemin merged commit dc03dc0 into develop Aug 7, 2024
9 checks passed
@kflemin kflemin deleted the 4544-AT-submission-import branch August 7, 2024 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Add this label to new features. This will be reflected in the change log when generated.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants