Add wrappers around profiles to build associations
Description
CSP Request Details
CSP Rejection Details
Environment
Potential Workaround
Attachments
defines
has to be done before
is defined by
relates to
Checklist
hideTestRail: Results
Activity
Ann-Marie Breaux September 11, 2023 at 3:10 AM
Hi and All looks good - thank you for all the wrappers work!
All 4 existing linked TestRails look good too. Phew!
When you have a few minutes, please test a job profile creation on Snapshot or Snapshot-2 with repeated match and/or action profiles, and let me know if it behaves roperly now. We have made some changes to the structure of the job profiles that should allow 1) repeated matches and actions and 2) if repeated, the matches/actions can be in different order, or not parallel in different sections of the job profile.
Maksym Ishchenko September 6, 2023 at 9:24 AM
Hello
Ticket verified on snapshot env.
1. No error appears after doing mirrored job profile:
2. No additional profiles are added after the creating of the mirrored job profile
3. After deleting one of the action profiles in the complicated job with the repeatable profiles, only one action profile deleted, not all repeatable
4. Duplicating job with repeatable profiles works without any errors
Moving ticket to In review column.
cc:
Roman Chernetskyi June 16, 2023 at 2:02 PM
Hi, , as far as I going on vacation the rest of the ticket passed to you. Part of my implementation you can find on branch MODDICONV-310
What has already been done:
Created migration scripts for new profile wrappers table and edited existing association tables
Changed association_view to support wrappers_id columns
Changed get_profile_association_snapshot function to support wrappers_id columns
Created DAO for profilewrappers
Changed functionality for saving associations and job profile relations (we are creating a profile wrapper for each association under the hood)
What should be done:Create a rule in the association_view table to delete the related profile_wrapper rows upon the deletion of the association
Implement endpoint for a direct update of association (new wrapper per master and detail profile should be created)
Implement updating of job profile relations (negotiate with BE team possible ways to change UpdateDto to differentiate the identic profiles during update)
Implement test
Feel free to contact me if you have any questions
Add table profile_wrappers (wrapper_id, profile_type, profile_id)
Change association structure:
masterprofileid --> masterwrapperid,
detailprofileid --> detailwrapperid
Change functionality responsible for operations over Associations - when they are saved in the DB for every parent and child element a new wrapper entity should be created, and the association should reference the wrapper id instead of the actual profile id
Change functionality responsible for construction of the JobProfile tree - add step to retrieve the actual profile by the wrapper id, stored in the associations.
Fix tests
Additional questions to discuss:
Should we get rid of created_date and created_by columns? They are empty now and are not used, this info is valid only for the particular JobProfile, and we store this information there - yes, get rid of them in scope of
What the order and triggered fields are for? do we need them? - order is used for constructing a Job Profile, triggered is not used, get rid of it in scope of
Maybe we should get rid of json structure for association altogether, and store all necessary info in relational form? - yes
DIscuss with Olamide - do we need 4 tables to store associations, or should we combine them in one? - store associations in one table
Additional changes described above should be done in scope of
Notes:
Migration script will be created in scope of a separate story
Risky to back-port, because of changes in the DB schema and migration