rajah 1 год назад
Родитель
Сommit
ac5adcc180
18 измененных файлов с 78 добавлено и 38 удалено
  1. 3 0
      src/main/java/fr/triplea/demovote/persistence/dao/VariableRepository.java
  2. 2 1
      src/main/java/fr/triplea/demovote/persistence/model/Bulletin.java
  3. 4 3
      src/main/java/fr/triplea/demovote/persistence/model/Categorie.java
  4. 2 1
      src/main/java/fr/triplea/demovote/persistence/model/Message.java
  5. 4 3
      src/main/java/fr/triplea/demovote/persistence/model/Participant.java
  6. 4 3
      src/main/java/fr/triplea/demovote/persistence/model/Preference.java
  7. 2 1
      src/main/java/fr/triplea/demovote/persistence/model/Presentation.java
  8. 3 3
      src/main/java/fr/triplea/demovote/persistence/model/Privilege.java
  9. 5 3
      src/main/java/fr/triplea/demovote/persistence/model/Production.java
  10. 4 3
      src/main/java/fr/triplea/demovote/persistence/model/Role.java
  11. 4 3
      src/main/java/fr/triplea/demovote/persistence/model/Variable.java
  12. 1 1
      src/main/java/fr/triplea/demovote/web/controller/BulletinController.java
  13. 7 3
      src/main/java/fr/triplea/demovote/web/controller/CategorieController.java
  14. 1 1
      src/main/java/fr/triplea/demovote/web/controller/MessageController.java
  15. 7 3
      src/main/java/fr/triplea/demovote/web/controller/ParticipantController.java
  16. 5 1
      src/main/java/fr/triplea/demovote/web/controller/PreferenceController.java
  17. 7 3
      src/main/java/fr/triplea/demovote/web/controller/ProductionController.java
  18. 13 2
      src/main/java/fr/triplea/demovote/web/controller/VariableController.java

+ 3 - 0
src/main/java/fr/triplea/demovote/persistence/dao/VariableRepository.java

@@ -11,6 +11,9 @@ import fr.triplea.demovote.persistence.model.Variable;
 public interface VariableRepository extends JpaRepository<Variable, Integer> 
 {
   
+  @NativeQuery("SELECT DISTINCT v.* FROM vote.variables AS v ORDER BY v.type ASC, v.code ASC ")
+  List<Variable> findAll();
+  
   @NativeQuery("SELECT DISTINCT v.* FROM vote.variables AS v WHERE v.numero_variable = :id ")
   Variable findById(@Param("id") int id);
 

+ 2 - 1
src/main/java/fr/triplea/demovote/persistence/model/Bulletin.java

@@ -18,7 +18,7 @@ public class Bulletin
   
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
-  @Column(name = "numero_bulletin")
+  @Column(name = "numero_bulletin", nullable = false)
   private Integer numeroBulletin;
 
   @ManyToOne(fetch = FetchType.LAZY)
@@ -76,6 +76,7 @@ public class Bulletin
   public Bulletin() { super(); }
  
   
+  public void setNumeroBulletin(Integer numeroBulletin) { this.numeroBulletin = numeroBulletin; }
   public Integer getNumeroBulletin() { return this.numeroBulletin; }
 
   public void setCategorie(Categorie c) { this.categorie = c; }

+ 4 - 3
src/main/java/fr/triplea/demovote/persistence/model/Categorie.java

@@ -30,17 +30,17 @@ public class Categorie
    
   @Temporal(TemporalType.TIMESTAMP)
   @CreationTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateCreation;
   
   @Temporal(TemporalType.TIMESTAMP)
   @UpdateTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateModification;
   
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
-  @Column(name = "numero_categorie")
+  @Column(name = "numero_categorie", nullable = false)
   private Integer numeroCategorie;
 
   @Column(name = "flag_actif")
@@ -82,6 +82,7 @@ public class Categorie
   
   public LocalDateTime getDateModification() { return this.dateModification; }
   
+  public void setNumeroCategorie(Integer numeroCategorie) { this.numeroCategorie = numeroCategorie; }
   public Integer getNumeroCategorie() { return this.numeroCategorie; }
   
   public void setEnabled(boolean b) { this.enabled = Boolean.valueOf(b); }

+ 2 - 1
src/main/java/fr/triplea/demovote/persistence/model/Message.java

@@ -31,7 +31,7 @@ public class Message
 
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
-  @Column(name = "numero_message")
+  @Column(name = "numero_message", nullable = false)
   private Integer numeroMessage;
 
   @ManyToOne(fetch = FetchType.LAZY)
@@ -51,6 +51,7 @@ public class Message
   
   public LocalDateTime getDateCreation() { return this.dateCreation; }
   
+  public void setNumeroMessage(Integer numeroMessage) { this.numeroMessage = numeroMessage; }
   public Integer getNumeroMessage() { return this.numeroMessage; }
   
   public void setParticipant(Participant p) { this.participant = p; }

+ 4 - 3
src/main/java/fr/triplea/demovote/persistence/model/Participant.java

@@ -39,12 +39,12 @@ public class Participant
   
   @Temporal(TemporalType.TIMESTAMP)
   @CreationTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateCreation;
   
   @Temporal(TemporalType.TIMESTAMP)
   @UpdateTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateModification;
 
   @ManyToMany(fetch = FetchType.EAGER)
@@ -55,7 +55,7 @@ public class Participant
 
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
-  @Column(name = "numero_participant")
+  @Column(name = "numero_participant", nullable = false)
   private Integer numeroParticipant;
 
   @Column(name = "flag_actif")
@@ -163,6 +163,7 @@ public class Participant
   public List<Role> getRoles() { return roles; }
   public void setRoles(final List<Role> roles) { this.roles = roles; }
   
+  public void setNumeroParticipant(Integer numeroParticipant) { this.numeroParticipant = numeroParticipant; }
   public Integer getNumeroParticipant() { return this.numeroParticipant; }
   
   public void setEnabled(boolean b) { this.enabled = Boolean.valueOf(b); }

+ 4 - 3
src/main/java/fr/triplea/demovote/persistence/model/Preference.java

@@ -26,17 +26,17 @@ public class Preference
   
   @Temporal(TemporalType.TIMESTAMP)
   @CreationTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateCreation;
   
   @Temporal(TemporalType.TIMESTAMP)
   @UpdateTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateModification;
 
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
-  @Column(name = "numero_preference")
+  @Column(name = "numero_preference", nullable = false)
   private Integer numeroPreference;
 
   @ManyToOne
@@ -56,6 +56,7 @@ public class Preference
 
   public LocalDateTime getDateModification() { return this.dateModification; }
   
+  public void setNumeroPreference(Integer numeroPreference) { this.numeroPreference = numeroPreference; }
   public Integer getNumeroPreference() { return this.numeroPreference; }
   
   public void setParticipant(Participant p) { this.participant = p; }

+ 2 - 1
src/main/java/fr/triplea/demovote/persistence/model/Presentation.java

@@ -17,7 +17,7 @@ public class Presentation
   
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
-  @Column(name = "numero_presentation")
+  @Column(name = "numero_presentation", nullable = false)
   private Integer numeroPresentation;
 
   @ManyToOne
@@ -38,6 +38,7 @@ public class Presentation
   public Presentation() { super(); }
 
   
+  public void setNumeroPresentation(Integer numeroPresentation) { this.numeroPresentation = numeroPresentation; }
   public Integer getNumeroPresentation() { return this.numeroPresentation; }
   
   public void setCategorie(Categorie c) { this.categorie = c; }

+ 3 - 3
src/main/java/fr/triplea/demovote/persistence/model/Privilege.java

@@ -26,17 +26,17 @@ public class Privilege
   
   @Temporal(TemporalType.TIMESTAMP)
   @CreationTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateCreation;
   
   @Temporal(TemporalType.TIMESTAMP)
   @UpdateTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateModification;
   
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
-  @Column(name = "numero_privilege")
+  @Column(name = "numero_privilege", nullable = false)
   private Integer numeroPrivilege;
  
   @Column(length = 128, nullable = false)

+ 5 - 3
src/main/java/fr/triplea/demovote/persistence/model/Production.java

@@ -39,17 +39,17 @@ public class Production
   
   @Temporal(TemporalType.TIMESTAMP)
   @CreationTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateCreation;
   
   @Temporal(TemporalType.TIMESTAMP)
   @UpdateTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateModification;
   
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
-  @Column(name = "numero_production")
+  @Column(name = "numero_production", nullable = false)
   private Integer numeroProduction;
 
   @Column(name = "flag_actif")
@@ -138,6 +138,7 @@ public class Production
   
   public LocalDateTime getDateModification() { return this.dateModification; }
   
+  public void setNumeroProduction(Integer numeroProduction) { this.numeroProduction = numeroProduction; }
   public Integer getNumeroProduction() { return this.numeroProduction; }
   
   public void setEnabled(boolean b) { this.enabled = Boolean.valueOf(b); }
@@ -181,6 +182,7 @@ public class Production
   public void setVignette(byte[] v) { this.vignette = v; }
   public byte[] getVignette() { return this.vignette; }
  
+  //@Version
   public void setNumeroVersion(int n) { this.numeroVersion = Integer.valueOf(n); }
   public Integer getNumeroVersion() { return this.numeroVersion; }
   

+ 4 - 3
src/main/java/fr/triplea/demovote/persistence/model/Role.java

@@ -29,17 +29,17 @@ public class Role
   
   @Temporal(TemporalType.TIMESTAMP)
   @CreationTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateCreation;
   
   @Temporal(TemporalType.TIMESTAMP)
   @UpdateTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateModification;
   
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
-  @Column(name = "numero_role")
+  @Column(name = "numero_role", nullable = false)
   private Integer numeroRole;
   
   @Column(name = "flag_actif")
@@ -65,6 +65,7 @@ public class Role
   
   public LocalDateTime getDateModification() { return this.dateModification; }
   
+  public void setNumeroRole(Integer numeroRole) { this.numeroRole = numeroRole; }
   public Integer getNumeroRole() { return this.numeroRole; }
   
   public void setEnabled(boolean b) { this.enabled = Boolean.valueOf(b); }

+ 4 - 3
src/main/java/fr/triplea/demovote/persistence/model/Variable.java

@@ -24,17 +24,17 @@ public class Variable
   
   @Temporal(TemporalType.TIMESTAMP)
   @CreationTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateCreation;
   
   @Temporal(TemporalType.TIMESTAMP)
   @UpdateTimestamp
-  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd-MM-yyyy HH:mm:ss", timezone="Europe/Paris")
+  @JsonFormat(shape=JsonFormat.Shape.STRING, pattern="dd/MM/yyyy HH:mm:ss", timezone="Europe/Paris")
   private LocalDateTime dateModification;
   
   @Id
   @GeneratedValue(strategy = GenerationType.IDENTITY)
-  @Column(name = "numero_variable")
+  @Column(name = "numero_variable", nullable = false)
   private Integer numeroVariable;
   
   @Column(length = 64, nullable = false)
@@ -57,6 +57,7 @@ public class Variable
   
   public LocalDateTime getDateModification() { return this.dateModification; }
   
+  public void setNumeroVariable(Integer numeroVariable) { this.numeroVariable = numeroVariable; }
   public Integer getNumeroVariable() { return this.numeroVariable; }
   
   public void setType(String str) { if (str != null) { this.type = StringUtils.truncate(str, 64); } }

+ 1 - 1
src/main/java/fr/triplea/demovote/web/controller/BulletinController.java

@@ -125,7 +125,7 @@ public class BulletinController
 
   @DeleteMapping(value = "/delete/{id}")
   //@PreAuthorize("hasRole('PAGE_VOTER')")
-  public ResponseEntity<Object> remove(@PathVariable("id") int id) 
+  public ResponseEntity<Object> remove(@PathVariable int id) 
   { 
     if (id > 0) { bulletinRepository.deleteById(id); }
     

+ 7 - 3
src/main/java/fr/triplea/demovote/web/controller/CategorieController.java

@@ -38,7 +38,7 @@ public class CategorieController
 
   @GetMapping(value = "/form/{id}")
   //@PreAuthorize("hasRole('LISTE_CATEGORIES')")
-  public ResponseEntity<Categorie> getForm(@PathVariable("id") int id)
+  public ResponseEntity<Categorie> getForm(@PathVariable int id)
   { 
     Categorie c = categorieRepository.findById(id);
     
@@ -51,12 +51,16 @@ public class CategorieController
   //@PreAuthorize("hasRole('LISTE_CATEGORIES')")
   public Categorie create(@RequestBody(required = true) Categorie categorie) 
   { 
+    Categorie found = categorieRepository.findById(0);
+    
+    if (found == null) { categorie.setNumeroCategorie(null); }
+
     return categorieRepository.save(categorie);
   }
 
   @PutMapping(value = "/update/{id}")
   //@PreAuthorize("hasRole('LISTE_CATEGORIES')")
-  public ResponseEntity<Object> update(@PathVariable("id") int id, @RequestBody(required = true) Categorie categorie) 
+  public ResponseEntity<Object> update(@PathVariable int id, @RequestBody(required = true) Categorie categorie) 
   { 
     Categorie found = categorieRepository.findById(id);
     
@@ -82,7 +86,7 @@ public class CategorieController
 
   @DeleteMapping(value = "/retire/{id}")
   //@PreAuthorize("hasRole('LISTE_CATEGORIES')")
-  public ResponseEntity<Object> disableCategorie(@PathVariable("id") int id) 
+  public ResponseEntity<Object> disableCategorie(@PathVariable int id) 
   { 
     Categorie c = categorieRepository.getReferenceById(id);
     

+ 1 - 1
src/main/java/fr/triplea/demovote/web/controller/MessageController.java

@@ -25,7 +25,7 @@ public class MessageController
   
   @GetMapping(value = "/list/{id}")
   //@PreAuthorize("hasRole('PAGE_MESSAGERIE')")
-  public List<Message> getList(@PathVariable("id") int id)
+  public List<Message> getList(@PathVariable int id)
   { 
     return messageRepository.findAll(id, id); 
   }

+ 7 - 3
src/main/java/fr/triplea/demovote/web/controller/ParticipantController.java

@@ -40,7 +40,7 @@ public class ParticipantController
 
   @GetMapping(value = "/form/{id}")
   //@PreAuthorize("hasRole('LISTE_PARTICIPANTS')")
-  public ResponseEntity<Participant> getForm(@PathVariable("id") int id) 
+  public ResponseEntity<Participant> getForm(@PathVariable int id) 
   { 
     Participant p = participantRepository.findById(id);
 
@@ -53,6 +53,10 @@ public class ParticipantController
   //@PreAuthorize("hasRole('LISTE_PARTICIPANTS')")
   public Participant create(@RequestBody(required = true) Participant participant) 
   { 
+    Participant found = participantRepository.findById(0);
+    
+    if (found == null) { participant.setNumeroParticipant(null); }
+
     if (participant.getStatus() == null) { participant.setStatus(ParticipantStatus.EN_ATTENTE); }
     if (participant.getModePaiement() == null) { participant.setModePaiement(ParticipantModePaiement.ESPECES); }
     
@@ -61,7 +65,7 @@ public class ParticipantController
 
   @PutMapping(value = "/update/{id}")
   //@PreAuthorize("hasRole('LISTE_PARTICIPANTS')")
-  public ResponseEntity<Object> update(@PathVariable("id") int id, @RequestBody(required = true) Participant participant) 
+  public ResponseEntity<Object> update(@PathVariable int id, @RequestBody(required = true) Participant participant) 
   { 
     Participant found = participantRepository.findById(id);
     
@@ -107,7 +111,7 @@ public class ParticipantController
 
   @DeleteMapping(value = "/delete/{id}")
   //@PreAuthorize("hasRole('LISTE_PARTICIPANTS')")
-  public ResponseEntity<Object> disableParticipant(@PathVariable("id") int id) 
+  public ResponseEntity<Object> disableParticipant(@PathVariable int id) 
   { 
     Participant found = participantRepository.getReferenceById(id);
     

+ 5 - 1
src/main/java/fr/triplea/demovote/web/controller/PreferenceController.java

@@ -39,12 +39,16 @@ public class PreferenceController
   //@PreAuthorize("hasRole('LISTE_PREFERENCES')")
   public Preference create(@RequestBody(required = true) Preference preference) 
   { 
+    Preference found = preferenceRepository.findById(0);
+
+    if (found == null) { preference.setNumeroPreference(null); }
+    
     return  preferenceRepository.save(preference);
   }
 
   @PutMapping(value = "/update/{id}")
   //@PreAuthorize("hasRole('LISTE_PREFERENCES')")
-  public ResponseEntity<Preference> update(@PathVariable("id") int id, @RequestBody(required = true) Preference preference) 
+  public ResponseEntity<Preference> update(@PathVariable int id, @RequestBody(required = true) Preference preference) 
   { 
     Preference found = preferenceRepository.findById(id);
     

+ 7 - 3
src/main/java/fr/triplea/demovote/web/controller/ProductionController.java

@@ -45,7 +45,7 @@ public class ProductionController
  
   @GetMapping(value = "/form/{id}")
   //@PreAuthorize("hasAnyRole('LISTE_PRODUCTIONS_ADMIN', 'LISTE_PRODUCTIONS_USER')")
-  public ResponseEntity<Production> getForm(@PathVariable("id") int id)
+  public ResponseEntity<Production> getForm(@PathVariable int id)
   { 
     Production p = productionRepository.findById(id);
     
@@ -58,6 +58,10 @@ public class ProductionController
   //@PreAuthorize("hasAnyRole('LISTE_PRODUCTIONS_ADMIN', 'LISTE_PRODUCTIONS_USER')")
   public Production create(@RequestBody(required = true) Production production) 
   { 
+    Production found = productionRepository.findById(0);
+    
+    if (found== null) { production.setNumeroProduction(null); }
+
     if (production.getType() == null) { production.setType(ProductionType.AUTRE); }
     if (production.getNumeroVersion() == null) { production.setNumeroVersion(1); }
     
@@ -66,7 +70,7 @@ public class ProductionController
  
   @PutMapping(value = "/update/{id}")
   //@PreAuthorize("hasAnyRole('LISTE_PRODUCTIONS_ADMIN', 'LISTE_PRODUCTIONS_USER')")
-  public ResponseEntity<Production> update(@PathVariable("id") int id, @RequestBody(required = true) Production production) 
+  public ResponseEntity<Production> update(@PathVariable int id, @RequestBody(required = true) Production production) 
   { 
     Production found = productionRepository.findById(id);
     
@@ -98,7 +102,7 @@ public class ProductionController
 
   @DeleteMapping(value = "/delete/{id}")
   //@PreAuthorize("hasAnyRole('LISTE_PRODUCTIONS_ADMIN', 'LISTE_PRODUCTIONS_USER')")
-  public ResponseEntity<Object> disableProduction(@PathVariable("id") int id) 
+  public ResponseEntity<Object> disableProduction(@PathVariable int id) 
   { 
     Production found = productionRepository.getReferenceById(id);
     

+ 13 - 2
src/main/java/fr/triplea/demovote/web/controller/VariableController.java

@@ -54,6 +54,10 @@ public class VariableController
   //@PreAuthorize("hasRole('LISTE_VARIABLES')")
   public Variable create(@RequestBody(required = true) Variable variable) 
   { 
+    Variable found = variableRepository.findById(0);
+    
+    if (found == null) { variable.setNumeroVariable(null); }
+    
     return variableRepository.save(variable);
   }
  
@@ -82,9 +86,16 @@ public class VariableController
   //@PreAuthorize("hasRole('LISTE_VARIABLES')")
   public ResponseEntity<Object> deleteVariable(@PathVariable int id) 
   { 
-    variableRepository.deleteById(id);
+    Variable found = variableRepository.findById(id);
+
+    if (found != null) 
+    { 
+      variableRepository.deleteById(id); 
+      
+      return ResponseEntity.ok().build();
+    }
     
-    return ResponseEntity.ok().build();
+    return ResponseEntity.notFound().build(); 
   }
 
 }