Uploaded image for project: 'ERM Platform'
  1. ERM Platform
  2. ERM-1775

Regularly remove organizations that do not have any links to Licenses

    XMLWordPrintable

Details

    • ERM Sprint 119, ERM Sprint 120, ERM Sprint 121, ERM Sprint 122
    • Bienenvolk
    • R3 2021

    Description

      Purpose/Overview:

      If an organization is added to a License, an Org record is created. If the link between the License and the Org is later removed, and there are no remaining licenses using that Org, there is no mechanism for removing that Org record

      The impact on the user is that when searching for licenses, if you choose to filter by Organisation the list of Organizations can include Organizations that are not used by any License

      Scenario 1:

      • Given: an organization record¬†
      • Where: the organisation is
        • not linked to a license (part of a LicenseOrg)
      • Then: the organization (Org) record should be deleted as part of the regular license Housekeeping tasks

       

      Dev task breakdown

      • New method in cleanup service to be created as a part of ERM-1731
      • HQL query (or queries) to find all Orgs where the id of the org is not used on a license
        • Likely multiple queries
        • Initial query to find all Org ids, then for each:
          • Check count of LicenseOrg with that org attached
          • If count > 0, discard
        • Should be left with a list of Org ids it's safe to try and delete
        • Delete them all

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                ostephens Owen Stephens
                ostephens Owen Stephens
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases