Giter Club home page Giter Club logo

vacabot's People

Contributors

bhavesh27 avatar izzur avatar kcomrade53 avatar muh-hasan avatar mukarramali avatar neodark avatar oktak avatar redice44 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

vacabot's Issues

Update DEFAULT_VACATION_BALANCE wherever required

Even though DEFAULT_VACATION_BALANCE has been created in consts.js, still in models/users.js we have hardcoded values for default vacation balance. Replace it with the defined const imported from consts.js.

Move out functions from models wherever pure functions are possible

Currently, we have so many instance and class methods, which makes new changes difficult.
If we can move out a few responsibilities as utility methods in the helper file, we can improve readability and adaptability.

Example:
user model have this method:

userSchema.methods.generateChannelId = function () {
  let self = this;
  return new Promise((resolve, reject) => {
    triggerSlack(C.CHANNEL_ID_URL, { users: self.userId }).then((res) => {
      if (res.channel) {
        self.channelId = res.channel.id;
        self.save();
        resolve(res.channel.id);
      } else {
        reject();
      }
    });
  });
};

An instance method shouldn't be responsible for making an API call.
This can be an external function which receives userId and then we can just call update user method with a new channelId.

Add screenshot of the Slack Bot

You can join the slack community given in README.
Take a look at general channel.
Use the app yourself, take out screenshots for each feature.
Add those screenshots in docs, also add a new markdown file which shows all these screenshots.
Show a link to this markdown in README as "Demo" or something.

Setup hot reloading

Right now every change in code needs a restart of the server.
For hot reloading, you can use any of the solutions available for NodeJS. Webpack suggested.

Move out slack documentation from README

README is very cluttered right now. Only because of slack documentation with images.

Suggestion:

Create another documentation file in docs folder and move out Slack integration steps from README. And only add the link for the new document.

Never allow vacation to go in negative

reduceVacationBalance function in models/vacation.js allows vacation to go even in negative.
First step could be making 0 minimum.
Second step could be to reject vacation request when vacation reached below zero.

Add a .prettierrc with some standard guidelines

It doesn't have to be endless.
This repo is to promote new developers mostly. So we need some setup that enforces these rules and reduces the time in PR approvals.
We can have rules like tab size, auto indentations, formatting on save.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.