Giter Club home page Giter Club logo

appointmentscheduler's Introduction

CircleCI

Appointment scheduler

This is a Spring Boot Web Application to manage and schedule appointments between providers and customers. It has many features such as automatic invoicing, email notifications, appointments cancelation, providers individual working plans with brakes etc.

Demo

The live demo of this app is deployed and can be found here

You can use the following credentials with live demo:

Account type Username Password
admin admin qwerty123
provider provider qwerty123
corporate customer customer_c qwerty123
retail customer customer_r qwerty123

Blog

This application is being described in devoxify.com blog. If you are interested in how this project was created, what issues were encoutered and how they were solved I highly encourage you to visit this blog.

Steps to Setup

1. Clone the application

git clone https://github.com/slabiak/AppointmentScheduler.git

2. Create MySQL database

create database appointmentscheduler
  • After that run MySQL script to create tables src/main/resources/appointmentscheduler.sql

3. Configure enviroment variables

  • open src/main/resources/application.properties
  • set env variables for JDBC dbURL, dbUsername, dbPassword
  • set env variables for mail server mailUsername, mailPassword
  • set jwtSecret, encoded with Base64 jwtSecret

4. Run the app using maven

mvn spring-boot:run

The app will start running at http://localhost:8080

5. Login to admin account

  • username: admin
  • password: qwerty123

Account types

admin - is created at database initialization. Admin can add new providers, services and assign services to providers. Admin can see list of all: appointments, providers, customers, invoices. He can also issue invoices manually for all confirmed appointments.

provider - can by created by admin only. Provider can set his own working plan, add brakes to that working plan and change his available services. Provider sees only his own appointments.

customer retail - registration page is public and can be created by everyone. Customer can only book new appointments and manage them. This type of customer sees only services which targets retail customer.

customer corporate - almost the same as retail customer. The only difference is that this type of account needs to provide VAT number and Company Name and can see only services which targets corporrate customer.

Booking process

To book a new appointment customer needs to click New Appointment button on all appointments page and then:

  1. Choose desired work from available works list
  2. Choose provider for selected work
  3. Choose on of available date which is presented to him
  4. Click book on confirmation page

Available hours are calculatated with getAvailableHours function from AppointmentService:

List<TimePeroid> getAvailableHours(int providerId,int customerId, int workId, LocalDate date)

This function works as follow:

  1. gets selected provider working plan
  2. gets working hours from working plan for selected day
  3. excludes all brakes from working hours
  4. excludes all providers booked appointments for that day
  5. excludes all customers booked appointments for that day
  6. gets selected work duration and calculate available time peroids
  7. returns available hours

Appointments lifecycle

1. Every appointment has it's own status. Below you can find description for every possible status:

Status Set by When Condition
scheudled system New appointment is created -
finished system Current date is after appointment end time current appointment status is scheduled and current date is after appointment end time
confirmed system Current date is 24h after appointment end time current appointment status is finished and current date is more than 24h after appointment end time
invoiced system Invoice for appointment is created -
canceled customer Customer clicks cancel button current appointment status is scheduled and current date is not less than 24h before appointment start time and user total canceled appointments number for current month is not greater than 1
rejection requested customer Customer clicks reject button current appointment status is finished and current date is not more than 24h after appointment end time
rejection accepted provider Provider clicks accept rejection button current appointment status is rejection requested

2. Normal appointment lifecycle is:

  1. scheduled - after user creates new appointment
  2. finished - after system time is after appointment end time
  3. confirmed - after system time is more than 24h after appointment end time and user didn't request rejection
  4. invoiced - after invoiced is issued automatically on the 1st day of next month

3. Appointment rejection

After appointment status is changed to finished system automatically sends email to customer with information that appointment is finished. In case that the appointment didn't take place there is also a link attached to that email that allows customer to reject that the appointment didn't take place. That link is valid for 24h after appointment finished time. If user will no click that link then appointment status will be automatically chaned to confirmed after 24h and invoiced at the 1st day of next month. If user will click that link an email is send to provider that his customer requested rejection. If provied will accept that rejection then appointment status will be changed to rejection accepted and appointment will be not invoiced.

4. Apppointment cancellation

Every appointment can be canceled by customer or provider. Customer is allowed to cancel 1 appointment in a month no less than 24h before appointment start date. Provider is allowed to cancel his appointments without any limit as long as the appointment status is scheduled.

Notifications

1. An email notification is sent when:

  • appointment is finished
  • appointment rejection is rquested
  • appointment rejection is accepted
  • new appointment is created
  • appointment is canceled
  • invoice is issued

Email templates can be found here: src\main\resources\templates\email

Built With

Contribute

Let's together make AppointmentScheduler awesome!

If you have any suggestions/ideas please feel free to write about it. You are also welcome to fork this project and send pull request with your changes.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

appointmentscheduler's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

appointmentscheduler's Issues

lombok dependency update to version 1.18.28

Hi!

I just downloaded AppointmentScheduler on Ubuntu Studio 22.04.

I was getting this error:
'''
Caused by: java.lang.IllegalAccessError: class lombok.javac.apt.LombokProcessor (in unnamed module @0x1bd97254) cannot access class com.sun.tools.javac.processing.JavacProcessingEnvironment (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.processing to unnamed module @0x1bd97254
'''
It seems like this is a lombok version issue in pom.xml.. Updating version to current (1.18.28) fixed it:
'''

org.projectlombok
lombok
1.18.28
provided

'''
I hope this was useful.

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timePeroidsWithBreaksExcluded" (class com.example.slabiak.appointmentscheduler.model.DayPlan)

Hi, I cloned your AppointmentScheduler Repo, and followed the README for project setup. I am able to run the application, I can create a retail user, but when login in as a retail user and try to setup an appointment, the following error pups up:

On the broser:
Tue Jun 06 18:18:32 EDT 2023
There was an unexpected error (type=Internal Server Error, status=500).
The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object; nested exception is java.lang.IllegalArgumentException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object

On the IDE log:
2023-06-06 18:18:32.912 ERROR 31572 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object; nested exception is java.lang.IllegalArgumentException: The given string value: {"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]} cannot be transformed to Json object] with root cause

com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "timePeroidsWithBreaksExcluded" (class com.example.slabiak.appointmentscheduler.model.DayPlan), not marked as ignorable (2 known properties: "breaks", "workingHours"])
at [Source: (String)"{"workingHours":{"start":[6,0],"end":[18,0]},"breaks":[],"timePeroidsWithBreaksExcluded":[{"start":[6,0],"end":[18,0]}]}"; line: 1, column: 91] (through reference chain: com.example.slabiak.appointmentscheduler.model.DayPlan["timePeroidsWithBreaksExcluded"])

Login as admin

I am not able to login after running the app it keeps giving me wrong password but I am sure I am typing it in right.

Hi there I am currently using your app

Are the appointment lifecycle implemented? I so far only can cancel.
I already fix the add break to working plan, but only works for one break.
May I request you do a file picture to user provider and customer retailer and customer corporate?
You can add me on discord so communication is easier HanSohai#3309

Add logging

There should be some logging added. For example when new appointment is created it should be logged with log.info("New apppointmented created for user {} ..", user);

Any intended milestones?

Hi. I'm Emmanuel. I'm pretty new to GitHub so I'm not sure this is where to put this. It is more of a comment than an actual issue.

I find this project interesting and would like to participate.
What future additions/adjustments to you intend. I'm thinking along the lines of exposing the application for use from within other applications. Two possibilities of that are:

  1. Exposing API that returns raw data as JSON instead of HTML
  2. Exposing an API that returns embeddable markup i.e. without navigation, footer etc..

It is possible you already have this functionality and I just have not looked at the code enough yet. In any case, great work!

defect from adding breaks

The issue is that when working in the availability window, the working plan is put in as 800 to 1600. Adding a break of 1000 to 1100 causes working plan to change to 1100 to 1600 and break changes to 1100 to 1100. I am trying to debug this issue but I don't see anything yet as to what is causing this. Would you have an idea?

The best way to describe this issue is just to look at the progression of the screenshots and it should become apparent to what the problem is.

Screenshot 1 2023-03-28 at 14 08 02
Screenshot 5 2023-03-28 at 14 09 04
Screenshot 4 2023-03-28 at 14 08 52
Screenshot 3 2023-03-28 at 14 08 40
Screenshot 2 2023-03-28 at 14 08 17

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.