Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored the backend code #13

Merged
merged 10 commits into from
Oct 4, 2024
Merged

Conversation

ruslanbaidan
Copy link
Contributor

The code refactoring includes the following parts:

  • Removed the relying on the abstraction and sharing the same methods execution of services.
  • Implemented the single responsibility approach to the entities.I
  • Added the filtering functionality to process the incoming get requests data and prepare them for the filter and sort queries.
  • Added the data validation at first place. Before the post, put, patch and delete requests data are passed to the services, they are validated.
  • Removed the dependency on the abstract table common methods, where the entities positions were processed, and some specific code run.
  • Implemented the common approach, not resources/time consuming, of the entities positioning based on interfaces and traits.
  • Optimised the export and import functionality to be clean and fast.
  • Added a common place to validate the analysis access and endpoints permissions before the controllers’ actions are reached. The Middleware passed an anr object to the actions automatically as an attribute.
  • Restructured the components and code parts of the application for the based on responsibilities, relations and to be more clear.
  • Removed many deprecated code parts and cleaned up the deprecated columns in the DB tables.
  • Improved some DB indexes and renamed tables, columns to be more clear on the names.
  • Added some first unit tests as a starting point for the full coverage.

Not refactored parts are the following: Questions, QuestionsChoices, Guide, Interviews, ROPA, Deliverable.

User stories.

  • Added the application version display to the left panel.
  • Added possibility to export risk analysis with Knowledge Base (KB) and/or Assets Library (AL). That allows to optionally export all the KB a AL data without having the analysis modelling started. This is needed for sharing models between FrontOffices or update AL or KB with new versions of the structures.
  • Changed the export format of JSON export file to reduce its size and be similar to the api endpoints responses and the projects structures views. An old data converter is implemented for the backward compatibility.
  • Significantly improved the import time and made it always consistent. In case of import issues the data are not inserted, there are saved in the DB only at the end of the process (transactional approach).
  • Removed extra user’s information from password reset response and removed the endpoint access by the other users (points 5.1.1, 5.1.2).
  • Restricted analysis creation based on the models that are not available for the client by manually faking the request (point 5.2.3).

Ruslan Baidan added 10 commits June 21, 2022 14:55
…bstract

* origin/master: (29 commits)
  Added the checkout to the latest tags for ng packages.
  Updated the version and the dependencies.
  Update releases.yml
  Update link_modules_resources.sh
  Update releases.yml
  Update releases.yml
  Updated the backoffice dev with the fix of clients' search.
  Updated the Core dependency with the fix of models duplication.
  Downgraded the version of the laminas-dependency-plugin dependency to fix cross dependencies issues.
  Updated the core dependency version with the fixes.
  updated dependency to monarc/backoffice and new QRCode backend.
  fixed link of dependencies
  chg: [dependencies] Updated JavaScript dependencies.
  FIxed the doctrine driver class.
  chg: [ci-releases] Do not install dev packages.
  prepare pull-request with correct branch
  [skip ci] allowing dash in release tags
  removing partials symlinking in ng_backoffice
  pinning ng-anr and ng-backoffice versions
  release workflow initial release
  ...

# Conflicts:
#	composer.json
#	composer.lock
#	config/autoload/global.php.dist
…bstract

* origin/master:
  Added the PROJECT_ROOT definition and usage in the core lib patch.
  Updated the backoffice dependency with the 2FA fix.
  Updated the backoffice dependency with added the missing space in the sql.
  Updated the backoffice dependency with the password reset when clients' 1st user's email is changed.
  Updated the backoffice dependency with the reset 2FA feature.
  Updated the Core dependency with the fix of typcasting.
…bstract

* origin/master:
  Updated the dependency with "Fixed all the clients' models unlink when a single one is removed.".
  Added definition and usage of the DATA_PATH global const.

# Conflicts:
#	composer.lock
@ruslanbaidan ruslanbaidan merged commit ac7ccee into master Oct 4, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant