Skip to content

RESTful services documentation

Yichen Wu edited this page Mar 18, 2021 · 33 revisions

TODO: double-check the outputs!!!
See the http status codes there: https://www.restapitutorial.com/httpstatuscodes.html

AppointmentController

Request type Endpoints Method Name Method Description Inputs Outputs
GET /appointment/id
/appointment/id/
getAppointment get an appointment by ID
  • @PathVariable("id") Long id: the ID of the requested appointment
  • Success:
  • Failure:
GET /appointments/person/id
/appointments/person/id/
getAppointmentHistory get all appointments for a given customer
  • @PathVariable("id") Long id: the ID of the customer
  • Success:
  • Failure:
PUT /appointment/id
/appointment/id/
editAppointment edit a given appointment
  • @PathVariable("id") Long id: the ID of the requested appointment
  • @RequestBody AppointmentDto appointmentDto: appointment with updated parameters
  • Success:
  • Failure:
DELETE /appointment/id
/appointment/id/
deleteAppointment delete a gievn appointment
  • @PathVariable("id") Long id: the ID of the appointment to be deleted
  • Success:
  • Failure:
POST /appointment
/appointment/
createAppointment create a new appointment in the datebase
  • @RequestParam(value="customerId") Long customerId: ID of the customer
  • @RequestParam(value="serivceNames") List serivceNames: list of services in the new appointment
  • @RequestBody TimeSlotDto timeSlotDto:timeslot of the new appointment
  • Success:
  • Failure:
POST /appointmentNoShow/id
/appointmentNoShow/id/
enterNoShow declare no show for a given appointment
  • @PathVariable("id") Long id:appointment to be declared no show
  • Success:
  • Failure:

BusinessController

Request type Endpoints Method Name Method Description Inputs Outputs
GET /business/id
/business/id/
getBusiness get the requested business
  • @PathVariable("id") Long id: ID of the requested business
  • Success:
  • Failure:
POST /business
/business/
createBusiness create new business in the database
  • @RequestBody BusinessDto businessDto:business to be registered
  • Success: 200
  • Failure:
  • 400
PUT /business/id
/business/id/
updateBusiness updates business information
  • @PathVariable("id") Long id: ID of the business to be updated
  • @RequestBody BusinessDto businessDto: business to be updated
  • Success: 200
  • Failure: 400
DELETE /business/id
/business/id/
deleteBusiness deletes the business from the system
  • @PathVariable("id") Long id: ID of the business to be deleted
  • Success: 200
  • Failure: 400

PersonController

Request type Endpoints Method Name Method Description Inputs Outputs
Florence Yared
23
Himel Saha
23.5
Rakshitha Ravi
18
Saikou Ceesay
24
Yichen Wu
  • domain model modification
  • Appointment classes
    • AppointmentService
    • AppointmentDto
    • AppointmentController
    • TestAppointmentService
  • Customer classes
    • PersonService
    • CustomerDto
  • documentation
25

ServiceController

Request type Endpoints Method Name Method Description Inputs Outputs
GET /bookableService/name
/bookableService/name/
getBookableService get a bookable service by name
  • @PathVariable("name") String name: the name of the requested service
  • Success:
  • Failure:
GET /bookableServices
/bookableServices/
getAllBookableServices get all bookable services in the business -
  • Success:
  • Failure:
PUT /bookableService/name
/bookableService/name/
editBookableService edit a given bookable service
  • @PathVariable("name") String name: the name of the requested bookable service
  • @RequestBody BookableServiceDto bookableServiceDto: bookable service with updated parameters
  • Success:
  • Failure:
DELETE /bookableService/name
/bookableService/name/
deleteBookableService delete a gievn bookable service @PathVariable("name") String name: the name of the bookable service to be deleted
  • Success:
  • Failure:
POST /bookableService
/bookableService/
createBookableService create a new bookable service in the datebase @RequestBody BookableServiceDto bookableServiceDto:the bookable service that want to be created
  • Success:
  • Failure:

TimeSlotController

Request type Endpoints Method Name Method Description Inputs Outputs
Florence Yared
23
Himel Saha
23.5
Rakshitha Ravi
18
Saikou Ceesay
24
Yichen Wu
  • domain model modification
  • Appointment classes
    • AppointmentService
    • AppointmentDto
    • AppointmentController
    • TestAppointmentService
  • Customer classes
    • PersonService
    • CustomerDto
  • documentation
25