Skip to content

Commit

Permalink
Merge pull request #354 from idurar/dev
Browse files Browse the repository at this point in the history
IDURAR 2.0.1 Release
  • Loading branch information
salahlalami authored Aug 26, 2023
2 parents 5c60fe0 + 3b96dce commit f229c1e
Show file tree
Hide file tree
Showing 57 changed files with 21,510 additions and 629 deletions.
21 changes: 21 additions & 0 deletions .ergomake/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'
services:
app:
# This example uses an image, but for your own application,
# you should use a Dockerfile. See the documentation for more information.
image: ergomake/ergomake-example
ports:
# The first port here will be the one our link points to.
- 3000:3000
environment:
# Our application uses this environment variable to determine
# where to connect to the Redis instance.
REDIS_URL: "redis://redis:6379"

# You can add databases in a similar way.
# We use the service name as the hostname in the URL.
redis:
image: redis
ports:
# We don't want to expose this port, so we don't bind it to localhost.
- "6379"
128 changes: 128 additions & 0 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[email protected].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
<div align="center">
<a href="https://www.idurarapp.com/">
<img src="https://avatars.githubusercontent.com/u/50052356?s=200&v=4" width="128px" />
</a>
<h2>IDURAR</h2>
<p align="center">
<p>Simple To Use </p>
</p>

[https://idurarapp.com](https://www.idurarapp.com/)




# ERP / CRM Open Source based on (Node.js/React.js)

IDURAR is Open Source ERP / CRM (Invoice / Inventory / Accounting / HR) Based on Advanced Mern Stack (Node.js / Express.js / MongoDb / React.js ) with Ant Design (AntD) and Redux
</div>

```
Dont forget to give a ⭐️ to this project ... Happy coding! 🤩
Expand Down Expand Up @@ -124,6 +139,39 @@ Once the website is up and running, you can log in using the following credentia

Now you should be all set to run the project locally on your machine and explore its features.

## Contributing

1.[How to contribute](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#how-to-contribute)

2.[Reporting issues](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#reporting-issues)

3.[Working on issues ](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#working-on-issues)

4.[Submitting pull requests](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#submitting-pull-requests)

5.[Commit Guidelines](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#commit-guidelines)

6.[Coding Guidelines](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#coding-guidelines)

7.[Questions](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#questions)
## Star History

Here you can see the proxy of our growth on the platform and that we're only getting started.

But if you'd like to check it out more news and website you can always check it out on: https://www.idurarapp.com/.

[![](image.png)](https://star-history.com/#idurar/idurar-erp-crm)

## License

MIT/Massachusetts Institute of Technology(here [LICENSE](https://github.com/Fernando7181/idurar-erp-crm/blob/master/LICENSE))

The IDURAR code is licensed by Massachusetts Institute of Technology.

By contributing to IDURAR, you will be agreeing that your contributions will be licensed under its Massachusetts Institute of Technology(MIT).



## Show your support

Dont forget to give a ⭐️ to this project ... Happy coding!
2 changes: 1 addition & 1 deletion controllers/corsControllers/apiRest.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ exports.create = async (Model, req, res) => {
// Creating a new document in the collection

const result = await new Model(req.body).save();
console.log(result);

// Returning successfull response
return res.status(200).json({
success: true,
Expand Down
1 change: 0 additions & 1 deletion controllers/corsControllers/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ exports.search = async (Model, req, res) => {
})
// limit to only 5 messages
.limit(10);
console.log(results);
}

if (results.length >= 1) {
Expand Down
108 changes: 107 additions & 1 deletion controllers/erpControllers/clientController.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,108 @@
const mongoose = require('mongoose');
const moment = require('moment');
const Model = mongoose.model('Client');
const crudController = require('../corsControllers/crudController');
module.exports = crudController.createCRUDController('Client');
const methods = crudController.createCRUDController('Client');

methods.summary = async (req, res) => {
try {
let defaultType = 'month';

const { type } = req.query;

if (type) {
if (['week', 'month', 'year'].includes(type)) {
defaultType = type;
} else {
return res.status(400).json({
success: false,
result: null,
message: 'Invalid type',
});
}
}

const currentDate = moment();
let startDate = currentDate.clone().subtract(1, 'month').startOf('month');
let endDate = currentDate.clone().subtract(1, 'month').endOf('month');

if (defaultType === 'week') {
startDate = currentDate.clone().subtract(1, 'week').startOf('week');
endDate = currentDate.clone().subtract(1, 'week').endOf('week');
}
if (defaultType === 'year') {
startDate = currentDate.clone().subtract(1, 'year').startOf('year');
endDate = currentDate.clone().subtract(1, 'year').endOf('year');
}

const totalClients = await Model.countDocuments({
removed: false,
created: {
$gte: startDate.toDate(),
$lte: endDate.toDate(),
},
enabled: true,
});

const result = await Model.aggregate([
{
$match: {
removed: false,
created: {
$gte: startDate.toDate(),
$lte: endDate.toDate(),
},
enabled: true,
},
},
{
$group: {
_id: null,
new: {
$sum: { $cond: [{ $eq: ['$removed', false] }, 1, 0] },
},
active: {
$sum: { $cond: [{ $eq: ['$enabled', true] }, 1, 0] },
},
},
},
{
$project: {
_id: 0,
new: {
$multiply: [{ $divide: ['$new', totalClients] }, 100],
},
active: {
$multiply: [{ $divide: ['$active', totalClients] }, 100],
},
},
},
]);

if (!result || !result.length) {
return res.status(200).json({
success: true,
result: {
new: 0,
active: 0,
},
message: 'Successfully get summary of new clients',
});
}

return res.status(200).json({
success: true,
result: result[0],
message: 'Successfully get summary of new clients',
});
} catch (error) {
return res.status(500).json({
success: false,
result: null,
error: error,
message: 'Oops there is an Error',
});
}
};

module.exports = methods;
Loading

0 comments on commit f229c1e

Please sign in to comment.