MonarcAppFO icon indicating copy to clipboard operation
MonarcAppFO copied to clipboard

Import of recommendations with the same code but different uuid

Open ruslanbaidan opened this issue 5 years ago • 0 comments

The bug description. When we import an analyse into an existed one and there is a recommendation with the same code in the same recommendation set is already presented in the knowledge base, but their UUIDs are different, we get an error which prevents us to finish the import.

To Reproduce

  1. Create an analyse (1) and add a recommendation with the same code as in the other one (e.g. "Rec1")
  2. Export the analyse (1).
  3. Create another analyse (2) and add a recommendation with the same code as in the other one (e.g. "Rec1")
  4. Import the analyse (1) into analyse (2). At the step 4 we should get an error

Proposed solution: During the import we currently check if recommendation is presented in the DB with the UUID. We can add an additional check (if result of the UUID validation is negative = "not presented") if a recommendation with the code is already presented in the set. if yes, then we rename the imported recommendation code (for example add a suffix "Duplicated" or "Copy"). The other solution is just to merge them - assume the recommendations are the same and use a single UUID.

ruslanbaidan avatar Apr 15 '20 08:04 ruslanbaidan