diff --git a/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandDAO.java b/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandDAO.java index 17a5ad4..317baf1 100644 --- a/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandDAO.java +++ b/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandDAO.java @@ -114,6 +114,16 @@ public interface IDemandDAO * @return the stored demand */ Demand store( Demand demand ); + + /** + * Update demands status id + * + * @param nStatusId + * the new status id + * @param nTemporaryStatusId + * To find Demands that are linked to notifications that have the temporary status in parameter + */ + void updateDemandsStatusId( int nStatusId, int nTemporaryStatusId ); /** * Deletes a demand with the specified id and type id diff --git a/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandServiceProvider.java b/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandServiceProvider.java index 4b6be7a..75d8b1a 100644 --- a/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandServiceProvider.java +++ b/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandServiceProvider.java @@ -79,7 +79,7 @@ public interface IDemandServiceProvider * * @param dao */ - public void setStatusDao( IDemandStatusDAO dao ); + public void setStatusDao( ITemporaryStatusDAO dao ); /** * Finds demands for the specified customer id @@ -144,6 +144,16 @@ public interface IDemandServiceProvider * @return the updated demand */ public Demand update( Demand demand ); + + /** + * Update status demand + * + * @param nNewStatusId + * the new status id + * @param nTemporaryStatusId + * To find Demands that are linked to notifications that have the temporary status in parameter + */ + public void updateDemandsStatusId( int nNewStatusId, int nTemporaryStatusId ); /** * Removes a demand with the specified id and type id @@ -198,7 +208,7 @@ public interface IDemandServiceProvider * @param strStatusLabel * @return the status */ - public Optional getStatusByLabel( String strStatusLabel ); + public Optional getStatusByLabel( String strStatusLabel ); /** * Deletion of the demand and data related to the demand. diff --git a/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandStatusDAO.java b/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/ITemporaryStatusDAO.java similarity index 89% rename from src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandStatusDAO.java rename to src/java/fr/paris/lutece/plugins/grubusiness/business/demand/ITemporaryStatusDAO.java index e22f94d..79de74e 100644 --- a/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandStatusDAO.java +++ b/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/ITemporaryStatusDAO.java @@ -37,9 +37,9 @@ import java.util.Optional; /** - * IStatusDAO Interface + * ITemporaryStatusDAO Interface */ -public interface IDemandStatusDAO +public interface ITemporaryStatusDAO { /** * Insert a new record in the table. @@ -49,7 +49,7 @@ public interface IDemandStatusDAO * @param plugin * the Plugin */ - void insert( DemandStatus status ); + void insert( TemporaryStatus status ); /** * Update the record in the table @@ -59,7 +59,7 @@ public interface IDemandStatusDAO * @param plugin * the Plugin */ - void store( DemandStatus status ); + void store( TemporaryStatus status ); /** * Delete a record from the table @@ -83,7 +83,7 @@ public interface IDemandStatusDAO * the Plugin * @return The instance of the status */ - Optional load( int nKey ); + Optional load( int nKey ); /** * Load the data from the table @@ -93,7 +93,7 @@ public interface IDemandStatusDAO * the Plugin * @return The instance of the status */ - Optional loadByStatusId( int nStatusId ); + Optional loadByStatusId( int nStatusId ); /** * Load the data of all the status objects and returns them as a list @@ -102,7 +102,7 @@ public interface IDemandStatusDAO * the Plugin * @return The list which contains the data of all the status objects */ - List selectStatusList( ); + List selectStatusList( ); /** * Load the id of all the status objects and returns them as a list @@ -122,7 +122,7 @@ public interface IDemandStatusDAO * liste of ids * @return The list which contains the data of all the avant objects */ - List selectStatusListByIds( List listIds ); + List selectStatusListByIds( List listIds ); /** * Load the data from the table @@ -132,5 +132,5 @@ public interface IDemandStatusDAO * the Plugin * @return The instance of the status */ - Optional loadByStatus( String strStatus ); + Optional loadByStatus( String strStatus ); } diff --git a/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/DemandStatus.java b/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/TemporaryStatus.java similarity index 93% rename from src/java/fr/paris/lutece/plugins/grubusiness/business/demand/DemandStatus.java rename to src/java/fr/paris/lutece/plugins/grubusiness/business/demand/TemporaryStatus.java index 3ed04a0..a408e51 100644 --- a/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/DemandStatus.java +++ b/src/java/fr/paris/lutece/plugins/grubusiness/business/demand/TemporaryStatus.java @@ -40,14 +40,14 @@ import java.io.Serializable; /** - * This is the business class for the object Status + * This is the business class for the object TemporaryStatus */ -public class DemandStatus implements Serializable +public class TemporaryStatus implements Serializable { private static final long serialVersionUID = 1L; // Variables declarations - private int _nId; + private int _nTemporayStatusId; @NotEmpty( message = "#i18n{notificationstore.validation.status.Status.notEmpty}" ) private String _strStatus; @@ -61,7 +61,7 @@ public class DemandStatus implements Serializable */ public int getId( ) { - return _nId; + return _nTemporayStatusId; } /** @@ -72,7 +72,7 @@ public int getId( ) */ public void setId( int nId ) { - _nId = nId; + _nTemporayStatusId = nId; } /** diff --git a/src/java/fr/paris/lutece/plugins/grubusiness/business/mock/MockDemandDAO.java b/src/java/fr/paris/lutece/plugins/grubusiness/business/mock/MockDemandDAO.java index 1ca09a4..020ae93 100644 --- a/src/java/fr/paris/lutece/plugins/grubusiness/business/mock/MockDemandDAO.java +++ b/src/java/fr/paris/lutece/plugins/grubusiness/business/mock/MockDemandDAO.java @@ -194,4 +194,11 @@ public void deleteByUid( int nUid ) } + @Override + public void updateDemandsStatusId( int nStatusId, int nTemporaryStatusId ) + { + // TODO Auto-generated method stub + + } + }