-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/plugins/axios.ts b/src/plugins/axios.ts
index 519e051..c87cb4a 100644
--- a/src/plugins/axios.ts
+++ b/src/plugins/axios.ts
@@ -2,7 +2,7 @@ import axios from 'axios'
import { employeeStore } from "../store/employeeStore.ts";
const axiosClient = axios.create({
- baseURL: 'https://localhost:44397/api/',
+ baseURL: 'http://localhost:5219/api/',
})
axiosClient.interceptors.request.use( async (config) => {
diff --git a/src/router/index.ts b/src/router/index.ts
index 89f6382..3ca0b0e 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -27,20 +27,28 @@ import OperatorParkingSlot from "@pages/operator/OperatorParkingSlot.vue";
import AdminEmployees from "@pages/administrator/AdminEmployees.vue";
import OperatorSettings from "../pages/operator/OperatorSettings.vue";
import EmployeeLogin from "../pages/EmployeeLogin.vue";
-import {employeeStore} from "../store/employeeStore.ts";
import VerifyAccount from "@pages/VerifyAccount.vue";
import ResetPassword from "@pages/ResetPassword.vue";
import AdminAnalytics from "@pages/administrator/AdminAnalytics.vue";
-import AdminFeedbacksAndRatings from "@pages/administrator/AdminFeedbacksAndRatings.vue";
import AdminParkMonitoring from "@pages/administrator/AdminParkMonitoring.vue";
import AdminPendingParkingPlaces from "@pages/administrator/AdminPendingParkingPlaces.vue";
+import PendingParkingPlaceInfo from "@pages/administrator/PendingParkingPlaceInfo.vue";
import AdminParkingPlaces from "@pages/administrator/AdminParkingPlaces.vue";
import ParkingPlaceInfo from "@pages/administrator/ParkingPlaceInfo.vue";
+// @ts-ignore
+import FeedbacksRatings from "../pages/parkOwner/FeedbacksRatings.vue";
+import ManageParkingPlace from "@pages/parkOwner/ManageParkingPlace.vue";
+//@ts-ignore
+import OwnerSettings from "@pages/parkOwner/OwnerSettings.vue";
+//@ts-ignore
+import OwnerAnalytics from "@pages/parkOwner/OwnerAnalytics.vue";
+//@ts-ignore
+import OwnerPayments from "@pages/parkOwner/OwnerPayments.vue";
// @ts-ignore
const routes = [
{
@@ -48,6 +56,7 @@ const routes = [
name: 'Home',
component: () => Home
},
+
{
path: '/auth',
@@ -79,6 +88,7 @@ const routes = [
name: 'ResetPassword',
component: () => ResetPassword
}
+
]
},
{
@@ -145,6 +155,31 @@ const routes = [
name: 'OwnerOverview',
component: () => OwnerDashboard
+ },
+ {
+ path:'feedbacks',
+ name:'OwnerFeedbacks',
+ component:()=>FeedbacksRatings
+ },
+ {
+ path:'manage-parking',
+ name:'ManageParking',
+ component:()=>ManageParkingPlace
+ },
+ {
+ path:'settings',
+ name:'OwnerSettings',
+ component:()=>OwnerSettings
+ },
+ {
+ path:'analytics',
+ name:'OwnerAnalytics',
+ component:()=>OwnerAnalytics
+ },
+ {
+ path: 'payments',
+ name: 'OwnerPayments',
+ component: () => OwnerPayments
}
]
},
@@ -168,11 +203,7 @@ const routes = [
name: 'AdminAnalytics',
component: () => AdminAnalytics
},
- {
- path: '/admin-feedbacks-and-ratings',
- name: 'AdminFeedbacksAndRatings',
- component: () => AdminFeedbacksAndRatings
- },
+
{
path: '/admin-park-monitoring',
name: 'AdminParkMonitoring',
@@ -193,6 +224,12 @@ const routes = [
path: '/parking-place-info',
name: 'ParkingPlaceInfo',
component: () => ParkingPlaceInfo
+ },
+ {
+ path:'/pending-parking-place-info',
+ name:'PendingParkingPlaceInfo',
+ component: () => PendingParkingPlaceInfo
+
}
]
@@ -204,20 +241,20 @@ const router = createRouter({
routes
})
-router.beforeEach((to, from, next) => {
- const store = employeeStore();
- from;
- if(to.meta.requiresAuth && !store.user.token) {
- next({name: 'EmployeeLogin'});
- }else if(store.user.token && to.name === 'EmployeeLogin' && store.user.data.role === 'Administrator'){
- next({name: 'AdminDashboard'});
- }else if(store.user.token && to.name === 'EmployeeLogin' && store.user.data.role === 'Operator') {
- next({name: 'OperatorDashboard'});
- }else if(store.user.token && to.name === 'EmployeeLogin' && store.user.data.role === 'Verifier') {
- next({name: 'VerifierDashboard'});
- }else{
- next();
- }
-})
+// router.beforeEach((to, from, next) => {
+// const store = employeeStore();
+// from;
+// if(to.meta.requiresAuth && !store.user.token) {
+// next({name: 'EmployeeLogin'});
+// }else if(store.user.token && to.name === 'EmployeeLogin' && store.user.data.role === 'Administrator'){
+// next({name: 'AdminDashboard'});
+// }else if(store.user.token && to.name === 'EmployeeLogin' && store.user.data.role === 'Operator') {
+// next({name: 'OperatorDashboard'});
+// }else if(store.user.token && to.name === 'EmployeeLogin' && store.user.data.role === 'Verifier') {
+// next({name: 'VerifierDashboard'});
+// }else{
+// next();
+// }
+// })
export default router
diff --git a/src/store/employeeStore.ts b/src/store/employeeStore.ts
index 132bbee..44fc7e0 100644
--- a/src/store/employeeStore.ts
+++ b/src/store/employeeStore.ts
@@ -28,6 +28,7 @@ export const employeeStore = defineStore('employee', {
login(user : any) : Promise
> {
return axiosClient.post('auth/employee-login', user)
.then(({data}) => {
+ console.log(data);
console.log(data.tokens)
this.user.data = data.employee;
this.user.token = data.tokens.token;
@@ -72,9 +73,9 @@ export const employeeStore = defineStore('employee', {
// return authService('employee/get-employees/EMP_1975_6231', 'get' ,this.user.token, {}).then()
},
getEmployee() {
- return authService('employee/get-employees/EMP_1975_6231','get', this.user.token,{})
+ return authService('employee/get-employees/EMP_0022_4589','get', this.user.token,{})
.then((res : any) => {
- console.log(res)
+ // console.log(res)
return res
})
@@ -114,6 +115,13 @@ export const employeeStore = defineStore('employee', {
}).catch((error) => {
throw error
})
- }
+ },
+ saveEmployeeDetails(data:object){
+ return axiosClient.post('Employee/update-employee', data)
+ .then(({data}) => {
+ return data
+ }).catch((error) => {
+ throw error
+ }) }
}
})
\ No newline at end of file
diff --git a/src/store/parkingOperatorStore.ts b/src/store/parkingOperatorStore.ts
index 765013e..a8742e9 100644
--- a/src/store/parkingOperatorStore.ts
+++ b/src/store/parkingOperatorStore.ts
@@ -7,14 +7,20 @@ export const parkingOperatorStore = defineStore('parkingOperator', {
user: {
data: JSON.parse(localStorage.getItem('user') || '{}'),
token: localStorage.getItem('token') || '',
- }
+ },
+ parkingPlace: {},
}),
+ getters: {
+ // getParkingPlace(): any {
+ // return this.parkingPlace;
+ // }
+ },
actions: {
getParkingPlace() {
const user = this.user.data.id;
- console.log(user)
- return authService('ParkingOperator/get-operator-parking?parkingOperatorId=EMP_1975_6231', 'get', this.user.token, {})
+ return authService(`ParkingOperator/get-operator-parking?parkingOperatorId=${user}`, 'get', this.user.token, {})
.then((res: any) => {
+ this.parkingPlace = res.parking;
return res;
}).catch((error) => {
throw error;
diff --git a/src/store/parkingPlaceStore.ts b/src/store/parkingPlaceStore.ts
new file mode 100644
index 0000000..edba4d0
--- /dev/null
+++ b/src/store/parkingPlaceStore.ts
@@ -0,0 +1,39 @@
+import { defineStore } from 'pinia'
+import axiosClient from "../plugins/axios";
+import { AxiosResponse } from 'axios';
+
+
+export const parkingPlaceStore = defineStore('parkingPlace', {
+ state: () => ({
+ user: {
+ data: JSON.parse(localStorage.getItem('user') || '{}'),
+ token: localStorage.getItem('token') || '',
+ },
+ parkingPlace:[]
+ }),
+
+ actions: {
+ async getAllParkingPlaces() : Promise> {
+ return axiosClient.get("ParkingPlaces/get-all-parking-places")
+ .then((res)=>{
+ // console.log(res.data)
+ return res.data
+ })
+ .catch((err)=>{
+ throw err
+ })
+ },
+
+ async getNewParkingPlaces(role : string) : Promise> {
+
+ return axiosClient.get(`ParkingPlaces/get-new-parking-places/${role}`)
+ .then((res)=>{
+ return res.data
+ })
+ .catch((err)=>{
+ throw err
+ })
+ }
+ }
+
+})
diff --git a/src/store/reservationStore.ts b/src/store/reservationStore.ts
new file mode 100644
index 0000000..5482d5f
--- /dev/null
+++ b/src/store/reservationStore.ts
@@ -0,0 +1,76 @@
+import {defineStore} from "pinia";
+import axiosClient from "../plugins/axios.ts"
+import {AxiosResponse} from "axios";
+
+
+export const reservationStore = defineStore('reservations', {
+ state: () => ({
+ user: {
+ data: JSON.parse(localStorage.getItem('user') || '{}'),
+ token: localStorage.getItem('token') || '',
+ }
+ }),
+ actions: {
+ async makeReservation(reservation : any) : Promise> {
+
+ return axiosClient.post('Reservations/make-onsite-reservation', reservation)
+ .then((res : any) => {
+ return res.data;
+ }).catch((err : any) => {
+ throw err;
+ })
+ },
+ async calculateReservationCost(id: string, startingTime : Number, endingTime : Number) : Promise> {
+
+ const startingTimeStr = startingTime.toString();
+ const endingTimeStr = endingTime.toString();
+
+ return axiosClient.post(`Reservations/calculate-reservation-cost/${id}/${startingTimeStr}/${endingTimeStr}`)
+ .then((res : any) => {
+ return res.data
+ }).catch((err : any) => {
+ throw err
+ })
+
+ },
+ async getVehicleTypes() : Promise> {
+
+ const parkingPlaceId = this.user.data.parkingPlaceId;
+
+ return axiosClient.get(`Slot/get-distinct-slot-categories-by-parking-place/${parkingPlaceId}`)
+ .then((res : any) => {
+ console.log(res.data);
+ return res.data;
+ }).catch((err : any) => {
+ throw err;
+ })
+ },
+ async getUpcomingReservations(date : string, from : string, to : string) : Promise> {
+
+ return axiosClient.get(`Reservations/get-upcoming-reservations/${date}/${from}/${to}`)
+ .then((res : any) => {
+ return res.data;
+ }).catch((err : any) => {
+ throw err;
+ })
+ },
+ async getCancelledReservations(date : string, from : string, to : string) : Promise> {
+
+ return axiosClient.get(`Reservations/get-cancelled-reservations/${date}/${from}/${to}`)
+ .then((res : any) => {
+ return res.data;
+ }).catch((err : any) => {
+ throw err;
+ })
+ },
+ async getCompletedReservations(date : string, from : string, to : string) : Promise> {
+ return axiosClient.get(`Reservations/get-completed-reservations/${date}/${from}/${to}`)
+ .then((res : any) => {
+ return res.data;
+ }).catch((err : any) => {
+ throw err;
+ })
+ }
+
+ }
+})
\ No newline at end of file
diff --git a/src/store/slotStore.ts b/src/store/slotStore.ts
new file mode 100644
index 0000000..5eaf232
--- /dev/null
+++ b/src/store/slotStore.ts
@@ -0,0 +1,62 @@
+import {defineStore} from "pinia";
+import {authService} from "../services/authService";
+import axiosClient from "../plugins/axios.ts";
+import {AxiosResponse} from "axios";
+
+
+export const slotStore = defineStore('slots', {
+ state: () => ({
+ user: {
+ data: JSON.parse(localStorage.getItem('user') || '{}'),
+ token: localStorage.getItem('token') || '',
+ },
+ slots: [],
+ freeSlots : []
+ }),
+ actions: {
+ async getSlotsByZone(zoneId: string): Promise {
+ try {
+ let res = await authService(`Slot/get-slot-by-zone/${zoneId}`, 'get', this.user.token, {});
+ this.slots = res.data;
+ return res;
+ } catch (error) {
+ throw error;
+ }
+ },
+ async getFreeSlots(startTime : Number, endTime : Number, vehicleType : string) : Promise> {
+
+ let parkingPlaceId = this.user.data.parkingPlaceId;
+
+ const startTimeStr = startTime.toString();
+ const endTimeStr = endTime.toString();
+
+ return axiosClient.get(`Slot/get-free-slots-by-time-duration/${parkingPlaceId}/${startTimeStr}/${endTimeStr}/${vehicleType}`)
+ .then((res : any) => {
+ this.freeSlots = res.data.slots;
+ return res.data;
+ })
+ .catch((err : any) => {
+ throw err;
+ })
+ },
+ async getSlotDetails(slotId : string) : Promise> {
+ return axiosClient.get(`Slot/get-slot-details-by-id/${slotId}`)
+ .then((res : any) => {
+ console.log(res.data)
+ return res.data;
+ })
+ .catch((err : any) => {
+ throw err;
+ })
+ },
+ async getReservedSlotDetails(slot : string): Promise> {
+ return axiosClient.get(`Slot/get-reserved-slot-details/${slot}`)
+ .then((res : any) => {
+ return res.data;
+ })
+ .catch((err : any) => {
+ throw err;
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/src/store/zonesStore.ts b/src/store/zonesStore.ts
new file mode 100644
index 0000000..6da64f0
--- /dev/null
+++ b/src/store/zonesStore.ts
@@ -0,0 +1,24 @@
+import {defineStore} from "pinia";
+import {authService} from "../services/authService";
+
+
+export const zonesStore = defineStore('zones', {
+ state: () => ({
+ user: {
+ data: JSON.parse(localStorage.getItem('user') || '{}'),
+ token: localStorage.getItem('token') || '',
+ },
+ zones: [],
+ }),
+ actions: {
+ getZones(parkingPlaceId: string) : Promise {
+ return authService(`Zone/get-zones-by-parking-place/${parkingPlaceId}`, 'get', this.user.token, {})
+ .then((res: any) => {
+ this.zones = res.data;
+ return res;
+ }).catch((error) => {
+ throw error;
+ })
+ }
+ }
+})
\ No newline at end of file
diff --git a/src/style.css b/src/style.css
index c239dbc..d908b4f 100644
--- a/src/style.css
+++ b/src/style.css
@@ -4,10 +4,12 @@
@tailwind components;
@tailwind utilities;
+
body{
/*font-family: 'Inter', sans-serif;*/
font-family: 'Poppins', sans-serif;
background-color: #EDF9FC;
+ scroll-behavior: smooth;
/*background-color: #ffffff;*/
}
@@ -23,6 +25,10 @@ body{
color: #0074D9;
}
+.text-ternary{
+ color:#0F72B7;
+}
+
.text-accent{
color: #EDF9FC;
}
@@ -52,6 +58,8 @@ body{
color: #646464;
}
+
+
.late-departures-color{
background-color: #B8DEFF;
}
@@ -67,6 +75,8 @@ body{
#app{
min-height: 100vh;
+ max-width: 100vw;
+ overflow-x: hidden;
}
main{
@@ -97,3 +107,7 @@ main{
border-top: 10px solid #4299e1; /* Change the color to match the background color of the message */
}
+
+button{
+ background-color: #0074d9;
+}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index 37bb1e2..4a5f9de 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -351,6 +351,11 @@
resolved "https://registry.npmjs.org/@vicons/ionicons5/-/ionicons5-0.12.0.tgz"
integrity sha512-Iy1EUVRpX0WWxeu1VIReR1zsZLMc4fqpt223czR+Rpnrwu7pt46nbnC2ycO7ItI/uqDLJxnbcMC7FujKs9IfFA==
+"@vicons/material@^0.12.0":
+ version "0.12.0"
+ resolved "https://registry.npmjs.org/@vicons/material/-/material-0.12.0.tgz"
+ integrity sha512-chv1CYAl8P32P3Ycwgd5+vw/OFNc2mtkKdb1Rw4T5IJmKy6GVDsoUKV3N2l208HATn7CCQphZtuPDdsm7K2kmA==
+
"@vitejs/plugin-vue@^4.1.0":
version "4.2.3"
resolved "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-4.2.3.tgz"
@@ -709,10 +714,10 @@ chart.js@^3.7.1:
resolved "https://registry.npmjs.org/chart.js/-/chart.js-3.9.1.tgz"
integrity sha512-Ro2JbLmvg83gXF5F4sniaQ+lTbSv18E+TIf2cOeiH1Iqd2PGFOtem+DUufMZsCJwFE7ywPOpfXFBwRTGq7dh6w==
-chart.js@^4.1.1, chart.js@^4.3.0, chart.js@>=3.0.0:
- version "4.3.2"
- resolved "https://registry.npmjs.org/chart.js/-/chart.js-4.3.2.tgz"
- integrity sha512-pvQNyFOY1QmbmIr8oDORL16/FFivfxj8V26VFpFilMo4cNvkV5WXLJetDio365pd9gKUHGdirUTbqJfw8tr+Dg==
+chart.js@^4.1.1, chart.js@^4.3.3, chart.js@>=3.0.0:
+ version "4.3.3"
+ resolved "https://registry.npmjs.org/chart.js/-/chart.js-4.3.3.tgz"
+ integrity sha512-aTk7pBw+x6sQYhon/NR3ikfUJuym/LdgpTlgZRe2PaEhjUMKBKyNaFCMVRAyTEWYFNO7qRu7iQVqOw/OqzxZxQ==
dependencies:
"@kurkle/color" "^0.3.0"
@@ -2112,6 +2117,13 @@ vfonts@^0.0.3:
resolved "https://registry.npmjs.org/vfonts/-/vfonts-0.0.3.tgz"
integrity sha512-nguyw8L6Un8eelg1vQ31vIU2ESxqid7EYmy8V+MDeMaHBqaRSkg3dTBToC1PR00D89UzS/SLkfYPnx0Wf23IQQ==
+vicons@^0.0.1:
+ version "0.0.1"
+ resolved "https://registry.npmjs.org/vicons/-/vicons-0.0.1.tgz"
+ integrity sha512-suYeiVqw/q+ijWBlsGP5vhTUphRqLzCLZKqBHK4iuzlOmP1omKWDWQd+da7rDZU7dyPD5TTV9MXTLCxQt3d7zQ==
+ dependencies:
+ vue "^3.0.2"
+
visibilityjs@^1.2.3:
version "1.2.8"
resolved "https://registry.npmjs.org/visibilityjs/-/visibilityjs-1.2.8.tgz"
@@ -2190,7 +2202,7 @@ vue-tsc@^1.4.2:
"@volar/vue-typescript" "1.6.5"
semver "^7.3.8"
-"vue@^2.6.14 || ^3.3.0", vue@^3.0.0, "vue@^3.0.0-0 || ^2.6.0", "vue@^3.0.0-0 || ^2.7.0", vue@^3.0.11, vue@^3.2.0, vue@^3.2.25, vue@^3.2.47, "vue@>= 3", vue@3.3.4:
+"vue@^2.6.14 || ^3.3.0", vue@^3.0.0, "vue@^3.0.0-0 || ^2.6.0", "vue@^3.0.0-0 || ^2.7.0", vue@^3.0.11, vue@^3.0.2, vue@^3.2.0, vue@^3.2.25, vue@^3.2.47, "vue@>= 3", vue@3.3.4:
version "3.3.4"
resolved "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz"
integrity sha512-VTyEYn3yvIeY1Py0WaYGZsXnz3y5UnGi62GjVEqvEGPl6nxbOrCXbVOTQWBEJUqAyTUk2uJ5JLVnYJ6ZzGbrSw==