Real-Dev-Squad / discord-slash-commands

MIT License
4 stars 26 forks source link

[Design Doc] for /notify Command #125

Closed sahsisunny closed 11 months ago

sahsisunny commented 1 year ago

Design Doc for /notify Command

Overview

The /notify command is designed to provide task deadline notifications and onboarding status monitoring for our Discord bot. This document outlines the technical details and implementation guidelines for this command.

User Stories

Command Structure

The /notify command will accept two primary options: "OVERDUE" and "ONBOARDING," each with their respective sub-options.

Option 1: OVERDUE

/notify OVERDUE: In 1 Day /notify OVERDUE: In 3 Days

Option 2: ONBOARDING

/notify ONBOARDING: > 31 Days /notify ONBOARDING: > 7D & < 31D

Technical Implementation

Command Parsing

Data Retrieval

OVERDUE

ONBOARDING

Error Handling

Sequence Diagram

sequenceDiagram
    participant User as User
    participant Bot as Discord Bot
    participant Backend as Railway Backend
    participant Firestore as Firestore DB

    User->>Bot: /notify OVERDUE: In 1 Day
    Bot->>Backend: Parse Command
    Backend->>Firestore: Retrieve Task Data
    Firestore-->>Backend: Task Data
    Backend->>Backend: Calculate Deadline
    Backend->>Backend: Filter Overdue Tasks
    Backend-->>User: List of Users with Overdue Tasks

    User->>Bot: /notify ONBOARDING: > 31 Days
    Bot->>Backend: Parse Command
    Backend->>Firestore: Retrieve User Onboarding Data
    Firestore-->>Backend: User Onboarding Data
    Backend->>Backend: Compare with Criteria
    Backend->>Backend: Identify Users
    Backend-->>User: List of Users Meeting Criteria

Response

Ex:

    **Message**

    @user1 @user2 @user3 @user4
    @user5 @user6 @user7 @user8

Testing

Documentation

Timeline

This design will be implemented as a part of the bot's functionality. The timeline for implementation will be determined based on project priorities.

j24m commented 1 year ago

LGTM

shreya-mishra commented 1 year ago

LGTM

prakashchoudhary07 commented 1 year ago

In the sequence diagram, for overdue you have mentioned that the discord bot will get task Data, calculate the deadline, and filter overdue tasks Similarly for onboarding also discord bot will receive user Data, and compare it with criteria and other calculations, How will it do it exactly? Wanted to ask how will discord bot get those Will it connect to the backend or Clouflare workers or Firestore?

prakashchoudhary07 commented 1 year ago
Error Handling

    There is no need to any custom input query so there is no chance to handle any errors.

I didn't understand what this exactly meant. Why is there no chance to handle errors?

prakashchoudhary07 commented 1 year ago
User Stories

    As an ADMIN/SUPER USER, I want to be able to use the /notify command to quickly identify users with overdue tasks.
    As an ADMIN/SUPER USER, I want to monitor the onboarding progress of new members based on predefined criteria.

Just clearing things up, the notify command will be used to notify users right? Or identify users, if yes then how?

Can you please elaborate second point please

prakashchoudhary07 commented 1 year ago

This command will notify a group of users at once right? Wouldn't it be better to notify them individually?

sahsisunny commented 1 year ago
Error Handling

    There is no need to any custom input query so there is no chance to handle any errors.

I didn't understand what this exactly meant. Why is there no chance to handle errors?

We are not taking any input from the user.

sahsisunny commented 1 year ago
User Stories

    As an ADMIN/SUPER USER, I want to be able to use the /notify command to quickly identify users with overdue tasks.
    As an ADMIN/SUPER USER, I want to monitor the onboarding progress of new members based on predefined criteria.

Just clearing things up, the notify command will be used to notify users right? Or identify users, if yes then how?

Can you please elaborate second point please

User Stories

    As an ADMIN/SUPER USER, I want to be able to use the /notify command to quickly identify users with overdue tasks.
    As an ADMIN/SUPER USER, I want to monitor the onboarding progress of new members based on predefined criteria.

Just clearing things up, the notify command will be used to notify users right? Or identify users, if yes then how?

Can you please elaborate second point please

It gives the list/tag in a group(like mention each commend) of users based on conditions.

sahsisunny commented 1 year ago

This command will notify a group of users at once right? Wouldn't it be better to notify them individually?

Yes, you're right. This command is designed to notify a group of users all at once. However, I'd like to understand more about the scenario where individual notifications would be beneficial. Could you please provide more details on the use case for notifying users individually? This would help me better understand your requirements and explore any potential improvements to the notification process.

sahsisunny commented 1 year ago

@prakashchoudhary07 If you prefer, we can also discuss this in more detail over a call.

prakashchoudhary07 commented 12 months ago

I just wanted to ask if we will get all tasks and onboarding data, and filter at the backend. or the DB will give the filtered results

prakashchoudhary07 commented 12 months ago

Nice, LGTM 🚀