This repository has been archived by the owner on Aug 21, 2024. It is now read-only.
refactor(analytics): use hooks and resolvers #9028
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
🤖 Generated by Copilot at edd0b45
The pull request migrates the analytics service to use the new
KnexService
class and the latest version of@feathersjs/knex
, which simplifies the service logic and removes unnecessary dependencies. It also adds custom hooks for querying and returning analytics data fordailyUsers
anddailyNewUsers
metrics. The affected files areanalytics.class.ts
,analytics.hooks.ts
, andanalytics.ts
in thepackages/server-core/src/analytics/analytics
directory.References
closes part of #8871
Explanation
🤖 Generated by Copilot at edd0b45
@feathersjs/knex
and simplify theAnalyticsService
class (link, link, link)dailyUsers
anddailyNewUsers
queries from the service class to the hook functions (link, link, link, link)discardQuery
hook to remove theaction
query parameter after it is processed by the custom hooks (link, link)iff
hook to conditionally apply the custom hooks based on the query parameteraction
(link)knexClient
and the constantsinstanceAttendancePath
anduserPath
to perform the database queries for the custom hooks (link)AnalyticsType
andAnalyticsService
types to type the hook context and the service instance (link)🤖 Generated by Copilot at edd0b45
QA Steps
List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.
Checklist