Skip to content
Snippets Groups Projects
Commit 8f4f3ca7 authored by COULIBALY Aichatou's avatar COULIBALY Aichatou
Browse files

Facture

parent 64b3c876
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,8 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.springframework.boot:spring-boot-starter:3.2.1'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.ai:spring-ai-tika-document-reader'
......
package com.projet.projetIndu.entities;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import java.time.LocalDateTime;
@Entity
@Table(name = "invoices")
@Getter
@Setter
@NoArgsConstructor
public class Invoice {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private double amount;
@Column(nullable = false, updatable = false)
private LocalDateTime issue_date = LocalDateTime.now();
@Enumerated(EnumType.STRING)
@Column(nullable = false)
private InvoiceStatus status;
@Column(nullable = false, updatable = false)
private LocalDateTime createdAt = LocalDateTime.now();
}
......@@ -30,5 +30,4 @@ public class Patient extends User {
this.dateOfBirth = dateOfBirth;
}
}
package com.projet.projetIndu.entities;
public class PaymentStatus {
}
......@@ -63,4 +63,6 @@ public abstract class User {
}
public void setId(Long id) {
}
}
......@@ -6,6 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Optional;
......@@ -21,6 +22,7 @@ public class PatientService {
}
public List<Patient> getAllPatients() {
return patientRepository.findAll();
}
......@@ -49,4 +51,13 @@ public class PatientService {
.map(Patient::getId)
.orElseThrow(() -> new RuntimeException("Patient non trouvé"));
}
@Transactional
public Patient mettreAJourPatient(Long id, Patient patient) {
if (patientRepository.existsById(id)) {
patient.setId(id);
return patientRepository.save(patient);
}
return null;
}
}
spring.application.name=projetIndu
spring.datasource.url=jdbc:mysql://localhost:3306/projet
spring.datasource.url=jdbc:mysql://localhost:3307/projet
spring.datasource.username=root
spring.datasource.password=jessie
spring.datasource.password=241001
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.database-platform=org.hibernate.dialect.MySQL8Dialect
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.hibernate.ddl-auto=create
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.thymeleaf.prefix=classpath:/templates/
spring.thymeleaf.suffix=.html
spring.thymeleaf.cache=false
spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=100MB
spring.mvc.hiddenmethod.filter.enabled=true
sprin.g.mvc.hiddenmethod.filter.enabled=true
spring.banner.location=banner.txt
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>$Title$</title>
</head>
<body>
$END$
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>$Title$</title>
</head>
<body>
$END$
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment