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/backend/deep user based analytics #350

Merged
merged 40 commits into from
Sep 3, 2024

Conversation

waveyboym
Copy link
Member

@waveyboym waveyboym commented Sep 3, 2024

Description

This pr aims to introduce analytics endpoints to the system. These will allow a user to make queries with time ranges for various things about a specific worker or all the workers in the office space. We have thus introduced these features in this pr:

  1. user hours and all worker hours
  2. user average hours and all worker average hours
  3. user work ratio and all workers work ratio
  4. user peak office hours and all worker peak office hours
  5. user average office arrival and departure times and all workers as well
  6. user in office rate and all workers too
  7. most active employee(in terms of hours spent at work)
  8. least active employee(in terms of hours spent at work)

We also added another final endpoint which just allows a user to toggle their onsite status between on site and off site at any time of the day(between office hours) and lastly to toggle their status not once but literally an infinite amount of times in a day(so long as it is between office hours).

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Wrote a plethora of unit tests to back the new features being introduced

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@waveyboym waveyboym added type: documentation Improvements or additions to documentation type: feature A new feature type: testing This affects one or more tests For: api This is mainly for the api For: backend This is mainly for the backend code priority: medium This does/did not need to be addressed soon but should have plans in place to be addressed effort: 8 This may require/required a week of work at minimum For: deployment This will affect our deployed system labels Sep 3, 2024
@waveyboym waveyboym self-assigned this Sep 3, 2024
@waveyboym waveyboym added this to the Week 3 Sprint 4 milestone Sep 3, 2024
Copy link

codecov bot commented Sep 3, 2024

Codecov Report

Attention: Patch coverage is 83.11688% with 39 lines in your changes missing coverage. Please review.

Project coverage is 90.28%. Comparing base (9bb99ad) to head (5dc0a94).
Report is 46 commits behind head on develop.

Files with missing lines Patch % Lines
occupi-backend/pkg/database/database.go 79.54% 36 Missing ⚠️
occupi-backend/pkg/database/database_helpers.go 88.00% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #350      +/-   ##
===========================================
+ Coverage    89.07%   90.28%   +1.21%     
===========================================
  Files           53       10      -43     
  Lines         3166     2100    -1066     
  Branches        84        0      -84     
===========================================
- Hits          2820     1896     -924     
+ Misses         263      160     -103     
+ Partials        83       44      -39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@waveyboym waveyboym merged commit ec62f78 into develop Sep 3, 2024
7 of 8 checks passed
@waveyboym waveyboym linked an issue Sep 15, 2024 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: 8 This may require/required a week of work at minimum For: api This is mainly for the api For: backend This is mainly for the backend code For: deployment This will affect our deployed system priority: medium This does/did not need to be addressed soon but should have plans in place to be addressed type: documentation Improvements or additions to documentation type: feature A new feature type: testing This affects one or more tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REFACTOR] Mongo-db operations for analytics group endpoints
1 participant