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 242 commits into
base: feedback
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
242 commits
Select commit Hold shift + click to select a range
d8edc50
Setting up GitHub Classroom Feedback
github-classroom[bot] Aug 8, 2022
0ed34a4
Project Charter
IT21042324 Aug 8, 2022
59d12f9
Update README.md
IT21042324 Aug 8, 2022
d13d865
Updated Project Desc
IT21042324 Aug 8, 2022
fe9cf12
Create 12312
IT21042324 Aug 8, 2022
66f5786
Delete 12312
IT21042324 Aug 8, 2022
5440c20
Update README.md
IT21042324 Aug 9, 2022
a024488
Updated Group Members & Technology
IT21042324 Aug 9, 2022
0db5d0f
Project Initialization
IT21042324 Aug 29, 2022
95fc73b
Delete WE_Met22_ITP_01.pdf
IT21042324 Aug 29, 2022
7f0ef4a
Project Charter
IT21042324 Aug 29, 2022
677545c
Project Proposal doc and pdf
IT21042324 Aug 29, 2022
6bb7fd6
Updated Project Name, Batch and Group Information
IT21042324 Aug 29, 2022
3e0aaca
Corrected Technologies Used
IT21042324 Aug 29, 2022
4a642e8
Installed Bootstrap
IT21042324 Aug 29, 2022
e5d8caa
models and routes
IT21042324 Aug 30, 2022
40eadb2
Installed axios in frontend
IT21042324 Aug 30, 2022
bcd7ec7
Added more details on routes
IT21042324 Aug 30, 2022
5dded11
Changed location of controller folder
IT21042324 Aug 30, 2022
b5235c5
Update package.json
Ayushka004 Aug 30, 2022
76a8c10
Updated with new dependencies
Ayushka004 Aug 30, 2022
03e5813
Added new dependencies
Ayushka004 Aug 30, 2022
aad81a0
added new dependencies
Ayushka004 Aug 30, 2022
a7282e7
Update package-lock.json
Ayushka004 Aug 30, 2022
adbf1cf
Installed yarn in backend folder
IT21042324 Aug 31, 2022
4bd15e8
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21042324 Aug 31, 2022
25c82ea
Revert "Merge branch 'main' of https://github.com/SLIITITP/metro-we_m…
IT21042324 Aug 31, 2022
7b03c51
Revert "Revert "Merge branch 'main' of https://github.com/SLIITITP/me…
IT21042324 Aug 31, 2022
ba6a0a9
Revert "Installed yarn in backend folder"
IT21042324 Aug 31, 2022
1714c88
added dependencies and changes
IT21042324 Aug 31, 2022
6303307
Added material ui icons
IT21042324 Aug 31, 2022
ff4310e
Updated frontend package.json dependancy
IT21042324 Aug 31, 2022
e8d82c1
Updated backend Controller, Models and Routes
IT21042324 Sep 1, 2022
d37c70b
Updated backend server.js with routers and paths
IT21042324 Sep 1, 2022
ec675d5
made changes to models
IT21042324 Sep 1, 2022
033619b
typed hi in model folder for testing
it21004568 Sep 1, 2022
670662b
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
it21004568 Sep 1, 2022
4e8c8cf
Removed hi from controller
IT21042324 Sep 1, 2022
ce7d40a
deleted unwanted dependencies
Ayushka004 Sep 1, 2022
708b52c
Fixed errors with routes, models and controllers
IT21042324 Sep 1, 2022
3a710d1
changed port number
IT21042324 Sep 1, 2022
c715c13
Update package-lock.json
IT21042324 Sep 1, 2022
fd9a5e4
testing
IT21013850 Sep 1, 2022
ff67a48
Revert "testing"
IT21013850 Sep 1, 2022
681dc2b
Testing with revert
IT21013850 Sep 1, 2022
8020869
Added CustomerComplaint routes
IT21042324 Sep 1, 2022
3a52cee
Update FoodAndBeverageRequest.js
IT21042324 Sep 1, 2022
7671555
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
it21004568 Sep 1, 2022
34ec12d
changed Request for date and time
IT21042324 Sep 2, 2022
dcb00e2
Added CustomerService FoodAndBeverage frontend
IT21042324 Sep 3, 2022
44a9c1e
Changed FoodAndBeverage to CreateFoodAndBeverage
IT21042324 Sep 3, 2022
fd8ed8a
Updated App.js
IT21042324 Sep 3, 2022
fc7c2f4
Added Bootstrap table links in index.html
IT21042324 Sep 3, 2022
9e747d7
Update MainNavigation.js
IT21042324 Sep 3, 2022
3278231
Updated MainNavigation.js
IT21042324 Sep 3, 2022
0ded656
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21042324 Sep 3, 2022
72f93a9
Added History Table for FoodAndBeverage
IT21042324 Sep 3, 2022
6e2d7b7
Updated SideNavigation settings
IT21042324 Sep 3, 2022
a6c20fc
Updated SideNavigation
IT21042324 Sep 3, 2022
0b2f719
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21042324 Sep 3, 2022
bb3bcdc
Added Edit Function FoodAndBeverage
IT21042324 Sep 4, 2022
4970896
Repositioned Edit table
IT21042324 Sep 4, 2022
b4835d5
Added Search Bar for FoodAndBeverage
IT21042324 Sep 5, 2022
bd3833a
Added PopOver from FoodAndBeverage
IT21042324 Sep 6, 2022
ea20743
Added foodandbeverage table components and TransportRequest page
IT21042324 Sep 7, 2022
5c5628b
Corrected show FoodAndBeverage table position
IT21042324 Sep 7, 2022
fc427f6
Repositioned content in ShowFoodAndBeverage page
IT21042324 Sep 7, 2022
4b4aa80
Stopped FoodAndBeverage page from refreshing unnecessarily
IT21042324 Sep 8, 2022
a1d8c13
Corrected FoodAndBeverage and TransportRequestPage
IT21042324 Sep 8, 2022
21ad281
Complaint page Creation and Transport page update
IT21042324 Sep 10, 2022
0c1cc7b
Removed TriggerButton Folder
IT21042324 Sep 10, 2022
ea05861
Update package-lock.json
IT21042324 Sep 19, 2022
4c7c0e6
Updated package.json
IT21042324 Sep 19, 2022
7eb0ab5
moved navigation bar to src folder
Ayushka004 Sep 19, 2022
f1de109
Added New npm packages
Ayushka004 Sep 19, 2022
719af81
Revert "moved navigation bar to src folder"
IT21042324 Sep 19, 2022
61895e3
testing
IT21013850 Sep 19, 2022
b3a3be1
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21013850 Sep 19, 2022
1eba00e
Revert "testing"
IT21013850 Sep 19, 2022
be44012
Updated App.js and Amenity(incomplete)
IT21042324 Sep 19, 2022
e926b66
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21042324 Sep 19, 2022
c65bf42
Implemented Add Button In Amenity Request Page
IT21042324 Sep 20, 2022
ac55877
Added Remove Button Functionality in CreateAmenity
IT21042324 Sep 20, 2022
999cb2b
Changed buttons and Form selection in Amenity Request Page
IT21042324 Sep 20, 2022
8142ba0
Updated Amenity/Room Necessity Page
IT21042324 Sep 20, 2022
78cb779
Corrected empty comma error
IT21042324 Sep 20, 2022
8d2a18f
Updated ShowFoodAndBeverage Page
IT21042324 Sep 20, 2022
60f506d
Made display changes on ShowFoodAndBeverage Page
IT21042324 Sep 20, 2022
199798a
Made a few changes in Show Pages
IT21042324 Sep 20, 2022
4373843
Update package-lock.json
IT21042324 Sep 21, 2022
e618287
Update MainNavigation.js
IT21042324 Sep 21, 2022
07bae9a
Updated Amenity and SideNavigations
IT21042324 Sep 21, 2022
599b1ce
Update index.js
IT21042324 Sep 21, 2022
9557501
Update index.js
IT21042324 Sep 21, 2022
009a02a
Added Export Folder
IT21042324 Sep 21, 2022
1e0567a
updated models and removed unnecessary contents
IT21042324 Sep 22, 2022
a8f0b58
Renamed PopOver Buttons
IT21042324 Sep 22, 2022
a2ea009
Updated Models for Staff management
IT21070594 Sep 23, 2022
4d19e71
Updated Routes for Staff management
IT21070594 Sep 23, 2022
2fe618e
Updated server.js with Staff Management Routes
IT21070594 Sep 23, 2022
0af89f3
Updated routes/models and server.js for Inventory Management
IT21013850 Sep 23, 2022
7cacba0
changed a spelling error
IT21013850 Sep 23, 2022
3f50993
edited routes and model file
IT21013850 Sep 24, 2022
af71702
Added View Complaint Staff Page
IT21042324 Sep 24, 2022
fbeee06
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21042324 Sep 24, 2022
cb64c68
bookRoom model
it21004568 Sep 25, 2022
7fcbcfd
Update TransportRequest.js
IT21042324 Oct 9, 2022
563987b
Basic Changes
IT21042324 Oct 11, 2022
8130393
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
it21004568 Oct 11, 2022
1c64589
Updated Transport Request Page
IT21042324 Oct 12, 2022
0283cc7
Width Adjustment in FoodAndbeverage
IT21042324 Oct 12, 2022
21d77ae
Added TransportStaff and made other Changes
IT21042324 Oct 19, 2022
a3cee9d
Changed View
IT21112096 Oct 19, 2022
b385d52
view Change
IT21042324 Oct 19, 2022
3e09dc1
Fixed issue with complaint not working
IT21042324 Oct 19, 2022
5ea1e37
Fixed complaint page bug
IT21042324 Oct 19, 2022
68f228a
Fixed Bug with Transport Staff Page
IT21042324 Oct 19, 2022
cb1e499
positioned View
IT21042324 Oct 19, 2022
b133c05
Updated Emp Login Routes
IT21042324 Oct 20, 2022
0420a42
Updated EmpLogin Page
IT21042324 Oct 20, 2022
2e7b85b
Updated Routes
IT21042324 Oct 20, 2022
840bc71
Update StaffNavigation
IT21042324 Oct 21, 2022
6399868
user routs,js and server.js
it21004568 Nov 3, 2022
80b14cd
Minor Changes
IT21042324 Nov 3, 2022
a89beb6
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21042324 Nov 3, 2022
dbe5592
Created Basic steps for login Page
IT21042324 Nov 3, 2022
2b10e73
Repositioning login page
IT21042324 Nov 3, 2022
6ddefd3
Added localStorage for Login
IT21042324 Nov 4, 2022
944f9e5
Synced Login Page with Customer Service User ID
IT21042324 Nov 7, 2022
b0b638d
Connected Staff Interface with Login
IT21042324 Nov 7, 2022
d5c3c41
Added Cardview to transport page
IT21042324 Nov 7, 2022
64dfde5
Styling added automatically.
IT21042324 Nov 7, 2022
ceccfea
changed customer service staff route to staff route
IT21013850 Nov 8, 2022
d02f7e5
Integrated Chef Request
IT21013850 Nov 8, 2022
00c7183
Fixed Issue with trigger Button
IT21042324 Nov 8, 2022
f4c9f0f
Edit Transport Page
IT21042324 Nov 8, 2022
459f8b5
added routes and controllers for parking management
Ayushka004 Nov 8, 2022
9dfadbb
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
Ayushka004 Nov 8, 2022
99c7a82
updated server.js with parking management routes
Ayushka004 Nov 8, 2022
d82614b
updated parking management pages
Ayushka004 Nov 8, 2022
72f0253
Create StatusBar.js
Ayushka004 Nov 8, 2022
4b6e4a6
Updated CreateTransportRequest Page
IT21042324 Nov 9, 2022
b72f9f1
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21042324 Nov 9, 2022
7c50c80
Updated Staff Management
IT21070594 Nov 9, 2022
3c7c2d0
Updated Create Transport Page
IT21042324 Nov 9, 2022
d066014
Updated Transport Page with necessary information
IT21042324 Nov 10, 2022
8d5696e
updated parking management page
Ayushka004 Nov 10, 2022
7fe8b82
Update App.js
Ayushka004 Nov 10, 2022
3fd8e0b
Updated Attendance Files
IT21070594 Nov 10, 2022
6d54d05
Updated GetAttendance.js
IT21070594 Nov 10, 2022
f8c8ae1
Created Admin Navigation
IT21042324 Nov 10, 2022
7bdd0af
Added preventDefault for getAttendance
IT21042324 Nov 10, 2022
5cdfd6c
Update CreateEmployee.js
IT21070594 Nov 10, 2022
f446e26
Update GetAttendance.js
IT21070594 Nov 10, 2022
08031e8
Nuha's Backend
it21004568 Nov 10, 2022
22ec86a
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
it21004568 Nov 10, 2022
43853c5
Added the models and routes
IT21013850 Nov 10, 2022
f3ee82a
Updated server.js nuha
it21004568 Nov 10, 2022
2c1a5b0
added amenity manager request route to server.js and removed maintenance
IT21013850 Nov 10, 2022
57b0d8d
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21013850 Nov 10, 2022
47df7c8
moment dependency added - Nuha
it21004568 Nov 10, 2022
bfcc123
added files to Kitchen Management
IT21013850 Nov 10, 2022
ba2a5ff
Update CreateEmployee.js
IT21070594 Nov 10, 2022
992960f
Updated CreateLeaveManager.js
IT21070594 Nov 10, 2022
df9b14c
Updated GetAttendanceManager.js
IT21070594 Nov 10, 2022
3f0cc8e
Updated CreateLeave.js
IT21070594 Nov 10, 2022
bfad5df
Updated Search in Staff management
IT21070594 Nov 10, 2022
1b762ed
Very basic report in the admin Page for complaints
IT21042324 Nov 11, 2022
5aff1be
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21042324 Nov 11, 2022
147140e
Supplier Backend
IT21112096 Nov 11, 2022
39ddd0c
Removed report from side Navigation from Customer Service
IT21042324 Nov 11, 2022
14652fd
Main Navigation changes in Staff.js-Nuha
it21004568 Nov 11, 2022
0059c92
Updated backend
IT21112096 Nov 11, 2022
8709374
called chef's functions in app.js
IT21013850 Nov 11, 2022
9b58232
pushing closebookings and some dependencies pls npm i
it21004568 Nov 11, 2022
e5e0406
Create MainNavigationManager.js
IT21070594 Nov 11, 2022
dc52bba
Staff & Manager invoice
IT21070594 Nov 11, 2022
db9f232
Changed the routes for invoice
IT21070594 Nov 11, 2022
377a539
Completed CLOSEBOOKING
it21004568 Nov 11, 2022
cf3dc97
deleted unwanted components
Ayushka004 Nov 11, 2022
ca6bca6
delete unwanted rotes & controllers
Ayushka004 Nov 11, 2022
265465e
Removed Inventory Management
IT21013850 Nov 11, 2022
881abf5
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21013850 Nov 11, 2022
ac8e5b5
Removed unwanted records from backend server file
Ayushka004 Nov 11, 2022
d67c523
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
Ayushka004 Nov 11, 2022
433a7b2
Added Inventory Management Folder
IT21013850 Nov 11, 2022
71446d6
Manager routes
IT21070594 Nov 11, 2022
6bef34a
changed chef request file
IT21013850 Nov 11, 2022
ede3a51
xx
IT21013850 Nov 11, 2022
01c8b40
edited attendance and invoice
IT21070594 Nov 11, 2022
a43bc0b
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21070594 Nov 11, 2022
d61f3ab
removed parking management
Ayushka004 Nov 11, 2022
ccefec9
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
Ayushka004 Nov 11, 2022
0e62f2b
Added Complaint Report and made changes to Staff Transport
IT21042324 Nov 11, 2022
9b65019
Updated Transport Report
IT21042324 Nov 11, 2022
207b5f7
Removed Restaurant from Staff Navigation
IT21042324 Nov 11, 2022
d92ca32
updated parking managements routs,controllers
Ayushka004 Nov 11, 2022
60d3c86
Updated Transport Emp Page
IT21042324 Nov 11, 2022
323f4e3
Added the Manager's routes
IT21013850 Nov 11, 2022
b5ff28e
nuha
it21004568 Nov 11, 2022
712ba0a
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
it21004568 Nov 11, 2022
d7a9d06
Fixed Chef request errors
IT21013850 Nov 11, 2022
4552030
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
it21004568 Nov 11, 2022
b7a52c8
nuha
it21004568 Nov 11, 2022
af1c5b2
removed profile and report from the side navigations
IT21013850 Nov 11, 2022
329dcf2
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21013850 Nov 11, 2022
8b02121
Frontend Supplier
IT21112096 Nov 11, 2022
ec31961
Update Manager.js
IT21112096 Nov 11, 2022
a34c68c
added parking managemnet
Ayushka004 Nov 11, 2022
75b24e7
Update Manager.js
Ayushka004 Nov 11, 2022
bde9bc3
corrected errors on db
Ayushka004 Nov 11, 2022
a59dcb5
Corrected Tailwind error
IT21042324 Nov 11, 2022
e4a2ff1
Request fetch
IT21112096 Nov 11, 2022
84a79db
nav bar
IT21112096 Nov 11, 2022
1c67c8e
updated styles for parking
Ayushka004 Nov 11, 2022
4916671
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
Ayushka004 Nov 11, 2022
b8d08fc
Updated staff and admin exports
Ayushka004 Nov 11, 2022
bcf00da
NUHA
it21004568 Nov 11, 2022
664a68c
Updated Manager and Staff interface
IT21070594 Nov 11, 2022
40b0959
updates routes for parking management
Ayushka004 Nov 11, 2022
766f9f4
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
Ayushka004 Nov 11, 2022
59275e0
SUPPLIER
IT21112096 Nov 11, 2022
c4bbe4e
changes made to my inventory management
IT21013850 Nov 11, 2022
36fe02b
status change
IT21112096 Nov 11, 2022
7ae1d98
print invoice
IT21070594 Nov 11, 2022
8d38845
xx
IT21013850 Nov 11, 2022
d49cd2b
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
IT21013850 Nov 11, 2022
cdb7785
changed manager.js
IT21013850 Nov 11, 2022
a76ba15
Side Navigation For Reports
IT21070594 Nov 12, 2022
b19943a
removed preventDefault from Complaint Page
IT21042324 Nov 12, 2022
0c74c76
Update ViewBookings.js
it21004568 Nov 12, 2022
9e79c1a
report for ingredients,assets and amenities
IT21013850 Nov 12, 2022
d47e7cd
Reports
IT21070594 Nov 12, 2022
c4f088c
Update LandingScreen.js
it21004568 Nov 12, 2022
d8a7790
Merge branch 'main' of https://github.com/SLIITITP/metro-we_met22_itp_01
it21004568 Nov 12, 2022
edddf17
Updated Invoice and leave
IT21070594 Nov 12, 2022
2c2f540
update displayAttendance report
IT21070594 Nov 12, 2022
0385125
Report generation
IT21112096 Nov 12, 2022
6a34b7c
Admin path
IT21112096 Nov 12, 2022
f41608a
Changes to Bootstrap
IT21042324 Dec 5, 2022
bfd22a5
Update README.md
IT21042324 Jul 19, 2023
93cc471
Update README.md
IT21042324 Jul 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added Charter/WE_Met22_ITP_01.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions Project/backend/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MONGODB_URL=mongodb+srv://root:root@cluster0.17hns.mongodb.net/BlueLagoonResortDB?retryWrites=true&w=majority
75 changes: 75 additions & 0 deletions Project/backend/controller/AttendRequest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
const AttendRequest = require("../models/AttendRequest");

//To get All Attended Request
const getRequests = async (req, res) => {
try {
const allReqs = await AttendRequest.find(); //now this will find all students and save it in allStudents

res.status(200).json(allReqs);
} catch (error) {
// console.log(error);
res.status(500).json({ message: error.message });
}
};

//To create a new Attended Request
const createRequest = async (req, res) => {
const reqs = req.body;
const Request = new AttendRequest(reqs); // It is exported in routes so dont need to export it here

try {
await Request.save();
res.status(200).json(Request);
} catch (error) {
res.status(500).json({ message: error.message });
}
};

//Delete an existing Attended Request based on _id
const deleteRequest = async (req, res) => {
const id = req.params.id;

try {
await AttendRequest.findByIdAndDelete(id); //exec to make it a executable function
res.status(200).send("Successfully Deleted");
} catch (error) {
console.log(error.messsage);
}
};

//Update an existing Attended Request based on _id
const updateRequest = async (req, res) => {
const id = req.params.id;
const body = req.body;
try {
await AttendRequest.findByIdAndUpdate(id, body);
res.status(200).send("Successfully Updated");
} catch {
(err) => {
res.status(500).send(err.message);
};
}
};

//To get a particular Attended Request based on _id
const getOneRequest = async (req, res) => {
let id = req.params.id;

const request = await AttendRequest.findById(id)
.then((reqs) => {
let object = { status: "Fetched Request" };
res.status(200).send(object.status);
})
.catch((err) => {
console.log(err.message);
res
.status(500)
.send({ status: "Cannot fetch Request", error: err.message });
});
};

module.exports.getRequests = getRequests;
module.exports.createRequest = createRequest;
module.exports.deleteRequest = deleteRequest;
module.exports.updateRequest = updateRequest;
module.exports.getOneRequest = getOneRequest;
75 changes: 75 additions & 0 deletions Project/backend/controller/Customer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
const Customer = require("../models/Customer");

//To get All Customers
const getCustomers = async (req, res) => {
try {
const allCustomers = await Customer.find(); //now this will find all students and save it in allStudents

res.status(200).json(allCustomers);
} catch (error) {
// console.log(error);
res.status(500).json({ message: error.message });
}
};

//To create a new Customer
const createCustomer = async (req, res) => {
const customer = req.body;
const newCustomer = new Customer(customer); // It is exported in routes so dont need to export it here

try {
await newCustomer.save();
res.status(200).json(newCustomer);
} catch (error) {
res.status(500).json({ message: error.message });
}
};

//Delete an existing customer based on _id
const deleteCustomer = async (req, res) => {
const id = req.params.id;

try {
await Customer.findByIdAndDelete(id); //exec to make it a executable function
res.status(200).send("Successfully Deleted");
} catch (error) {
console.log(error.messsage);
}
};

//Update an existing customer based on _id
const updateCustomer = async (req, res) => {
const id = req.params.id;
const body = req.body;
try {
await Customer.findByIdAndUpdate(id, body);
res.status(200).send("Successfully Updated");
} catch {
(err) => {
res.status(500).send(err.message);
};
}
};

//To get a particular customer based on _id
const getOneCustomer = async (req, res) => {
let userId = req.params.id;

const user = await Customer.findById(userId)
.then((customer) => {
let object = { status: "Fetched Customer", custName: customer.name };
res.status(200).send(object.status + "\nName : " + object.custName);
})
.catch((err) => {
console.log(err.message);
res
.status(500)
.send({ status: "Cannot fetch Customer", error: err.message });
});
};

module.exports.getCustomers = getCustomers;
module.exports.createCustomer = createCustomer;
module.exports.deleteCustomer = deleteCustomer;
module.exports.updateCustomer = updateCustomer;
module.exports.getOneCustomer = getOneCustomer;
75 changes: 75 additions & 0 deletions Project/backend/controller/CustomerComplaint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
const CustomerComplaint = require("../models/CustomerComplaint");

//To get All Complaints
const getComplaints = async (req, res) => {
try {
const allReqs = await CustomerComplaint.find(); //now this will find all students and save it in allStudents

res.status(200).json(allReqs);
} catch (error) {
// console.log(error);
res.status(500).json({ message: error.message });
}
};

//To create a new Complaint
const createComplaint = async (req, res) => {
const request = req.body;
const newComplaint = new CustomerComplaint(request); // It is exported in routes so dont need to export it here

try {
await newComplaint.save();
res.status(200).json(newComplaint);
} catch (error) {
res.status(500).json({ message: error.message });
}
};

//Delete an existing Complaint based on _id
const deleteComplaint = async (req, res) => {
const id = req.params.id;

try {
await CustomerComplaint.findByIdAndDelete(id); //exec to make it a executable function
res.status(200).send("Successfully Deleted");
} catch (error) {
console.log(error.messsage);
}
};

//Update an existing request based on _id
const updateComplaint = async (req, res) => {
const id = req.params.id;
const body = req.body;
try {
await CustomerComplaint.findByIdAndUpdate(id, body);
res.status(200).send("Successfully Updated");
} catch {
(err) => {
res.status(500).send(err.message);
};
}
};

//To get a particular Complaint based on _id
const getOneComplaint = async (req, res) => {
let id = req.params.id;

const Complaint = await CustomerComplaint.findById(id)
.then((reqs) => {
let object = { status: "Fetched Customer Complaint" };
res.status(200).json(reqs);
})
.catch((err) => {
console.log(err.message);
res
.status(500)
.send({ status: "Cannot Fetch Complaint", error: err.message });
});
};

module.exports.getComplaints = getComplaints;
module.exports.createComplaint = createComplaint;
module.exports.deleteComplaint = deleteComplaint;
module.exports.updateComplaint = updateComplaint;
module.exports.getOneComplaint = getOneComplaint;
75 changes: 75 additions & 0 deletions Project/backend/controller/CustomerRequest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
const CustomerRequest = require("../models/CustomerRequest");

//To get All Requests
const getRequests = async (req, res) => {
try {
const allReqs = await CustomerRequest.find(); //now this will find all students and save it in allStudents

res.status(200).json(allReqs);
} catch (error) {
// console.log(error);
res.status(500).json({ message: error.message });
}
};

//To create a new Request
const createRequest = async (req, res) => {
const request = req.body;
const newRequest = new CustomerRequest(request); // It is exported in routes so dont need to export it here

try {
await newRequest.save();
res.status(200).json(newRequest);
} catch (error) {
res.status(500).json({ message: error.message });
}
};

//Delete an existing Request based on _id
const deleteRequest = async (req, res) => {
const id = req.params.id;

try {
await CustomerRequest.findByIdAndDelete(id); //exec to make it a executable function
res.status(200).send("Successfully Deleted");
} catch (error) {
console.log(error.messsage);
}
};

//Update an existing request based on _id
const updateRequest = async (req, res) => {
const id = req.params.id;
const body = req.body;
try {
await CustomerRequest.findByIdAndUpdate(id, body);
res.status(200).send("Successfully Updated");
} catch {
(err) => {
res.status(500).send(err.message);
};
}
};

//To get a particular Request based on _id
const getOneRequest = async (req, res) => {
let id = req.params.id;

const Request = await CustomerRequest.findById(id)
.then((reqs) => {
let object = { status: "Fetched Customer Request" };
res.status(200).json(reqs);
})
.catch((err) => {
console.log(err.message);
res
.status(500)
.send({ status: "Cannot Fetch Request", error: err.message });
});
};

module.exports.getRequests = getRequests;
module.exports.createRequest = createRequest;
module.exports.deleteRequest = deleteRequest;
module.exports.updateRequest = updateRequest;
module.exports.getOneRequest = getOneRequest;
74 changes: 74 additions & 0 deletions Project/backend/controller/FoodAndBeverageRequest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
const FoodAndBeverage = require("../models/FoodAndBeverageRequest");

//To get All F&B Request
const getRequests = async (req, res) => {
try {
const allReqs = await FoodAndBeverage.find(); //now this will find all students and save it in allStudents

res.status(200).json(allReqs);
} catch (error) {
// console.log(error);
res.status(500).json({ message: error.message });
}
};

//To create a new F&B Request
const createRequest = async (req, res) => {
const reqs = req.body;
const Request = new FoodAndBeverage(reqs); // It is exported in routes so dont need to export it here

try {
await Request.save();
res.json("Request Added");
} catch (error) {
console.log(error);
}
};

//Delete an existing F&B Request based on _id
const deleteRequest = async (req, res) => {
const id = req.params.id;

try {
await FoodAndBeverage.findByIdAndDelete(id); //exec to make it a executable function
res.status(200).send("Successfully Deleted");
} catch (error) {
console.log(error.messsage);
}
};

//Update an existing F&B Request based on _id
const updateRequest = async (req, res) => {
const id = req.params.id;
const body = req.body;
try {
await FoodAndBeverage.findByIdAndUpdate(id, body);
res.status(200).send(body);
} catch {
(err) => {
res.status(500).send(err.message);
};
}
};

//To get a particular F&B Request based on _id
const getOneRequest = async (req, res) => {
let userid = req.params.id;

const request = await FoodAndBeverage.findById(userid)
.then((reqs) => {
res.status(200).send(reqs);
})
.catch((err) => {
console.log(err.message);
res
.status(500)
.send({ status: "Cannot fetch Request", error: err.message });
});
};

module.exports.getRequests = getRequests;
module.exports.createRequest = createRequest;
module.exports.deleteRequest = deleteRequest;
module.exports.updateRequest = updateRequest;
module.exports.getOneRequest = getOneRequest;
Loading