Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions controllers/LicensePlate.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var utils = require('../utils/writer.js');
var LicensePlate = require('../service/LicensePlateService');

// Function to handle modifying a license plate
module.exports.modifyPlate = function modifyPlate (req, res, next, body) {
module.exports.modifyPlate = function modifyPlate (_,res,__,body) {
LicensePlate.modifyPlate(body)
.then(function (response) {
// Write the response using the utility function
Expand All @@ -17,7 +17,7 @@ module.exports.modifyPlate = function modifyPlate (req, res, next, body) {
};

//Function to handle registering a new license plate
module.exports.registerPlate = function registerPlate (req, res, next, body) {
module.exports.registerPlate = function registerPlate (_,res,__,body) {
LicensePlate.registerPlate(body)
.then(function (response) {
// Write the response using the utility function
Expand Down
4 changes: 2 additions & 2 deletions controllers/Payment.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var utils = require('../utils/writer.js');
var Payment = require('../service/PaymentService');

//Function to handle making a payment
module.exports.makePayment = function makePayment (req, res, next, body) {
module.exports.makePayment = function makePayment (_ ,res,__, body) {
Payment.makePayment(body)
.then(function (response) {
// Write the response using the utility function
Expand All @@ -14,4 +14,4 @@ module.exports.makePayment = function makePayment (req, res, next, body) {
// Write the error response using the utility function
utils.writeJson(res, response);
});
};
};
8 changes: 4 additions & 4 deletions controllers/Reservation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var utils = require('../utils/writer.js');
var Reservation = require('../service/ReservationService');

// Function to handle deleting a reservation
module.exports.deleteReservation = function deleteReservation (req, res, next, id) {
module.exports.deleteReservation = function deleteReservation (_, res, __, id) {
Reservation.deleteReservation(id)
.then(function (response) {
// Write the response using the utility function
Expand All @@ -17,7 +17,7 @@ module.exports.deleteReservation = function deleteReservation (req, res, next, i
};

//Function to handle making a reservation
module.exports.makeReservation = function makeReservation (req, res, next, body) {
module.exports.makeReservation = function makeReservation (_, res,__, body) {
Reservation.makeReservation(body)
.then(function (response) {
// Write the response using the utility function
Expand All @@ -30,7 +30,7 @@ module.exports.makeReservation = function makeReservation (req, res, next, body)
};

//Function to handle modifying a reservation
module.exports.modifyReservation = function modifyReservation (req, res, next, body, spotId, userId, startTime, duration, date, id) {
module.exports.modifyReservation = function modifyReservation (_, res, __, body, spotId, userId, startTime, duration, date, id) {
Reservation.modifyReservation(body, spotId, userId, startTime, duration, date, id)
.then(function (response) {
// Write the response using the utility function
Expand All @@ -40,4 +40,4 @@ module.exports.modifyReservation = function modifyReservation (req, res, next, b
// Write the error response using the utility function
utils.writeJson(res, response);
});
};
};
12 changes: 6 additions & 6 deletions controllers/Spot.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var utils = require('../utils/writer.js');
var Spot = require('../service/SpotService');

//Function to handle creating a new spot
module.exports.createSpot = function createSpot (req, res, next, body) {
module.exports.createSpot = function createSpot (_, res, __, body) {
Spot.createSpot(body)
.then(function (response) {
// Write the response using the utility function
Expand All @@ -17,7 +17,7 @@ module.exports.createSpot = function createSpot (req, res, next, body) {
};

//Function to handle retrieving all spots
module.exports.getSpots = function getSpots (req, res, next) {
module.exports.getSpots = function getSpots (_, res,__){
Spot.getSpots()
.then(function (response) {
// Write the response using the utility function
Expand All @@ -30,7 +30,7 @@ module.exports.getSpots = function getSpots (req, res, next) {
};

//Function to handle modifying an existing parking spot
module.exports.modifySpot = function modifySpot (req, res, next, body, address, type, charger, id) {
module.exports.modifySpot = function modifySpot (_, res,__, body, address, type, charger, id) {
Spot.modifySpot(body, address, type, charger, id)
.then(function (response) {
// Write the response using the utility function
Expand All @@ -43,7 +43,7 @@ module.exports.modifySpot = function modifySpot (req, res, next, body, address,
};

// Function to handle removing a parking spot
module.exports.removeSpot = function removeSpot (req, res, next, id) {
module.exports.removeSpot = function removeSpot (_, res, __, id) {
Spot.removeSpot(id)
.then(function (response) {
// Write the response using the utility function
Expand All @@ -56,7 +56,7 @@ module.exports.removeSpot = function removeSpot (req, res, next, id) {
};

//Function to handle searching for a parking spot
module.exports.searchSpot = function searchSpot (req, res, next, address, type, charger) {
module.exports.searchSpot = function searchSpot (_, res, __, address, type, charger) {
Spot.searchSpot(address, type, charger)
.then(function (response) {
// Write the response using the utility function
Expand All @@ -66,4 +66,4 @@ module.exports.searchSpot = function searchSpot (req, res, next, address, type,
// Write the error response using the utility function
utils.writeJson(res, response);
});
};
};
2 changes: 1 addition & 1 deletion controllers/SpotOwner.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var utils = require('../utils/writer.js');
var SpotOwner = require('../service/SpotOwnerService');

//Function to handle adding a new spot owner
module.exports.addSpotOwner = function addSpotOwner (req, res, next, body) {
module.exports.addSpotOwner = function addSpotOwner (_, res, __, body){
SpotOwner.addSpotOwner(body)
.then(function (response) {
// Write the response using the utility function
Expand Down
4 changes: 2 additions & 2 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const { defineConfig } = require("cypress");

module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
setupNodeEvents(_ ,__) {
// implement node event listeners here
},
},
});
});
3 changes: 1 addition & 2 deletions service/LicensePlateService.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,4 @@ exports.registerPlate = function(body) {

resolve();
});
};

};
7 changes: 3 additions & 4 deletions service/ReservationService.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* id Integer
* no response value expected for this operation
**/
exports.deleteReservation = function(id) {
return new Promise(function(resolve, reject) {
exports.deleteReservation = function(_) {
return new Promise(function(resolve, _ /*reject*/) {
resolve();
});
}
Expand Down Expand Up @@ -112,7 +112,7 @@ exports.makeReservation = function(body) {
* id Integer
* no response value expected for this operation
**/
exports.modifyReservation = function(body,spotId,userId,startTime,duration,date,id) {
exports.modifyReservation = function(body,spotId,userId,_ /*startTime*/ ,_duration ,_date,id) {
return new Promise(function(resolve, reject) {

// // Η ημερομηνία της κράτησης πρεπει να είναι string (τύπος date)
Expand Down Expand Up @@ -182,4 +182,3 @@ exports.modifyReservation = function(body,spotId,userId,startTime,duration,date,
resolve();
});
}

2 changes: 0 additions & 2 deletions service/SpotOwnerService.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@
**/
exports.addSpotOwner = function(body) {
return new Promise((resolve, reject) => {

//idNumber = αριθμός ταυτότητας
//spots = μια λίστα που περιέχει τις θέσεις που ανήκουν στον ιδιοκτήτη θέσεων.

// Ορίζω κανόνες εγκυρότητας για κάθε field του Ιδιοκτήτη θέσεων.
//Αν το id δεν είναι θετικός ακέραιος τότε έχω σφάλμα με κωδικό 400.
//Αν το idNumber δεν είναι string τότε έχω σφάλμα με κωδικό 400. Το ίδιο ισχύει και για τα name και email.
Expand Down
6 changes: 3 additions & 3 deletions service/SpotService.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ exports.createSpot = function (body) {
* returns List
**/
exports.getSpots = function () {
return new Promise(function (resolve, /**reject*/) { // reject is unused
return new Promise(function (resolve, _ /*reject*/) {
var examples = {};
examples['application/json'] = [{
"address": "address",
Expand Down Expand Up @@ -169,8 +169,8 @@ exports.modifySpot = function (body, address, type, charger, id) {
* no response value expected for this operation
**/
exports.removeSpot = function (id) {
return new Promise(function (resolve, reject) {
resolve(); // Διαγράφει τη θέση από το σύστημα
return new Promise(function (resolve, _ /*reject*/) {
resolve();
});
}

Expand Down
Loading