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

Feedback #1

Open
wants to merge 103 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
7910260
Setting up GitHub Classroom Feedback
github-classroom[bot] Apr 9, 2023
7e012ed
Update README.md
ShehanAnnasiwatta Apr 9, 2023
a9d5f73
Update README.md
IT21221064 Apr 9, 2023
947398f
Update README.md
SeharaDeSilva Apr 9, 2023
15621d7
Update README.md
it21165870 Apr 9, 2023
2f8abe4
Update README.md
ShehanAnnasiwatta Apr 9, 2023
afaaf1c
Update README.md
Hirudaka Apr 9, 2023
2747ba1
Update README.md
ShehanAnnasiwatta Apr 9, 2023
3566fff
Update README.md
IT21218644 Apr 9, 2023
d47261e
Create backend
ShehanAnnasiwatta Apr 23, 2023
94c159d
Delete backend
ShehanAnnasiwatta Apr 23, 2023
ede4052
added CRM backend
May 1, 2023
96a6049
Merge pull request #6 from SLIITITP/feature/add-backend-CRM
it21165870 May 1, 2023
e557817
added task funtion
ShehanAnnasiwatta May 1, 2023
afd3711
changed folder name to project-glan
ShehanAnnasiwatta May 1, 2023
b63f1b6
added task route to server file
ShehanAnnasiwatta May 1, 2023
38617d7
Resolved the issue express module and the error in config file
ShehanAnnasiwatta May 1, 2023
6c03fa6
Update README.md
supunvirajitha May 2, 2023
857e65f
added TM to backend
supunvirajitha May 2, 2023
ec5b402
added SM to backend
DewminiDeSilva May 2, 2023
6454b33
Merge branch 'development' of https://github.com/SLIITITP/ITP_WD_B02_…
DewminiDeSilva May 2, 2023
449c5e5
added location management
Hirudaka May 2, 2023
9177508
Merge branch 'development' of https://github.com/SLIITITP/ITP_WD_B02_…
Hirudaka May 2, 2023
33be55c
added routes invoice and location to server file
supunvirajitha May 2, 2023
ced1816
added vehicle router
supunvirajitha May 2, 2023
724642f
Merge pull request #7 from SLIITITP/feature/add-vehicle-route-to-server
supunvirajitha May 2, 2023
a078719
added inventory management crud
IT21221064 May 3, 2023
d2641d6
adding frontend
ShehanAnnasiwatta May 9, 2023
2c1e3dc
Merge pull request #8 from SLIITITP/feature/add-frontend
ShehanAnnasiwatta May 9, 2023
5b36d0e
added item front end
IT21221064 May 9, 2023
4662ebf
added npm install
Hirudaka May 9, 2023
ed41393
Merge branch 'development' of https://github.com/SLIITITP/ITP_WD_B02_…
Hirudaka May 9, 2023
009d6c8
added warehouse management
Hirudaka May 9, 2023
c2058af
Added employee frontend
IT21218644 May 9, 2023
a8eede0
added invoice frontend
DewminiDeSilva May 9, 2023
a80dfbf
Correct itemlist error
IT21221064 May 9, 2023
782a37d
correct error
IT21221064 May 9, 2023
ca5a847
added store page
IT21221064 May 9, 2023
c77eea2
added invoice frontend
DewminiDeSilva May 9, 2023
12bb1ff
added vehicle frantend
supunvirajitha May 9, 2023
f24138d
added vehicle
supunvirajitha May 9, 2023
733b623
added vehicle
supunvirajitha May 9, 2023
a8b8cb5
Customer added
May 9, 2023
b9630e8
Update all functions
May 9, 2023
abe2a67
added report genaration
IT21221064 May 10, 2023
c9438b3
added location Report
Hirudaka May 10, 2023
f98120e
Location report added
Hirudaka May 10, 2023
37e4fcd
Location report added
Hirudaka May 10, 2023
6a18141
Added vehicle report
supunvirajitha May 10, 2023
f9f1883
changed location report
Hirudaka May 10, 2023
773873b
ItemDashboard added
IT21221064 May 10, 2023
91f7d16
Item dashboard finished
IT21221064 May 10, 2023
8edd140
added emp and customer report
Hirudaka May 10, 2023
f2da3d3
push
supunvirajitha May 10, 2023
18d489b
added emp and customer report
Hirudaka May 10, 2023
e831344
modified cus reports
Hirudaka May 10, 2023
9d209a2
push vahicle report
supunvirajitha May 10, 2023
ca02234
modified cus reports
Hirudaka May 10, 2023
d07abc4
Merge branch 'development' of https://github.com/SLIITITP/ITP_WD_B02_…
Hirudaka May 10, 2023
6477215
added task reports
Hirudaka May 10, 2023
f1302cd
push vahicle report
supunvirajitha May 10, 2023
f601bbf
push vahicle report
supunvirajitha May 10, 2023
5624f79
push location dashboard
supunvirajitha May 10, 2023
a435c34
push customer report
supunvirajitha May 10, 2023
a25898b
push enm report
supunvirajitha May 10, 2023
3d05c6d
Add css to all pages
May 11, 2023
e168412
added location dropdown
Hirudaka May 11, 2023
f95711c
added vechicle dropdown
Hirudaka May 11, 2023
eb00f6e
modified add location
Hirudaka May 11, 2023
c565d3f
push enm report
supunvirajitha May 11, 2023
1c866e3
Merge pull request #11 from SLIITITP/feature/other-dashBs
supunvirajitha May 11, 2023
f5f5233
dashboard finished
IT21221064 May 11, 2023
606e7b0
Merge branch 'development' into feature/additemDashboard
IT21221064 May 11, 2023
8047455
Merge pull request #12 from SLIITITP/feature/additemDashboard
IT21221064 May 11, 2023
7361472
modified add and update task
Hirudaka May 11, 2023
da32a73
push vehicle report
supunvirajitha May 11, 2023
4264169
Merge branch 'development' of https://github.com/SLIITITP/ITP_WD_B02_…
supunvirajitha May 11, 2023
bcd37a8
item report finished
IT21221064 May 11, 2023
5681519
Merge branch 'development' of https://github.com/SLIITITP/ITP_WD_B02_…
IT21221064 May 11, 2023
debe26f
modified location report
Hirudaka May 11, 2023
ab2b588
Merge branch 'development' of https://github.com/SLIITITP/ITP_WD_B02_…
Hirudaka May 11, 2023
77d8010
modified vehicle report
supunvirajitha May 11, 2023
07c1d13
item report finished
IT21221064 May 11, 2023
a89a42d
modified vehicle report
supunvirajitha May 11, 2023
145e820
modified vehicle report
supunvirajitha May 11, 2023
d58f591
added employee customer report
Hirudaka May 11, 2023
ca4feed
Merge branch 'development' of https://github.com/SLIITITP/ITP_WD_B02_…
IT21221064 May 11, 2023
c5f1fb4
added employee customer report
Hirudaka May 11, 2023
573860a
changed topics
Hirudaka May 11, 2023
cfe0a98
item report,inventory report finished
IT21221064 May 11, 2023
3280e07
Merge branch 'development' of https://github.com/SLIITITP/ITP_WD_B02_…
IT21221064 May 11, 2023
7e5b020
changed topics
Hirudaka May 11, 2023
34fec63
changed topics
Hirudaka May 11, 2023
a08b013
Finalize
May 12, 2023
4ba6fa9
Finalize
May 12, 2023
db16277
kela wela hadapu eka
May 12, 2023
919fa68
Added loging comp
IT21221064 May 12, 2023
d4bd23a
Added loging function/not completed yet
IT21221064 May 12, 2023
10c9341
Merge pull request #13 from SLIITITP/feature/add-loging
IT21221064 May 12, 2023
5582c9b
completed deletion of obj id
IT21221064 May 12, 2023
420854f
Merge pull request #14 from SLIITITP/issue/deleting-obj-id
IT21221064 May 12, 2023
6237cac
cm
IT21221064 Jan 4, 2024
a63fc01
Merge branch 'development'
IT21221064 Jan 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Final Report/final.txt

This file was deleted.

2 changes: 2 additions & 0 deletions Project-Glan/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
11 changes: 11 additions & 0 deletions Project-Glan/backend/configs/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const mongoose = require('mongoose');

const connectDB = async() => {
try {
const conn = await mongoose.connect('mongodb+srv://GlanInternational:[email protected]/GlanDB?retryWrites=true&w=majority');
} catch (err) {
console.error(err);
}
}

module.exports = connectDB;
106 changes: 106 additions & 0 deletions Project-Glan/backend/controllers/CreditController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
const asyncHandler = require('express-async-handler')

const Credit = require('../models/Credit')

const setCre = asyncHandler(async (req, res) => {
const Credits = ({ CusName, PayName, IssueDate, ComDate, OrNum, Sperson, CusOrder, Icode } = req.body);
if (!CusName || !PayName || !IssueDate || !ComDate || !OrNum || !Sperson || !CusOrder || !Icode) {
res.status(400)
throw new Error('Please add a text field');
}

//check if invoice is exits
const creditExits = await Credit.findOne({ Icode });
if (creditExits) {
res.status(400);
throw new Error("Credit already exists");
}

const credit = await Credit.create({
CusName,
PayName,
IssueDate,
ComDate,
OrNum,
Sperson,
CusOrder,
Icode,

});
if (credit) {

res.status(201).json({
CusName: credit.CusName,
PayName: credit.PayName,
IssueDate: credit.IssueDate,
ComDate: credit.ComDate,
OrNum: credit.OrNum,
Sperson: cred.Sperson,
CusOrder: credit.CusOrder,
Icode: credit.Icode,

}
)
} else {
res.status(400)
throw new Error("Invalid user data")
}

res.status(200).json({ message: "New credit created" });

})

const getCre = asyncHandler(async (req, res) => {
const credits = await Credit.find();

res.status(200).json(credits);

})

const getCreById = asyncHandler(async (req, res) => {
const credit = await Credit.findById(req.params.id);

res.status(200).json(credit);

})

const updateCre = asyncHandler(async (req, res) => {

const credit = await Credit.findById(req.params.id)

if (!credit) {
res.status(400)
throw new Error('Goal not found')
}

const updatedCredit = await Credit.findByIdAndUpdate(req.params.id, req.body, {
new: true,
})

res.status(200).json(updatedCredit);

})

const deleteCre = asyncHandler(async (req, res) => {

const credit = await Credit.findById(req.params.id)

if (!credit) {
res.status(400)
throw new Error('Goal not found')
}

await credit.deleteOne();

res.status(200).json(req.params.id);

})
module.exports = {
getCre,
setCre,
updateCre,
deleteCre,
getCreById
};


130 changes: 130 additions & 0 deletions Project-Glan/backend/controllers/CustomerController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
const jwt = require("jsonwebtoken")
const bcrypt = require("bcryptjs")
const asyncHandler = require('express-async-handler')
const Customer = require('../models/Customer');
const { json } = require('express');

//add customer details
const setCus = asyncHandler(async(req, res) => {
const customer = ({ cusId, cusName, email, address, dob, conInfo, user, password } = req.body);

if (!cusId || !cusName || !email || !address || !dob || !conInfo || !user || !password) {
res.status(400);
throw new Error("Please add values")
}

//check if customer is exists
const customerExists = await Customer.findOne({ cusId });
if (customerExists) {
res.status(400);
throw new Error("Customer already exists")
}

//Hash password
const salt = await bcrypt.genSalt(10)
const hashedPassword = await bcrypt.hash(password, salt)

//create customer
const customer1 = await Customer.create({
cusId,
cusName,
email,
address,
dob,
conInfo,
user,
password: hashedPassword
})

//check correctly we create customer
if (customer1) {
res.status(201).json({
cusId: customer1.cusId,
cusName: customer1.cusName,
email: customer1.email,
address: customer1.address,
dob: customer1.dob,
conInfo: customer1.conInfo,
user: customer1.user,
password: customer1.password
})
} else {
res.status(400);
throw new Error("Invalide Input");
}
res.status(200).json({
message: 'New customer created'
});
})

//get customer details
const getCus = asyncHandler(async(req, res) => {
//find all customer
const customer1 = await Customer.find()
// res.status(200).json({
// message: 'Get customer'
// });
if (customer1.length > 0) {
res.status(200).json(customer1)
} else {
res.status(404);
throw new Error("No customers found")
}

})

//update customer details
const updateCus = asyncHandler(async(req, res) => {
const customer1 = await Customer.findById(req.params.id)

if (!customer1) {
res.status(400)
throw new Error('Customer not found')
}

const updatedCus = await Customer.findByIdAndUpdate(req.params.id, req.body, {
new: true,
})

res.status(200).json(updatedCus)
// res.status(200).json({
// message: 'Update customer'
// });
})

//delete customer details
const deleteCus = asyncHandler(async(req, res) => {
const customer1 = await Customer.findById(req.params.id)

if (!customer1) {
res.status(400)
throw new Error('Customer not found')
}

await customer1.deleteOne()

res.status(200).json({ id: req.params.id })

// res.status(200).json({
// message: 'Delete customer'
// });
})

//get one customer
const getCustomerById = asyncHandler(async(req, res) => {
const customer = await Customer.findById(req.params.id);
if (!customer) {
res.status(401);
throw new Error("Customer not Found");
}

res.status(200).json(customer);
})

module.exports = {
getCus,
setCus,
updateCus,
deleteCus,
getCustomerById
};
120 changes: 120 additions & 0 deletions Project-Glan/backend/controllers/FeedbackController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
const asyncHandler = require('express-async-handler')
const Feedback = require('../models/Feedback');
const { json } = require('express');

//add customer details
const setFeed = asyncHandler(async(req, res) => {
const feedback = ({ fid, cusName, date, feed, response, status, assign } = req.body);
if (!fid || !cusName || !date || !feed) {
res.status(400);
throw new Error("Please add values")
}

//check if customer already give feeback
// const feedbackExists = await Feedback.findOne({ fID });
// if (feedbackExists) {
// res.status(400);
// throw new Error("Customer already exists")
// }

//create customer feedback
const feedback1 = await Feedback.create({
fid,
cusName,
date,
feed,
response,
status,
assign
})

//check correctly we create customer feedback
if (feedback1) {
res.status(201).json({
fid: feedback1.fid,
cusName: feedback1.cusName,
date: feedback1.date,
feed: feedback1.feed,
response: feedback1.response,
status: feedback1.status,
assign: feedback1.assign
})
} else {
res.status(400);
throw new Error("Invalide Input");
}
res.status(200).json({
message: "New Customer's Feedback created"
});
})

//get customer details
const getFeed = asyncHandler(async(req, res) => {
const feedback1 = await Feedback.find()
// res.status(200).json({
// message: 'Get customer'
// });
if (feedback1.length > 0) {
res.status(200).json(feedback1)
} else {
res.status(404);
throw new Error("No customer's feedbacks")
}

})

//update customer details
const updateFeed = asyncHandler(async(req, res) => {
const feedback1 = await Feedback.findById(req.params.id)

if (!feedback1) {
res.status(400)
throw new Error("Customer's feedback not found")
}

const updatedfeed = await Feedback.findByIdAndUpdate(req.params.id, req.body, {
new: true,
})

res.status(200).json(updatedfeed)
// res.status(200).json({
// message: 'Update customer'
// });
})

//delete customer details
const deleteFeed = asyncHandler(async(req, res) => {
const feedback1 = await Feedback.findById(req.params.id)

if (!feedback1) {
res.status(400)
throw new Error("Customer's feedback not found")
}

await feedback1.deleteOne()

res.status(200).json({ id: req.params.id })

// res.status(200).json({
// message: 'Delete customer'
// });
})

//get one feedback
const getFeedbackById = asyncHandler(async(req, res) => {
const feedback = await Feedback.findById(req.params.id);
if (!feedback) {
res.status(401);
throw new Error("Customer Feedback not Found");
}

res.status(200).json(feedback);
})

module.exports = {
getFeed,
setFeed,
updateFeed,
deleteFeed,
getFeedbackById
};
Loading