From 23a46b4be35277e06ec89f48730eeb694e686be8 Mon Sep 17 00:00:00 2001
From: Kenmegne <stephanie.kenmegne@gmail.com>
Date: Thu, 18 Jun 2026 15:40:06 +0000
Subject: [PATCH] add fdx-commons and fdx-consultation
---
fdx-consultation/fdxconsultation-core-ifaces/src/main/java/com/megatim/fdxconsultation/core/ifaces/abtracts/GenericCrudManagerIFaces.java | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 58 insertions(+), 0 deletions(-)
diff --git a/fdx-consultation/fdxconsultation-core-ifaces/src/main/java/com/megatim/fdxconsultation/core/ifaces/abtracts/GenericCrudManagerIFaces.java b/fdx-consultation/fdxconsultation-core-ifaces/src/main/java/com/megatim/fdxconsultation/core/ifaces/abtracts/GenericCrudManagerIFaces.java
new file mode 100644
index 0000000..dd8da48
--- /dev/null
+++ b/fdx-consultation/fdxconsultation-core-ifaces/src/main/java/com/megatim/fdxconsultation/core/ifaces/abtracts/GenericCrudManagerIFaces.java
@@ -0,0 +1,58 @@
+package com.megatim.fdxconsultation.core.ifaces.abtracts;
+
+import com.megatim.fdxconsultation.model.administration.User;
+import java.io.Serializable;
+
+/**
+ *
+ * @author ASUS
+ */
+public interface GenericCrudManagerIFaces<T, K, S, ID extends Serializable, U> extends GeneriConsultingManagerIFaces<T, K, S, ID, U> {
+
+ public default T add(T entity, User connectedUser) {
+
+ //Pre-traitements
+ beforeAdd(entity, connectedUser);
+
+ //On save
+ T newEntity = save(entity);
+
+ return newEntity;
+ }
+
+ @Override
+ public default S getById(ID id) {
+
+ T entity = find(getEntityIdName(), id);
+
+ return mapToDetailDto(entity);
+ }
+
+ public default T modify(ID id, T entity, User connectedUser) {
+
+ T actualEntity = find(getEntityIdName(), id);
+
+ //On copie les nouvelles valeurs
+ beforeModify(actualEntity, entity, connectedUser);
+
+ update(id, actualEntity);
+
+ return actualEntity;
+ }
+
+ public default T remove(ID id, User connectedUser) {
+
+ T entity = find(getEntityIdName(), id);
+
+ beforeRemove(entity, connectedUser);
+
+ return update(id, entity);
+ }
+
+ public abstract void beforeAdd(T entity, User connectedUser);
+
+ public abstract void beforeRemove(T entity, User connectedUser);
+
+ public abstract void beforeModify(T actualEntity, T requestEntity, User connectedUser);
+
+}
--
Gitblit v1.10.0