- Authenticate user
- Doctors CRUD;
- Patient CRUD;
- Appointments booking;
- Appointment Cancellation;
- O horário de funcionamento da clínica é de segunda a sábado, das 07:00 às 19:00;
- As consultas tem duração fixa de 1 hora;
- As consultas devem ser agendadas com antecedência mínima de 30 minutos;
- Não permitir o agendamento de consultas com pacientes inativos no sistema;
- Não permitir o agendamento de consultas com médicos inativos no sistema;
- Não permitir o agendamento de mais de uma consulta no mesmo dia para um mesmo paciente;
- Não permitir o agendamento de uma consulta com um médico que já possui outra consulta agendada na mesma data/hora;
- A escolha do médico é opcional, sendo que nesse caso o sistema deve escolher aleatoriamente algum médico disponível na data/hora preenchida.
- @RestController annotation - tells spring that the class is a rest controller and load during the project initialization
- @RequestMapping annotation - tells spring which url the controller will be called
- @MethodMapping annotation - tells which class method will be called for HTTP request
- @GetMapping - HTTP Get method
- @PostMapping - HTTP Post method
- @PutMapping - HTTP Put method
- @DeleteMapping - HTTP Delete method
- @PatchMapping - HTTP Patch method
- @Transactional annotation - tells spring that the method can write on the DB
Create a CrosConfiguration
class implementing the WebMvcConfigurer
passing the addMapping (url), allowedOrigins and allowedMethods.@
@Configuration
public class CorsConfiguration implements WebMvcConfigurer {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowedOrigins("http://localhost:3000")
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS", "HEAD", "TRACE", "CONNECT");
}
}
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/databaseName
username: root
password: root
spring.data.web.pageable.page-parameter=pagina
spring.data.web.pageable.size-parameter=tamanho
spring.data.web.sort.sort-parameter=ordem