owliie / scheduler Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Related to: #9
Related to: #11
api/users/profile
{
"firstName": "Atanas",
"lastName": "Vasilev",
"email": "[email protected]",
"phone": "0876357845",
"roles": [
"Business Holder"
],
"company": {
"availability": [
{
"day": 1,
"startHour": 10,
"startMinute": 0,
"endHour": 19,
"endMinute": 0,
"id": "620bcc7e36b6da362e7c2421"
},
{
"day": 2,
"startHour": 9,
"startMinute": 30,
"endHour": 19,
"endMinute": 30,
"id": "620bcc7e36b6da362e7c2422"
},
{
"day": 3,
"startHour": 11,
"startMinute": 30,
"endHour": 20,
"endMinute": 30,
"id": "620bcc7e36b6da362e7c2423"
},
{
"day": 4,
"startHour": 9,
"startMinute": 0,
"endHour": 20,
"endMinute": 0,
"id": "620bcc7e36b6da362e7c2424"
},
{
"day": 5,
"startHour": 8,
"startMinute": 0,
"endHour": 14,
"endMinute": 0,
"id": "620bcc7e36b6da362e7c2425"
}
],
"businessType": "62055417ab89400c51fd7f12",
"description": "Some description comes here",
"address": "Some address comes here",
"id": "620af1ddfcb9e655cbaf8a7e"
},
"id": "61f65f35d0734ccae3e8cbd2"
}
{
"firstName": "JavaScript",
"lastName": "Developer",
"email": "[email protected]",
"phone": "0876359789",
"roles": [],
"id": "61f65dedd0734ccae3e8cbcd"
}
/api/users/profile
{
"firstName": "Nasko",
"lastName": "Atanasov",
"phone": "0876351984"
}
{
"message": "The user personal data is updated.",
"status": "success",
"data": null
}
api/businesses/company
{
"description": "Business description comes here ...",
"address": "Business address comes here ..."
}
{
"message": "The business details are updated.",
"status": "success",
"data": null
}
users/profile/businessType
{
"businessTypeId": "62055417ab89400c51fd7f12"
}
{
"message": "The new business type is set.",
"status": "success",
"data": {}
}
{
"message": "Error while setting the business type",
"status": "failure",
"data": {}
}
https://www.figma.com/file/1vHREHkbka8hwyxDHRpcyx/Scheduler?node-id=1011%3A7046
api/businesses/schedule?date=2022-01-05
[
{
"createdOn": "2022-02-16T21:45:12.836Z",
"client": {
"firstName": "Atanas",
"lastName": "Vasilev",
"email": "[email protected]",
"phone": "0876357845",
"id": "61f65f35d0734ccae3e8cbd2"
},
"status": "Accepted",
"start": "2022-02-16T11:00:00.000Z",
"durationInMinutes": 60,
"product": {
"name": "Gentleman hairstyle",
"price": 34,
"id": "620af4ae04c7041ba09de80c"
},
"id": "620d7a8ed426a4beea96806c"
},
{
"createdOn": "2022-02-16T19:56:02.582Z",
"client": {
"firstName": "Nasko",
"lastName": "Atanasov",
"email": "[email protected]",
"phone": "0876351984",
"id": "61f65dedd0734ccae3e8cbcd"
},
"status": "Pending",
"start": "2022-02-16T14:30:00.000Z",
"durationInMinutes": 30,
"product": {
"name": "Gentleman hairstyle",
"price": 34,
"id": "620af4ae04c7041ba09de80c"
},
"id": "620d5888dce94d51dd61a675"
},
{
"createdOn": "2022-02-16T21:45:12.836Z",
"client": {
"firstName": "Atanas",
"lastName": "Vasilev",
"email": "[email protected]",
"phone": "0876357845",
"id": "61f65f35d0734ccae3e8cbd2"
},
"status": "Pending",
"start": "2022-02-16T15:00:00.000Z",
"durationInMinutes": 45,
"product": {
"name": "Gentleman hairstyle",
"price": 34,
"id": "620af4ae04c7041ba09de80c"
},
"id": "620d7654d426a4beea96803a"
}
]
api/appointments/accept/:id
api/appointments/accept/620d7aadd426a4beea96807d
{
"message": "The appointment is successfully accepted.",
"status": "success",
"data": null
}
{
"message": "Error while accepting the appointment.",
"status": "failure",
"data": null
}
api/appointments/decline/:id
api/appointments/decline/620d7aadd426a4beea96807d
{
"message": "The appointment is successfully declined.",
"status": "success",
"data": null
}
{
"message": "Error while declining the appointment.",
"status": "failure",
"data": null
}
Related to: #6
Related to: #5
Implement JWT authentication
Related to: #26
Relarted to: #8
/businessTypes
- get all the business types[
{
"name": "Tattoo",
"imagePath": "public/images/business-types/tattoo.jpg",
"id": "62055417ab89400c51fd7f12"
},
{
"name": "Hairdressing",
"imagePath": "public/images/business-types/hairdressing.jpg",
"id": "62055f84e558e7a0d557c13b"
},
{
"name": "Manicure",
"imagePath": "public/images/business-types/manicure.jpg",
"id": "62055fae04e12981d9499be8"
},
{
"name": "Barbershop",
"imagePath": "public/images/business-types/barbershop.jpg",
"id": "620580f9f9d07477d628daf1"
},
{
"name": "Massage",
"imagePath": "public/images/business-types/massage.jpg",
"id": "620580f9f9d07477d628daf2"
},
{
"name": "Personal Trainer",
"imagePath": "public/images/business-types/personal-trainer.jpg",
"id": "620580f9f9d07477d628daf3"
},
{
"name": "Dentist",
"imagePath": "public/images/business-types/dentist.jpg",
"id": "620580f9f9d07477d628daf4"
}
]
/businesses/byType/:id
where id is the id of the service type
[
{
"id": "6c9ef89f-d9b0-43c6-9aae-99102281884c",
"firstName": "Anna",
"lastName": "Velichkova",
"phone": "+35987568945",
"description": "Anna hairdressing studio",
"address": "Sofia, ul. \"Atanas Manchev\" 18",
"addedToFavourites": false
},
{
"id": "6c9ef89f-d9b0-43c6-9aae-99102281884c",
"firstName": "Galena",
"lastName": "Petrova",
"phone": "+35987568333",
"description": "Gelena hairdressing studio",
"address": "Sofia, ul. \"Atanas Ishirkov\" 18",
"addedToFavourites": true
},
{
"id": "6c9ef89f-d9b0-43c6-9aae-99102281884d",
"firstName": "Maria",
"lastName": "Marinova",
"phone": "+35987568777",
"description": "Maria hairdressing studio",
"address": "Sofia, ul. \"Ivan Vazov\" 18",
"addedToFavourites": false
},
{
"id": "6c9ef89f-d9b0-43c6-9aae-99102281884e",
"firstName": "Plamen",
"lastName": "Terziev",
"phone": "+35987568475",
"description": "Plamen hairdressing studio",
"address": "Sofia, ul. \"Ivan Ivanov\" 18",
"addedToFavourites": true
},
{
"id": "6c9ef89f-d9b0-43c6-9aae-991022818dfc",
"firstName": "Mario",
"lastName": "Kirov",
"phone": "+35987568783",
"description": "Mario hairdressing studio",
"address": "Sofia, bul. \"Asen Yordanov\" 1",
"addedToFavourites": false
},
{
"id": "6c9ef89f-d9b0-43c6-9aae-99102281rf4c",
"firstName": "Ivan",
"lastName": "Ivanov",
"phone": "+35987568478",
"description": "Ivan hairdressing studio",
"address": "Sofia, bul. \"Bulgaria\" 11",
"addedToFavourites": false
}
]
/api/users/favourites/:id
/api/users/favourites/6c9ef89f-d9b0-43c6-9aae-99102281884c
{
"message": "Removed from favourites.",
"status": "success"
}
- 400 Bad request
{
"message": "Problem while removing from favourites.",
"status": "failure"
}
api/users/favourites
{
"businessId": "6c9ef89f-d9b0-43c6-9aae-99102281884c"
}
{
"message": "Added to favourites.",
"status": "success"
}
- 400 Bad request
{
"message": "Problem while adding to favourites.",
"status": "failure"
}
/api/users/register
{
"firstName": "JavaScript",
"lastName": "Developer",
"password": "123QWE!@#",
"email": "[email protected]",
"phone": "0876359789"
}
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjY1ZGVkZDA3MzRjY2FlM2U4Y2JjZCIsImVtYWlsIjoiZGV2QHNjaGVkdWxlci5jb20iLCJyb2xlcyI6W10sImlhdCI6MTY0MzUzNTg1MywiZXhwIjoxNjQzNTM5NDUzfQ.fchaX6Poxw3sZz9oKgrB3wb2ol9gfHn6s2aYB5fgmrM",
"email": "[email protected]",
"id": "61f65dedd0734ccae3e8cbcd"
}
400 Bad request
{
"message": "User with the same email already exists",
"status": "failure"
}
/api/users/register?type=BusinessHolder
{
"firstName": "Atanas",
"lastName": "Vasilev",
"password": "n.it2021#JSAdv@nced",
"email": "[email protected]",
"phone": "0876357845",
"address": "Sofia, Bulgaria, street ...",
"description": "One of the best hairdressers in the town!",
"availability": [1, 2, 3, 4, 5]
}
TODO: discuss the availability
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjY1ZjM1ZDA3MzRjY2FlM2U4Y2JkMiIsImVtYWlsIjoibmFza28uaXRAc2NoZWR1bGVyLmNvbSIsInJvbGVzIjpbIkJ1c2luZXNzIEhvbGRlciJdLCJpYXQiOjE2NDM1MzYxODEsImV4cCI6MTY0MzUzOTc4MX0.OaSlPItyW3kX-cHNIqt-nf3-G-WW1ZbGF5xmdAySKk8",
"email": "[email protected]",
"roles": [
"Business Holder"
],
"id": "61f65f35d0734ccae3e8cbd2"
}
400 Bad request
{
"message": "User with the same email already exists",
"status": "failure"
}
Related to: #14
Back-end: #19
https://www.figma.com/file/1vHREHkbka8hwyxDHRpcyx/Scheduler?node-id=1015%3A3658
/api/users/favourites
[
{
"firstName": "Atanas",
"lastName": "Vasilev",
"company": {
"businessType": {
"name": "Tattoo",
"imagePath": "public/images/business-types/tattoo.jpg",
"id": "62055417ab89400c51fd7f12"
},
"description": "Some description comes here",
"address": "Some address comes here",
"id": null
},
"id": "61f65f35d0734ccae3e8cbd2"
}
]
/api/users/favourites/:id
/api/users/favourites/6c9ef89f-d9b0-43c6-9aae-99102281884c
{
"message": "Removed from favourites.",
"status": "success"
}
- 400 Bad request
{
"message": "Problem while removing from favourites.",
"status": "failure"
}
appointments/621041dffc654878830b0932
{
"start": "2022-01-19T17:00:00",
"durationInMinutes": 60
}
{
"message": "The appointment was updated successfully.",
"status": "success",
"data": null
}
{
"message": "The appointment does not exist.",
"status": "failure",
"data": {}
}
Business schema should contain:
http://localhost:4000/api/users/profile/availability
{
"availability": [
{
"day": 1,
"startHour": 10,
"startMinute": 0,
"endHour": 19,
"endMinute": 0
},
{
"day": 2,
"startHour": 9,
"startMinute": 30,
"endHour": 19,
"endMinute": 30
},
{
"day": 3,
"startHour": 11,
"startMinute": 30,
"endHour": 20,
"endMinute": 30
},
{
"day": 4,
"startHour": 9,
"startMinute": 0,
"endHour": 20,
"endMinute": 0
},
{
"day": 5,
"startHour": 9,
"startMinute": 0,
"endHour": 14,
"endMinute": 0
}
]
}
{
"message": "The user availability is updated.",
"status": "success",
"data": null
}
{
"message": "Start time cannot be less than or equal to end time",
"status": "failure",
"data": {}
}
api/products
- get all the user products[
{
"name": "Gentleman hairstyle",
"price": 25,
"durationInMinutes": 30,
"id": "62094c87e193dd9cf08a9f42"
},
{
"name": "High-level manicure",
"price": 25,
"durationInMinutes": 30,
"id": "62094bfae193dd9cf08a9f3b"
}
]
api/products
{
"name": "Gentleman hairstyle",
"durationInMinutes": 30
"price": 25
}
{
"message": "Product created successfully.",
"status": "success",
"data": {
"name": "Gentleman hairstyle",
"price": 25,
"durationInMinutes": 30
"businessOwner": "62094ad7067d0057c39da553",
"id": "62094ed8e193dd9cf08a9f47"
}
}
{
"message": "Error while saving the product.",
"status": "failure",
"data": {}
}
api/products/:id
api/products/6208fe8a0f8742bc3a35f0a
where 6208fe8a0f8742bc3a35f0a
is the product id{
"name": "Gentleman hairstyle - edited",
"price": 33,
"durationInMinutes": 30
}
{
"message": "The product were updated successfully.",
"status": "success",
"data": {}
}
{
"message": "Error while updating the product",
"status": "failure",
"data": {}
}
api/products/:id
where id is the product id. Example: http://localhost:4000/api/products/62055f84e558e7a0d557c13b
{
"message": "The product was deleted",
"status": "success",
"data": {}
}
{
"message": "Problem occur while deleting the product.",
"status": "failure",
"data": {}
}
Related to: #7
Related to: #23
https://www.figma.com/file/1vHREHkbka8hwyxDHRpcyx/Scheduler?node-id=1011%3A5282
/api/appointments/upcoming
[
{
"createdOn": "2022-02-16T21:45:12.836Z",
"businessHolder": {
"firstName": "Atanas",
"lastName": "Vasilev",
"email": "[email protected]",
"phone": "0876357845",
"company": {
"businessType": {
"name": "Tattoo",
"imagePath": "public/images/business-types/tattoo.jpg",
"id": "62055417ab89400c51fd7f12"
},
"description": "Business description comes here ...",
"address": "Business address comes here ...",
"id": null
},
"id": "61f65f35d0734ccae3e8cbd2"
},
"status": "Accepted",
"start": "2022-02-17T18:30:00.000Z",
"durationInMinutes": 55,
"product": {
"name": "Gentleman hairstyle",
"price": 34,
"id": "620af4ae04c7041ba09de80c"
},
"id": "620d7afcd426a4beea9680ac"
},
{
"createdOn": "2022-02-16T21:45:12.836Z",
"businessHolder": {
"firstName": "Atanas",
"lastName": "Vasilev",
"email": "[email protected]",
"phone": "0876357845",
"company": {
"businessType": {
"name": "Tattoo",
"imagePath": "public/images/business-types/tattoo.jpg",
"id": "62055417ab89400c51fd7f12"
},
"description": "Business description comes here ...",
"address": "Business address comes here ...",
"id": null
},
"id": "61f65f35d0734ccae3e8cbd2"
},
"status": "Pending",
"start": "2022-02-18T10:15:00.000Z",
"durationInMinutes": 40,
"product": {
"name": "Gentleman hairstyle",
"price": 34,
"id": "620af4ae04c7041ba09de80c"
},
"id": "620d7ac4d426a4beea96808e"
}
]
public/images/business-types/hairdressing.jpg
https://www.figma.com/file/1vHREHkbka8hwyxDHRpcyx/Scheduler?node-id=1011%3A5573
/businesses/:id
{
"firstName": "Atanas",
"lastName": "Vasilev",
"phone": "0876357845",
"description": "Business description comes here ...",
"address": "Business address comes here ...",
"id": "61f65f35d0734ccae3e8cbd2",
"businessType": {
"name": "Tattoo",
"imagePath": "public/images/business-types/tattoo.jpg",
"id": "62055417ab89400c51fd7f12"
},
"addedToFavourites": false
}
/api/businesses/products/61f65f35d0734ccae3e8cbd2
[
{
"name": "Gentleman hairstyle",
"price": 20,
"durationInMinutes": 45,
"id": "620af4ae04c7041ba09de80c"
}
]
api/businesses/freeSlots/61f65f35d0734ccae3e8cbd2?date=2022-02-16
[
{
"start": {
"hour": 11,
"minute": 30
},
"end": {
"hour": 16,
"minute": 30
}
},
{
"start": {
"hour": 17,
"minute": 45
},
"end": {
"hour": 20,
"minute": 30
}
}
]
{
"message": "The business is not working at the selected date.",
"status": "failure",
"data": {}
}
api/appointments
{
"businessHolder": "61f65f35d0734ccae3e8cbd2",
"start": "2022-02-16T17:00",
"durationInMinutes": 45,
"product": "620af4ae04c7041ba09de80c"
}
{
"message": "The appointment was created successfully",
"status": "success",
"data": {
"createdOn": "2022-02-16T21:45:12.836Z",
"client": "61f65f35d0734ccae3e8cbd2",
"businessHolder": "61f65f35d0734ccae3e8cbd2",
"status": "Pending",
"start": "2022-02-16T15:00:00.000Z",
"durationInMinutes": 45,
"product": "620af4ae04c7041ba09de80c",
"id": "620d7654d426a4beea96803a"
}
}
{
"message": "The selected time slot is not free.",
"status": "failure",
"data": {}
}
/api/users/login
{
"password": "n.it2021#JSAdv@nced",
"email": "[email protected]"
}
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYyMDk0YWQ3MDY3ZDAwNTdjMzlkYTU1MyIsImVtYWlsIjoibmV0aS5pdEBzY2hlZHVsZXIuY29tIiwicm9sZXMiOlsiQnVzaW5lc3MgSG9sZGVyIl0sImlhdCI6MTY0NDk0MzgwOCwiZXhwIjoxNjQ0OTQ3NDA4fQ.XtgNqaUpe_9aX2_urdYjGZKjbaLt0sKc-iBvG-h0fXM",
"id": "62094ad7067d0057c39da553",
"email": "[email protected]",
"roles": [
"Business Holder"
],
"firstName": "Aneta",
"lastName": "Tsvetkova",
"phone": "0876357785"
}
400 Bad request:
{
"message": "Invalid username or password.",
"status": "failure"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.