Skip to content

Commit f229c1e

Browse files
authored
Merge pull request #354 from idurar/dev
IDURAR 2.0.1 Release
2 parents 5c60fe0 + 3b96dce commit f229c1e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+21510
-629
lines changed

Diff for: .ergomake/docker-compose.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: '3'
2+
services:
3+
app:
4+
# This example uses an image, but for your own application,
5+
# you should use a Dockerfile. See the documentation for more information.
6+
image: ergomake/ergomake-example
7+
ports:
8+
# The first port here will be the one our link points to.
9+
- 3000:3000
10+
environment:
11+
# Our application uses this environment variable to determine
12+
# where to connect to the Redis instance.
13+
REDIS_URL: "redis://redis:6379"
14+
15+
# You can add databases in a similar way.
16+
# We use the service name as the hostname in the URL.
17+
redis:
18+
image: redis
19+
ports:
20+
# We don't want to expose this port, so we don't bind it to localhost.
21+
- "6379"

Diff for: CODE-OF-CONDUCT.md

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

Diff for: README.md

+48
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
1+
<div align="center">
2+
<a href="https://www.idurarapp.com/">
3+
<img src="https://avatars.githubusercontent.com/u/50052356?s=200&v=4" width="128px" />
4+
</a>
5+
<h2>IDURAR</h2>
6+
<p align="center">
7+
<p>Simple To Use </p>
8+
</p>
9+
10+
[https://idurarapp.com](https://www.idurarapp.com/)
11+
12+
13+
14+
115
# ERP / CRM Open Source based on (Node.js/React.js)
216

317
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
18+
</div>
419

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

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

142+
## Contributing
143+
144+
1.[How to contribute](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#how-to-contribute)
145+
146+
2.[Reporting issues](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#reporting-issues)
147+
148+
3.[Working on issues ](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#working-on-issues)
149+
150+
4.[Submitting pull requests](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#submitting-pull-requests)
151+
152+
5.[Commit Guidelines](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#commit-guidelines)
153+
154+
6.[Coding Guidelines](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#coding-guidelines)
155+
156+
7.[Questions](https://github.com/idurar/idurar-erp-crm/blob/master/CONTRIBUTING.md#questions)
157+
## Star History
158+
159+
Here you can see the proxy of our growth on the platform and that we're only getting started.
160+
161+
But if you'd like to check it out more news and website you can always check it out on: https://www.idurarapp.com/.
162+
163+
[![](image.png)](https://star-history.com/#idurar/idurar-erp-crm)
164+
165+
## License
166+
167+
MIT/Massachusetts Institute of Technology(here [LICENSE](https://github.com/Fernando7181/idurar-erp-crm/blob/master/LICENSE))
168+
169+
The IDURAR code is licensed by Massachusetts Institute of Technology.
170+
171+
By contributing to IDURAR, you will be agreeing that your contributions will be licensed under its Massachusetts Institute of Technology(MIT).
172+
173+
174+
127175
## Show your support
128176

129177
Dont forget to give a ⭐️ to this project ... Happy coding!

Diff for: controllers/corsControllers/apiRest.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ exports.create = async (Model, req, res) => {
4747
// Creating a new document in the collection
4848

4949
const result = await new Model(req.body).save();
50-
console.log(result);
50+
5151
// Returning successfull response
5252
return res.status(200).json({
5353
success: true,

Diff for: controllers/corsControllers/custom.js

-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ exports.search = async (Model, req, res) => {
5454
})
5555
// limit to only 5 messages
5656
.limit(10);
57-
console.log(results);
5857
}
5958

6059
if (results.length >= 1) {

Diff for: controllers/erpControllers/clientController.js

+107-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,108 @@
1+
const mongoose = require('mongoose');
2+
const moment = require('moment');
3+
const Model = mongoose.model('Client');
14
const crudController = require('../corsControllers/crudController');
2-
module.exports = crudController.createCRUDController('Client');
5+
const methods = crudController.createCRUDController('Client');
6+
7+
methods.summary = async (req, res) => {
8+
try {
9+
let defaultType = 'month';
10+
11+
const { type } = req.query;
12+
13+
if (type) {
14+
if (['week', 'month', 'year'].includes(type)) {
15+
defaultType = type;
16+
} else {
17+
return res.status(400).json({
18+
success: false,
19+
result: null,
20+
message: 'Invalid type',
21+
});
22+
}
23+
}
24+
25+
const currentDate = moment();
26+
let startDate = currentDate.clone().subtract(1, 'month').startOf('month');
27+
let endDate = currentDate.clone().subtract(1, 'month').endOf('month');
28+
29+
if (defaultType === 'week') {
30+
startDate = currentDate.clone().subtract(1, 'week').startOf('week');
31+
endDate = currentDate.clone().subtract(1, 'week').endOf('week');
32+
}
33+
if (defaultType === 'year') {
34+
startDate = currentDate.clone().subtract(1, 'year').startOf('year');
35+
endDate = currentDate.clone().subtract(1, 'year').endOf('year');
36+
}
37+
38+
const totalClients = await Model.countDocuments({
39+
removed: false,
40+
created: {
41+
$gte: startDate.toDate(),
42+
$lte: endDate.toDate(),
43+
},
44+
enabled: true,
45+
});
46+
47+
const result = await Model.aggregate([
48+
{
49+
$match: {
50+
removed: false,
51+
created: {
52+
$gte: startDate.toDate(),
53+
$lte: endDate.toDate(),
54+
},
55+
enabled: true,
56+
},
57+
},
58+
{
59+
$group: {
60+
_id: null,
61+
new: {
62+
$sum: { $cond: [{ $eq: ['$removed', false] }, 1, 0] },
63+
},
64+
active: {
65+
$sum: { $cond: [{ $eq: ['$enabled', true] }, 1, 0] },
66+
},
67+
},
68+
},
69+
{
70+
$project: {
71+
_id: 0,
72+
new: {
73+
$multiply: [{ $divide: ['$new', totalClients] }, 100],
74+
},
75+
active: {
76+
$multiply: [{ $divide: ['$active', totalClients] }, 100],
77+
},
78+
},
79+
},
80+
]);
81+
82+
if (!result || !result.length) {
83+
return res.status(200).json({
84+
success: true,
85+
result: {
86+
new: 0,
87+
active: 0,
88+
},
89+
message: 'Successfully get summary of new clients',
90+
});
91+
}
92+
93+
return res.status(200).json({
94+
success: true,
95+
result: result[0],
96+
message: 'Successfully get summary of new clients',
97+
});
98+
} catch (error) {
99+
return res.status(500).json({
100+
success: false,
101+
result: null,
102+
error: error,
103+
message: 'Oops there is an Error',
104+
});
105+
}
106+
};
107+
108+
module.exports = methods;

0 commit comments

Comments
 (0)