Add paper_trail versions tracking for add on seats assignment history
Summary
For analytical and audit purposes we need a way to retrieve historical data of seats assignment for particular addon purchase.
Proposal
- Use paper_trail for basic versioning functionality. See https://gitlab.com/gitlab-org/gitlab/blob/301f08e51bbf47bb6ca72a7df7fd8bf37e91a8de/ee/app/models/remote_development/workspaces_agent_config.rb#L16-18 for example implementation
- Apply
paper_trailtoUserAddOnAssignmentmodel. - Adjust
AddOnAssignedUsersFinderto acceptfrom, toparams which will allow us to retrieve assigned user for given timeframe. Finder should return current state if params are not provided. (out of scope of this issue. should be done in #498633 (closed))
Fields to be stored on paper trail table
- assignment_id - used to duplicate records on CH
- item_id - the actual assignment record id (managed by papertrail)
- namespace_id - as traversal path
- add_on - The add-on name
- user_id - Allows filtering historical data per user
- purchase_id - Allows to filter specific assignments per purchase
- created_at
Edited by Felipe Cardozo