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

Implemented a worker to trigger api calls for sync buttons of dashboard site #62

Merged
merged 8 commits into from
Mar 17, 2024

Conversation

Pavangbhat
Copy link
Contributor

@Pavangbhat Pavangbhat commented Mar 4, 2024

Date: 05-03-2024

Developer Name: Pavan Bhat


Issue Ticket Number

Closes: #60

Description

Created a worker that would trigger below mentioned endpoints for every hour

  • User Status Update:

    • Endpoint: /users/status/update
    • Method: PATCH
  • Idle (No Auth & Auto):

    • Endpoint: /users/status?aggregate=true
    • Method: GET
  • Batch Idle:

    • Endpoint: /users/status/batch
    • Method: PATCH

syncExternalAccountsButton

  • Endpoint: /external-accounts/users?action=discord-users-sync
  • Method: POST

syncUnverifiedUsersButton

  • Endpoint: /users/
  • Method: POST

syncIdleUsersButton

  • Endpoint: /discord-actions/group-idle
  • Method: PUT

syncNickNamesButton

  • Endpoint: /discord-actions/nicknames/sync?dev=true
  • Method: POST

syncIdle7dUsersButton

  • Endpoint: /discord-actions/group-idle-7d
  • Method: PUT

syncOnboarding31dPlusUsersButton

  • Endpoint: /discord-actions/group-onboarding-31d-plus
  • Method: PUT

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1

Test Coverage

Screenshot 1

image

Note: The code for lines 13 to 15 and 19 to 64 of the scheduleEventHandler function is currently addressed in a separate file named "missedRoleHandler.test.ts." But there is no existing file named "missedRoleHandler." therefore moving "missedRoleHandler.test.ts" to scheduleEventHandler should update the coverage correctly

Additional Notes

src/worker.ts Outdated Show resolved Hide resolved
@Pavangbhat Pavangbhat force-pushed the feature/sync-buttons branch from 8231e01 to 5e66a0d Compare March 14, 2024 16:46
@Pavangbhat Pavangbhat requested a review from joyguptaa March 14, 2024 18:24
src/worker.ts Outdated Show resolved Hide resolved
src/handlers/scheduledEventHandler.ts Show resolved Hide resolved
src/utils/apiCaller.ts Show resolved Hide resolved
src/worker.ts Outdated Show resolved Hide resolved
@iamitprakash iamitprakash merged commit f968f34 into develop Mar 17, 2024
1 check passed
@iamitprakash iamitprakash deleted the feature/sync-buttons branch March 17, 2024 13:33
@Pavangbhat Pavangbhat mentioned this pull request Mar 17, 2024
10 tasks
@Pavangbhat Pavangbhat mentioned this pull request Mar 26, 2024
10 tasks
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.

Automate Sync Buttons of Website-Dashboard
4 participants