Projekto tikslas – sukurti informacinę sistemą, leidžiančią smulkioms įmonėms ar verslams (kirpykloms, odontologijos kabinetams, grožio salonams ir t.t.), kurių biudžetas neleidžia turėti nuosavos IS, registruoti būsimus vizitus, o jų klientams – rezervuoti pasirinktą vizito laiką.
Šią informacinę sistemą sudarys dvi esminės dalys – aplikacijų programavimo sąsaja (angl. API) bei grafinė naudotojo sąsaja, realizuota kaip WEB aplikacija.
Įmonė ar verslas, norėdamas pradėti naudotis informacine sistema ir suteikti galimybę savo klientams rezervuoti vizito laikus, iš pradžių turės užsiregistruoti – nurodyti veiklos pavadinimą, rūšį, kontaktus. Atlikusi šiuos veiksmus įmonė turės sulaukti administratoriaus patvirtinimo. Gavusi patvirtinimą įmonė galės pridėti savo teikiamas paslaugas (paslaugos iš esmės galėtų būti ir tokios pačios, tiesiog skirtųsi tas paslaugas suteikiantys specialistai) – kiekvienai jų reikės nurodyti aprašymą, tą paslaugą suteikiančio specialisto darbo laiką, specialisto kontaktus. Klientas, norėdamas atlikti laiko rezervaciją tam tikroje įmonėje, tam tikrai paslaugai, turės taip pat užsiregistruoti nurodydamas savo asmeninius duomenis – vardą, pavardę, el. paštą, telefono numerį. Atlikęs pasirinkto laiko rezervaciją klientas turės sulaukti patvirtinimo iš įmonės, o vėliau, esant poreikiui, tiek klientas, tiek įmonė rezervaciją galės atšaukti.
Neregistruotas sistemos naudotojas (svečias) galės:
- Peržiūrėti įmonių sąrašą
- Peržiūrėti informaciją apie konkrečią įmonę
- Peržiūrėti konkrečios įmonės teikiamas paslaugas
- Peržiūrėti konkrečios įmonės ir konkrečios paslaugos sukurtas rezervacijas (laisvus vizitų laikus)
- Užsiregistruoti kaip klientas
- Užsiregistruoti kaip paslaugas teikianti įmonė
Registruotas sistemos naudotojas (įmonė) galės:
- Prisijungti
- Atsijungti
- Pridėti teikiamą paslaugą
- Peržiūrėti paslaugos informaciją
- Atnaujinti paslaugos informaciją
- Ištrinti teikiamą paslaugą
- Peržiūrėti savo įmonės teikiamų paslaugų sąrašą
- Peržiūrėti informaciją apie konkrečią rezervaciją
- Peržiūrėti konkrečios paslaugos rezervacijų sąrašą
- Atnaujinti įmonės informaciją
Registruotas sistemos naudotojas (klientas) galės:
- Prisijungti
- Atsijungti
- Peržiūrėti įmonių sąrašą
- Peržiūrėti informaciją apie konkrečią įmonę
- Peržiūrėti konkrečios įmonės teikiamas paslaugas
- Peržiūrėti konkrečios įmonės ir konkrečios paslaugos sukurtas rezervacijas (laisvus vizitų laikus)
- Sukurti rezervaciją
- Atšaukti (ištrinti) konkrečią rezervaciją
- Atnaujinti rezervacijos duomenis
- Peržiūrėti savo visų rezervacijų sąrašą
Registruotas sistemos naudotojas (administratorius) galės:
- Prisijungti
- Atsijungti
- Peržiūrėti įmonių sąrašą
- Peržiūrėti informaciją apie konkrečią įmonę
- Peržiūrėti konkrečios įmonės teikiamas paslaugas
- Peržiūrėti konkrečios įmonės ir konkrečios paslaugos sukurtas rezervacijas (laisvus vizitų laikus)
- Patvirtinti įmonės registraciją
- Pašalinti įmonę
Sistemą sudarys dvi dalys:
- Serverio pusė (aplikacijų programavimo sąsaja) – ji bus realizuota su Go programavimo kalba. Duomenų bazės valdymo sistema buvo pasirinkta PostgreSQL.
- Kliento pusė – ji bus realizuota su JavaScript biblioteka React.
2.1 pav. pavaizduota sistemos diegimo diagrama. Sistemos talpinimui bus panaudotas Amazon Web Services serveris, kuriame sistemos naudotojų užklausas HTTP protokolu apdoros Traefik atvirkštinis tarpinis serveris (angl. reverse proxy) – jis HTTP užklausas persiųs arba į aplikacijų programavimo sąsają (serverio dalį), arba į WEB aplikaciją (kliento dalį), tuomet sulauks atsakymo ir jį persiųs atgal sistemos naudotojui. Sistemos realizacijai prireiks duomenų bazės valdymo serverio, o komunikaciją su juo atliks aplikacijų programavimo sąsaja TCP/IP protokolu.
pav. 2.1 Sistemos diegimo diagrama
Žemiau pateikiami projektuojamos sąsajos langų wireframe`ai ir juos atitinkančių realizacijų langų iškarpos.
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Wireframe:
Realizacijos langas:
Field | Type | Description |
---|---|---|
name | string | Error code name |
message | string | Error message |
name | message | HTTP status code |
---|---|---|
not_found | Not found | 404 |
name | message | HTTP status code |
---|---|---|
forbidden | Forbidden | 403 |
name | message | HTTP status code |
---|---|---|
unauthorized | Unauthorized | 401 |
name | message | HTTP status code |
---|---|---|
faulty_token | Faulty token provided | 400 |
name | message | HTTP status code |
---|---|---|
token_invalid_or_expired | Token is invalid or expired | 401 |
name | message | HTTP status code |
---|---|---|
bad_request | Bad request | 400 |
name | message | HTTP status code |
---|---|---|
internal_server_error | Internal server error | 500 |
name | message | HTTP status code |
---|---|---|
invalid_input | Input could not pass the validations | 400 |
name | message | HTTP status code |
---|---|---|
unknown | Unknown error | 500 |
Field | Type | Null? | Description |
---|---|---|---|
error | Error | on success | If response is unsuccessful, error code will be non null |
data | any | on error | The data type is specific to each endpoint |
You can authenticate using JWT token. Token must be provided in the HTTP Authorization
header.
Example:
Authorization: Bearer <accessToken>
Authentication endpoint. Returns JWT token if authentication is successful.
https://reservio.hs.vc/api/v1/users/authenticate
Response formats | JSON |
---|---|
Requires authentication? | No |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
string | yes | User's email address | less than or equal to 200 chars | user@gmail.com | |
password | string | yes | User's password | between 8 and 100 chars | Secret444! |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
accessToken | string | no | JWT access token |
refreshToken | string | no | JWT refresh token |
name | message | HTTP status code |
---|---|---|
invalid_input | ||
invalid_credentials | Invalid credentials | 401 |
unknown |
POST /api/v1/users/authenticate HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
{
"email": "user@gmail.com",
"password": "Secret444!"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2Njg3MTMyMjcuNzMzMjM1LCJpYXQiOjE2Njg3MTAyMjcuNzMzMjQyLCJpc3MiOiJyZXNlcnZpbyIsInVzZXJJRCI6IjdiNTYyNGMyLTc3MTMtNGJiMy1iOGQ1LWVhMjliNTc5MjExNSIsInJvbGUiOiJjb21wYW55IiwicnRJRCI6IjY3MWVmNTNmLWY1YWYtNDM0NS05ODQzLWJhMzZkOThkNzlkYiJ9.YzCdBuLYFohulk50yF-hWguSPWR41H2pwqgGXPpnE5Q",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2Njg3MTc0MjcuNzMzMTc0LCJpYXQiOjE2Njg3MTAyMjcuNzMzMTgyLCJpc3MiOiJyZXNlcnZpbyIsInJ0SUQiOiI2NzFlZjUzZi1mNWFmLTQzNDUtOTg0My1iYTM2ZDk4ZDc5ZGIifQ.aJ20LIyi1M5dXm3RbhKx26WK85q07EamUik0QGd8CqA"
}
}
Refresh token endpoint. Returns new JWT token if refresh token is valid.
https://reservio.hs.vc/api/v1/tokens
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | any |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
refreshToken | string | yes | JWT refresh token | - | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2Njg3MTc0MjcuNzMzMTc0LCJpYXQiOjE2Njg3MTAyMjcuNzMzMTgyLCJpc3MiOiJyZXNlcnZpbyIsInJ0SUQiOiI2NzFlZjUzZi1mNWFmLTQzNDUtOTg0My1iYTM2ZDk4ZDc5ZGIifQ.aJ20LIyi1M5dXm3RbhKx26WK85q07EamUik0QGd8CqA |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
accessToken | string | no | JWT access token |
name | message | HTTP status code |
---|---|---|
invalid_input | ||
faulty_token | ||
invalid_token | ||
unknown |
POST /api/v1/tokens HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
{
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2Njg3MTc0MjcuNzMzMTc0LCJpYXQiOjE2Njg3MTAyMjcuNzMzMTgyLCJpc3MiOiJyZXNlcnZpbyIsInJ0SUQiOiI2NzFlZjUzZi1mNWFmLTQzNDUtOTg0My1iYTM2ZDk4ZDc5ZGIifQ.aJ20LIyi1M5dXm3RbhKx26WK85q07EamUik0QGd8CqA"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2Njg3MTc0MzAuNDQ0MjcyLCJpYXQiOjE2Njg3MTQ0MzAuNDQ0Mjc5LCJpc3MiOiJyZXNlcnZpbyIsInVzZXJJRCI6IjdiNTYyNGMyLTc3MTMtNGJiMy1iOGQ1LWVhMjliNTc5MjExNSIsInJvbGUiOiJjb21wYW55IiwicnRJRCI6IjY3MWVmNTNmLWY1YWYtNDM0NS05ODQzLWJhMzZkOThkNzlkYiJ9.Y2BovB5Tuq3_FLiDdjGUj0XYQB_cG0umWpNJSEfpy9Q"
}
}
Logout endpoint. Invalidates refresh token.
https://reservio.hs.vc/api/v1/users/logout
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | any |
none
HTTP status code: 204
name | message | HTTP status code |
---|---|---|
unauthorized | ||
faulty_token | ||
invalid_token | ||
unknown |
POST /api/v1/users/logout HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 204 No Content
Content-Type: application/json
Create client endpoint. Creates new client and returns its data.
https://reservio.hs.vc/api/v1/clients
Response formats | JSON |
---|---|
Requires authentication? | No |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
string | yes | Client email address | less than or equal to 200 chars | user@gmail.com | |
password | string | yes | Client password | between 8 and 100 chars | Secret444! |
firstName | string | yes | Client first name | between 3 and 50 chars | John |
lastName | string | yes | Client last name | between 3 and 50 chars | Devo |
phone | string | yes | Client phone number | e164 standart | +37061354544 |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Created user ID |
string | no | Client email address | |
firstName | string | no | Client first name |
lastName | string | no | Client last name |
phone | string | no | Client phone number |
name | message | HTTP status code |
---|---|---|
invalid_input | ||
email_already_exists | Email already exists | 422 |
unknown |
POST /api/v1/clients HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
{
"email": "user@gmail.com",
"password": "Secret444!",
"firstName": "John",
"lastName": "Devo",
"phone": "+37061354544"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"id": "3b218c3f-b443-4c15-8984-33654aa16a82",
"email": "user@gmail.com",
"firstName": "John",
"lastName": "Devo",
"phone": "+37061354544"
}
}
Returns all client reservations.
https://reservio.hs.vc/api/v1/clients/:clientID/reservations
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | Client |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:clientID | string | yes | Client ID | - | d662e339-6fd0-4de3-b3d2-7118ce70ee53 |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
reservations | Reservation[] | no | Array of reservations |
Reservation type:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Reservation ID |
service | Service | no | Reservation service |
date | string | no | Reservation date |
comment | string | yes | Reservation comment |
Service type:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Service ID |
company | Company | no | Service company |
title | string | no | Service title |
description | string | no | Service description |
specialistName | string | yes | Service specialist name |
specialistPhone | string | yes | Service specialist phone |
visitDuration | number | no | Service visit duration |
workSchedule | Map<Weekday, DaySchedule> | no | Service work schedule |
Weekday type:
Name | Type | Can be null? | Description |
---|---|---|---|
string | no | One of: monday, tuesday, wednesday, thursday, friday, saturday, sunday |
DaySchedule type:
Name | Type | Can be null? | Description |
---|---|---|---|
from | string | no | Day start time (eg. 10:30) |
to | string | no | Day end time (eg. 18:00) |
Company type:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Company ID |
string | no | Company email address | |
name | string | no | Company name |
address | string | no | Company address |
description | string | no | Company description |
approved | boolean | no | Is company approved by admin? |
name | message | HTTP status code |
---|---|---|
unauthorized | ||
faulty_token | ||
invalid_token | ||
forbidden | ||
invalid_input | ||
client_not_found | Client not found | 404 |
unknown |
GET /api/v1/clients/d662e339-6fd0-4de3-b3d2-7118ce70ee53/reservations HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"reservations": [
{
"id": "4ee0457e-e7ff-45bc-9d86-9623ce3e9d15",
"service": {
"id": "cba4fef6-490b-4d56-af12-eb153c97893d",
"company": {
"id": "7b5624c2-7713-4bb3-b8d5-ea29b5792115",
"email": "servisas@gmail.com",
"name": "Automobilių servisas",
"address": "Ozo g. 10, Vilnius",
"description": "Automobilių servisas Vilniuje",
"approved": true
},
"title": "Padangų keitimas",
"description": "Pigus automobilio padangų keitimas",
"specialistName": "Jonas",
"specialistPhone": "+37064343332",
"visitDuration": 30,
"workSchedule": {
"monday": {
"from": "08:00",
"to": "16:00"
},
"thursday": {
"from": "10:00",
"to": "14:00"
},
"tuesday": {
"from": "11:30",
"to": "17:00"
},
"wednesday": {
"from": "08:00",
"to": "17:00"
}
}
},
"date": "2022-11-17 12:30",
"comment": "Okaya"
}
]
}
}
Create company endpoint. Creates new company and returns its data.
https://reservio.hs.vc/api/v1/companies
Response formats | JSON |
---|---|
Requires authentication? | No |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
string | yes | Company email address | less than or equal to 200 chars | user@gmail.com | |
password | string | yes | Company password | between 8 and 100 chars | Secret444! |
name | string | yes | Company name | between 3 and 100 chars | My company |
address | string | yes | Company address | between 5 and 200 chars | Vilnius, Lithuania |
description | string | yes | Company description | greater than or equal to 200 chars | Very good company |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Created company ID |
string | no | Company email address | |
name | string | no | Company name |
address | string | no | Company address |
description | string | no | Company description |
approved | boolean | no | Is company approved by admin? When created, equals to false |
name | message | HTTP status code |
---|---|---|
invalid_input | ||
email_already_exists | Email already exists | 422 |
unknown |
POST /api/v1/companies HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
{
"email": "user@gmail.com",
"password": "Secret444!",
"name": "My company",
"address": "Vilnius, Lithuania",
"description": "Very good company"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"id": "07c35941-0af3-4011-b42e-40bca152f2b8",
"email": "user@gmail.com",
"name": "My company",
"address": "Vilnius, Lithuania",
"description": "Very good company",
"approved": false
}
}
Returns all registered companies. When requested by admin, returns all companies, otherwise returns only approved companies.
https://reservio.hs.vc/api/v1/companies
Response formats | JSON |
---|---|
Requires authentication? | No |
none
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
companies | Company[] | no | Array of companies |
Company type:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Company ID |
string | no | Company email address | |
name | string | no | Company name |
address | string | no | Company address |
description | string | no | Company description |
approved | boolean | no | Is company approved by admin? If request is made not by admin, always equals to true |
name | message | HTTP status code |
---|---|---|
unknown |
GET /api/v1/companies HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"companies": [
{
"id": "7b5624c2-7713-4bb3-b8d5-ea29b5792115",
"email": "servisas@gmail.com",
"name": "Automobilių servisas",
"address": "Ozo g. 10, Vilnius",
"description": "Automobilių servisas Vilniuje",
"approved": true
},
{
"id": "e91f4c92-1371-48a1-a745-7d66d2178e15",
"email": "plovykla@gmail.com",
"name": "Plovykla",
"address": "Vilniaus g. 17, Kaunas",
"description": "Automobilių plovykla Kaune",
"approved": true
}
]
}
}
Returns company data by its ID.
https://reservio.hs.vc/api/v1/companies/:companyID
Response formats | JSON |
---|---|
Requires authentication? | No |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | 7b5624c2-7713-4bb3-b8d5-ea29b5792115 |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Company ID |
string | no | Company email address | |
name | string | no | Company name |
address | string | no | Company address |
description | string | no | Company description |
approved | boolean | no | Is company approved by admin? |
name | message | HTTP status code |
---|---|---|
company_not_found | Company not found | 404 |
unknown |
GET /api/v1/companies/7b5624c2-7713-4bb3-b8d5-ea29b5792115 HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"id": "7b5624c2-7713-4bb3-b8d5-ea29b5792115",
"email": "servisas@gmail.com",
"name": "Automobilių servisas",
"address": "Ozo g. 10, Vilnius",
"description": "Automobilių servisas Vilniuje",
"approved": true
}
}
Updates company data by its ID.
https://reservio.hs.vc/api/v1/companies/:companyID
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | Company or Admin |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | 7b5624c2-7713-4bb3-b8d5-ea29b5792115 |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
name | string | no | Company name. Can only be set by company. | between 3 and 100 chars | My company |
address | string | no | Company address. Can only be set by company. | between 5 and 200 chars | Vilnius, Lithuania |
description | string | no | Company description. Can only be set by company. | greater than or equal to 200 chars | Very good company |
approved | boolean | no | Is company approved? Can only be set by admin. | - | true |
HTTP status code: 204
name | message | HTTP status code |
---|---|---|
unauthorized | ||
faulty_token | ||
invalid_token | ||
forbidden | ||
invalid_input | ||
company_not_found | Company not found | 404 |
nothing_to_update | Nothing to update | 400 |
unknown |
PATCH /api/v1/companies/7b5624c2-7713-4bb3-b8d5-ea29b5792115 HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
{
"name": "My company",
"address": "Vilnius, Lithuania"
}
HTTP/1.1 204 No Content
Content-Type: application/json
Deletes company by its ID.
https://reservio.hs.vc/api/v1/companies/:companyID
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | Admin |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | 7b5624c2-7713-4bb3-b8d5-ea29b5792115 |
HTTP status code: 204
name | message | HTTP status code |
---|---|---|
unauthorized | ||
faulty_token | ||
invalid_token | ||
forbidden | ||
invalid_input | ||
company_not_found | Company not found | 404 |
unknown |
DELETE /api/v1/companies/7b5624c2-7713-4bb3-b8d5-ea29b5792115 HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 204 No Content
Content-Type: application/json
Create service endpoint. Creates new company service and returns its data.
https://reservio.hs.vc/api/v1/companies/:companyID/services
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | Company |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | 7b5624c2-7713-4bb3-b8d5-ea29b5792115 |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
title | string | yes | Service title | between 3 and 100 chars | Men's haircut |
description | string | yes | Service description | greater than or equal to 5 chars | Cheap men's haircut |
specialistName | string | no | Service specialist name | between 5 and 100 chars | John |
specialistPhone | string | no | Service specialist phone | e164 standart | +37064343333 |
visitDuration | number | yes | Service visit duration | greater than 0 | 30 |
workSchedule | Map<Weekday, DaySchedule> | yes | Service work schedule | size greater than 0 | { "monday": { "from": "08:00", "to": "17:00" } } |
Weekday type:
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
string | yes | Work schedule week day | One of: monday, tuesday, wednesday, thursday, friday, saturday, sunday | friday |
DaySchedule type:
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
from | string | yes | Day start time | time format HH:mm | 10:30 |
to | string | yes | Day end time | time format HH:mm | 18:00 |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Service ID |
companyID | string | no | Company ID |
title | string | no | Service title |
description | string | no | Service description |
specialistName | string | yes | Service specialist name |
specialistPhone | string | yes | Service specialist phone |
visitDuration | number | no | Service visit duration |
workSchedule | Map<Weekday, DaySchedule> | no | Service work schedule |
name | message | HTTP status code |
---|---|---|
unauthorized | ||
faulty_token | ||
invalid_token | ||
forbidden | ||
invalid_input | ||
company_not_found | Company not found | 404 |
unknown |
POST /api/v1/companies/7b5624c2-7713-4bb3-b8d5-ea29b5792115/services HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
{
"title": "Men's haircut",
"description": "Cheap men's haircut",
"specialistName": "John",
"specialistPhone": "+37064343333",
"visitDuration": 30,
"workSchedule": {
"monday": {
"from": "08:00",
"to": "17:00"
},
"tuesday": {
"from": "11:45",
"to": "17:00"
},
"wednesday": {
"from": "08:00",
"to": "17:00"
}
}
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"id": "fda84995-0755-40e3-8ed4-129fc774125b",
"companyID": "e91f4c92-1371-48a1-a745-7d66d2178e15",
"title": "Men's haircut",
"description": "Cheap men's haircut",
"specialistName": "John",
"specialistPhone": "+37064343333",
"visitDuration": 30,
"workSchedule": {
"monday": {
"from": "08:00",
"to": "17:00"
},
"thursday": {
"from": "10:15",
"to": "14:00"
},
"tuesday": {
"from": "11:45",
"to": "17:00"
}
}
}
}
Get service endpoint. Returns service data.
https://reservio.hs.vc/api/v1/companies/:companyID/services/:serviceID
Response formats | JSON |
---|---|
Requires authentication? | No |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | e91f4c92-1371-48a1-a745-7d66d2178e15 |
:serviceID | string | yes | Service ID | - | fda84995-0755-40e3-8ed4-129fc774125b |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Service ID |
companyID | string | no | Company ID |
title | string | no | Service title |
description | string | no | Service description |
specialistName | string | yes | Service specialist name |
specialistPhone | string | yes | Service specialist phone |
visitDuration | number | no | Service visit duration |
workSchedule | Map<Weekday, DaySchedule> | no | Service work schedule |
name | message | HTTP status code |
---|---|---|
invalid_input | ||
company_not_found | Company not found | 404 |
service_not_found | Service not found | 404 |
unknown |
GET /api/v1/companies/e91f4c92-1371-48a1-a745-7d66d2178e15/services/fda84995-0755-40e3-8ed4-129fc774125b HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"id": "fda84995-0755-40e3-8ed4-129fc774125b",
"companyID": "e91f4c92-1371-48a1-a745-7d66d2178e15",
"title": "Padangų keitimas",
"description": "Pigus automobilio padangų keitimas",
"specialistName": "Jonas",
"specialistPhone": "+37064343333",
"visitDuration": 45,
"workSchedule": {
"monday": {
"from": "08:00",
"to": "17:00"
},
"thursday": {
"from": "10:15",
"to": "14:00"
},
"tuesday": {
"from": "11:45",
"to": "17:00"
},
"wednesday": {
"from": "08:00",
"to": "17:00"
}
}
}
}
Get services endpoint. Returns all company services.
https://reservio.hs.vc/api/v1/companies/:companyID/services
Response formats | JSON |
---|---|
Requires authentication? | No |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | e91f4c92-1371-48a1-a745-7d66d2178e15 |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
services | Service[] | no | Array of services |
Service type:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Service ID |
companyID | string | no | Company ID |
title | string | no | Service title |
description | string | no | Service description |
specialistName | string | yes | Service specialist name |
specialistPhone | string | yes | Service specialist phone |
visitDuration | number | no | Service visit duration |
workSchedule | Map<Weekday, DaySchedule> | no | Service work schedule |
name | message | HTTP status code |
---|---|---|
invalid_input | ||
company_not_found | Company not found | 404 |
unknown |
GET /api/v1/companies/e91f4c92-1371-48a1-a745-7d66d2178e15/services HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"services": [
{
"id": "fda84995-0755-40e3-8ed4-129fc774125b",
"companyID": "e91f4c92-1371-48a1-a745-7d66d2178e15",
"title": "Padangų keitimas",
"description": "Pigus automobilio padangų keitimas",
"specialistName": "Jonas",
"specialistPhone": "+37064343333",
"visitDuration": 45,
"workSchedule": {
"monday": {
"from": "08:00",
"to": "17:00"
},
"thursday": {
"from": "10:15",
"to": "14:00"
},
"tuesday": {
"from": "11:45",
"to": "17:00"
},
"wednesday": {
"from": "08:00",
"to": "17:00"
}
}
},
{
"id": "bc7f8382-0d87-40bd-910e-67efe1ae15f4",
"companyID": "e91f4c92-1371-48a1-a745-7d66d2178e15",
"title": "Išorės plovimas",
"description": "Pigus automobilio išorės plovimas",
"specialistName": "Virgis",
"specialistPhone": "+37065678999",
"visitDuration": 30,
"workSchedule": {
"monday": {
"from": "08:00",
"to": "16:00"
},
"thursday": {
"from": "10:00",
"to": "14:00"
},
"wednesday": {
"from": "08:00",
"to": "17:00"
}
}
}
]
}
}
Update service endpoint. Updates service with given ID.
https://reservio.hs.vc/api/v1/companies/:companyID/services/:serviceID
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | Company |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | e91f4c92-1371-48a1-a745-7d66d2178e15 |
:serviceID | string | yes | Service ID | - | fda84995-0755-40e3-8ed4-129fc774125b |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
title | string | no | Service title | between 3 and 100 chars | Men's haircut |
description | string | no | Service description | greater than or equal to 5 chars | Cheap men's haircut |
specialistName | SpecialistNameUpd | no | Service specialist name | - | { "value": John } |
specialistPhone | SpecialistPhoneUpd | no | Service specialist phone | - | { "value": null } |
visitDuration | number | no | Service visit duration | greater than 0 | 30 |
workSchedule | Map<Weekday, DaySchedule> | no | Service work schedule | size greater than 0 | { "monday": { "from": "08:00", "to": "17:00" } } |
SpecialistNameUpd type:
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
value | string | no | Service specialist name value. If null, specialistName is set to null. | between 5 and 100 chars | John |
SpecialistPhoneUpd type:
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
value | string | no | Service specialist phone value. If null, specialistPhone is set to null. | e164 standart | +37064343333 |
Weekday type:
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
string | yes | Work schedule week day | One of: monday, tuesday, wednesday, thursday, friday, saturday, sunday | friday |
DaySchedule type:
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
from | string | yes | Day start time | time format HH:mm | 10:30 |
to | string | yes | Day end time | time format HH:mm | 18:00 |
HTTP status code: 204
name | message | HTTP status code |
---|---|---|
unauthorized | ||
faulty_token | ||
invalid_token | ||
forbidden | ||
invalid_input | ||
company_not_found | Company not found | 404 |
service_not_found | Service not found | 404 |
nothing_to_update | Nothing to update | 400 |
unknown |
PATCH /api/v1/companies/e91f4c92-1371-48a1-a745-7d66d2178e15/services/fda84995-0755-40e3-8ed4-129fc774125b HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
{
"title": "Paslauga",
"description": "Paslaugos aprasymas",
"specialistName": null,
"specialistPhone": {
"value": "+37065787898"
},
"workSchedule": {
"monday": {
"from": "11:55",
"to": "15:55"
}
}
}
HTTP/1.1 204 No Content
Content-Type: application/json
Deletes company service by its ID.
https://reservio.hs.vc/api/v1/companies/:companyID/services/:serviceID
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | Company |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | 7b5624c2-7713-4bb3-b8d5-ea29b5792115 |
:serviceID | string | yes | Service ID | - | fda84995-0755-40e3-8ed4-129fc774125b |
HTTP status code: 204
name | message | HTTP status code |
---|---|---|
unauthorized | ||
faulty_token | ||
invalid_token | ||
forbidden | ||
invalid_input | ||
company_not_found | Company not found | 404 |
service_not_found | Service not found | 404 |
unknown |
DELETE /api/v1/companies/7b5624c2-7713-4bb3-b8d5-ea29b5792115/services/fda84995-0755-40e3-8ed4-129fc774125b HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 204 No Content
Content-Type: application/json
Creates new reservation for service and returns its data.
https://reservio.hs.vc/api/v1/companies/:companyID/services/:serviceID/reservations
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | Client |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | 7b5624c2-7713-4bb3-b8d5-ea29b5792115 |
:serviceID | string | yes | Service ID | - | fda84995-0755-40e3-8ed4-129fc774125b |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
date | string | yes | Reservation date | format YYYY-MM-DD HH:mm | 2022-10-17 10:00 |
comment | string | no | Reservation comment | between 5 and 200 chars | This is my comment |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Reservation ID |
companyID | string | no | Company ID |
serviceID | string | no | Service ID |
date | string | no | Reservation date |
comment | string | yes | Reservation comment |
name | message | HTTP status code |
---|---|---|
unauthorized | ||
faulty_token | ||
invalid_token | ||
forbidden | ||
invalid_input | ||
company_not_found | Company not found | 404 |
service_not_found | Service not found | 404 |
time_is_in_past | Specified reservation time is in the past | 400 |
invalid_time | Invalid reservation time | 400 |
service_not_available | Service is not available at the specified time | 400 |
reservation_already_exists | Reservation already exists at the specified time | 422 |
unknown |
POST /api/v1/companies/7b5624c2-7713-4bb3-b8d5-ea29b5792115/services/fda84995-0755-40e3-8ed4-129fc774125b HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
{
"date": "2022-11-21 11:55",
"comment": "this is my comment"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"id": "b484f566-39ce-4422-8dcb-22734792e05d",
"serviceID": "fda84995-0755-40e3-8ed4-129fc774125b",
"clientID": "d662e339-6fd0-4de3-b3d2-7118ce70ee53",
"date": "2022-11-21 11:55",
"comment": "this is my comment"
}
}
Get reservation endpoint. Returns reservation data.
https://reservio.hs.vc/api/v1/companies/:companyID/services/:serviceID/reservations/:reservationID
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | Company or Client |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | e91f4c92-1371-48a1-a745-7d66d2178e15 |
:serviceID | string | yes | Service ID | - | fda84995-0755-40e3-8ed4-129fc774125b |
:reservationID | string | yes | Reservation ID | - | b484f566-39ce-4422-8dcb-22734792e05d |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Reservation ID |
serviceID | string | no | Service ID |
client | Client | no | Client data |
date | string | no | Reservation date |
comment | string | yes | Reservation comment |
Client type:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Client ID |
firstName | string | no | Client first name |
lastName | string | no | Client last name |
phone | string | no | Client phone number |
string | no | Client email address |
name | message | HTTP status code |
---|---|---|
invalid_input | ||
company_not_found | Company not found | 404 |
service_not_found | Service not found | 404 |
reservation_not_found | Reservation not found | 404 |
unknown |
GET /api/v1/companies/e91f4c92-1371-48a1-a745-7d66d2178e15/services/fda84995-0755-40e3-8ed4-129fc774125b/reservations/b484f566-39ce-4422-8dcb-22734792e05d HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"id": "b484f566-39ce-4422-8dcb-22734792e05d",
"serviceID": "fda84995-0755-40e3-8ed4-129fc774125b",
"client": {
"id": "d662e339-6fd0-4de3-b3d2-7118ce70ee53",
"firstName": "Jonas",
"lastName": "Jonaitis",
"phone": "+37065555455",
"email": "jonas.jonaitis@gmail.com"
},
"date": "2022-11-21 11:55",
"comment": "this is my comment"
}
}
Get reservations endpoint. Returns all service reservations. The response is different when the user is authenticated as a company or is not authenticated/authenticated as a different role.
https://reservio.hs.vc/api/v1/companies/:companyID/services/:serviceID/reservations
Response formats | JSON |
---|---|
Requires authentication? | No |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | e91f4c92-1371-48a1-a745-7d66d2178e15 |
:serviceID | string | yes | Service ID | - | fda84995-0755-40e3-8ed4-129fc774125b |
HTTP status code: 200
Fields:
Name | Type | Can be null? | Description |
---|---|---|---|
reservations | Reservation[] | no | Array of reservations |
Reservation type:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Reservation ID |
serviceID | string | no | Service ID |
client | Client | no | Client data. Only provided when authenticated as company. |
date | string | no | Reservation date |
comment | string | yes | Reservation comment. Only provided when authenticated as company. |
Client type:
Name | Type | Can be null? | Description |
---|---|---|---|
id | string | no | Client ID |
firstName | string | no | Client first name |
lastName | string | no | Client last name |
phone | string | no | Client phone number |
string | no | Client email address |
name | message | HTTP status code |
---|---|---|
invalid_input | ||
company_not_found | Company not found | 404 |
service_not_found | Service not found | 404 |
unknown |
GET /api/v1/companies/e91f4c92-1371-48a1-a745-7d66d2178e15/services/fda84995-0755-40e3-8ed4-129fc774125b/reservations HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"error": null,
"data": {
"reservations": [
{
"id": "b484f566-39ce-4422-8dcb-22734792e05d",
"serviceID": "fda84995-0755-40e3-8ed4-129fc774125b",
"client": {
"id": "d662e339-6fd0-4de3-b3d2-7118ce70ee53",
"firstName": "Jonas",
"lastName": "Jonaitis",
"phone": "+37065555455",
"email": "jonas.jonaitis@gmail.com"
},
"date": "2022-11-21 11:55",
"comment": "this is my comment"
}
]
}
}
Update reservation endpoint. Updates reservation with given ID.
https://reservio.hs.vc/api/v1/companies/:companyID/services/:serviceID/reservations/:reservationID
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | Client |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | e91f4c92-1371-48a1-a745-7d66d2178e15 |
:serviceID | string | yes | Service ID | - | fda84995-0755-40e3-8ed4-129fc774125b |
:reservationID | string | yes | Reservation ID | - | b484f566-39ce-4422-8dcb-22734792e05d |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
date | string | no | Reservation date | format YYYY-MM-DD HH:mm | 2022-10-17 10:00 |
comment | CommentUpd | no | Reservation comment | - | { "value": "This is my comment" } |
CommentUpd type:
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
value | string | no | Service comment value. If null, comment is set to null. | between 5 and 200 chars | This is my comment |
HTTP status code: 204
name | message | HTTP status code |
---|---|---|
unauthorized | ||
faulty_token | ||
invalid_token | ||
forbidden | ||
invalid_input | ||
company_not_found | Company not found | 404 |
service_not_found | Service not found | 404 |
reservation_not_found | Reservation not found | 404 |
time_is_in_past | Specified reservation time is in the past | 400 |
invalid_time | Invalid reservation time | 400 |
service_not_available | Service is not available at the specified time | 400 |
reservation_already_exists | Reservation already exists at the specified time | 422 |
nothing_to_update | Nothing to update | 400 |
unknown |
PATCH /api/v1/companies/e91f4c92-1371-48a1-a745-7d66d2178e15/services/fda84995-0755-40e3-8ed4-129fc774125b/reservations/b484f566-39ce-4422-8dcb-22734792e05d HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
{
"date": "2022-10-17 8:45",
"comment": {
"value": null
}
}
HTTP/1.1 204 No Content
Content-Type: application/json
Delete reservation endpoint. Deletes reservation with given ID.
https://reservio.hs.vc/api/v1/companies/:companyID/services/:serviceID/reservations/:reservationID
Response formats | JSON |
---|---|
Requires authentication? | Yes |
Required role | Client |
Name | Type | Required? | Description | Validations | Example |
---|---|---|---|---|---|
:companyID | string | yes | Company ID | - | 7b5624c2-7713-4bb3-b8d5-ea29b5792115 |
:serviceID | string | yes | Service ID | - | fda84995-0755-40e3-8ed4-129fc774125b |
:reservationID | string | yes | Reservation ID | - | b484f566-39ce-4422-8dcb-22734792e05d |
HTTP status code: 204
name | message | HTTP status code |
---|---|---|
unauthorized | ||
faulty_token | ||
invalid_token | ||
forbidden | ||
invalid_input | ||
company_not_found | Company not found | 404 |
service_not_found | Service not found | 404 |
reservation_not_found | Reservation not found | 404 |
unknown |
DELETE /api/v1/companies/7b5624c2-7713-4bb3-b8d5-ea29b5792115/services/fda84995-0755-40e3-8ed4-129fc774125b/reservations/b484f566-39ce-4422-8dcb-22734792e05d HTTP/1.1
Host: reservio.hs.vc
Content-Type: application/json
HTTP/1.1 204 No Content
Content-Type: application/json
Šio modulio metu pavyko sėkmingai įgyvendinti užsibrėžtus projekto tikslus - sukurti backend API, ją tinkamai apsaugoti panaudojant JWT token authentifikacijai ir autorizacijai, be to, sukurti naudotojo sąsajos dalį, viską patalpinti debesyje, jog būtų galima išorinė prieiga prie sistemos, bei galiausiai, parengti galutinę ataskaitą. Tiesa, projektas nėra visiškai užbaigtas ir jį dar reikėtų nemažai patobulinti norint paleisti į rinką.