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

feat: add examples module to handle /examples endpoints #412

Merged
merged 54 commits into from
Nov 2, 2020

Conversation

karrui
Copy link
Contributor

@karrui karrui commented Oct 5, 2020

In tandem with #398, this PR will remove all traces of admin-console files and splits them up into /billing and /examples modules.

Problem

This PR extracts out functions related to the /examples root endpoint in various controllers and services and reorganises them into the modules/examples directory.

Related to #144

Solution

Improvements:

  • Add examples.queries file to contain all aggregate steps for querying/transforming example requests
  • Add examples.utils to create pipelines for the various queries with the various collections
  • Add examples.service that uses the utils to return example information
  • Add examples.factory that uses service functions depending on whether aggregate-stats feature is enabled in the FeatureManager
  • Add examples.controller that calls factory methods
  • Add examples.routes to handle /examples routes
  • Remove all unused examples related methods that have been supplanted by the above new files/methods.

Tests

  • Add unit tests for examples.service
  • Add unit tests for examples.factory
  • Add unit tests for examples.controller
  • Add integration tests for examples.routes

@karrui karrui marked this pull request as draft October 5, 2020 08:09
@karrui karrui force-pushed the ref/ts-aggregfactory branch 2 times, most recently from 33570a9 to 26dfc40 Compare October 6, 2020 13:38
karrui added 27 commits October 26, 2020 16:41
Copy link
Contributor

@mantariksh mantariksh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@arshadali172 arshadali172 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good stuff. very thorough!

# Conflicts:
#	src/app/models/form_feedback.server.model.ts
#	src/types/form_feedback.ts
#	tests/unit/backend/helpers/jest-express.ts
This makes it clearer as to how the `type` param is being used in the main function
@karrui karrui requested a review from arshadali172 November 2, 2020 04:03
@karrui karrui merged commit 6071c3f into develop Nov 2, 2020
@karrui karrui deleted the ref/ts-aggregfactory branch November 2, 2020 09:15
@mantariksh mantariksh mentioned this pull request Nov 3, 2020
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.

4 participants