Decouple package formats with format-specific classes
## Problem Currently all package formats are tight to one Active Record model `Packages::Package`. This makes it's hard (or even impossible) to assign separate database table per package format, because **one** Active Record model means **one** datable table. In order to prepare the packages codebase for the possible future table [decomposition](https://gitlab.com/gitlab-org/gitlab/-/issues/485512) we need to split `Packages::Package` model into multiple models, one for every package format. ```mermaid flowchart TB; Packages::Package --> Packages::TerraformModule::Package Packages::Package --> Packages::Nuget::Package Packages::Package --> Packages::Maven::Package ``` ```mermaid flowchart TB; Packages::Package --> Packages::Conan::Package Packages::Package --> Packages::Debian::Package Packages::Package --> Packages::Composer::Package ``` ```mermaid flowchart TB; Packages::Package --> Packages::Rubygems::Package Packages::Package --> Packages::Rpm::Package Packages::Package --> Packages::Npm::Package Packages::Package --> Packages::Helm::Package ``` ```mermaid flowchart TB; Packages::Package --> Packages::Golang::Package Packages::Package --> Packages::Generic::Package Packages::Package --> Packages::Pypi::Package ``` In addition to that, the [`Packages::Package`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/models/packages/package.rb) contains the logic for all package formats and continue growing with every new package format and the new functionality. The complexity of maintainability grows simultaneously. ## Solution Extract every package format from `Packages::Package` model to its own model, e.g., `Packages::Npm::Package`, `Packages::Maven::Package` and update all related files like services, finders and API endpoints accordingly.
epic