Skip to content

Commit d08857e

Browse files
omarbenhaddiFrancoisEricMerlin
authored andcommitted
27594: Some improvements
1 parent b28f921 commit d08857e

File tree

5 files changed

+43
-16
lines changed

5 files changed

+43
-16
lines changed

src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandDAO.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,16 @@ public interface IDemandDAO
114114
* @return the stored demand
115115
*/
116116
Demand store( Demand demand );
117+
118+
/**
119+
* Update demands status id
120+
*
121+
* @param nStatusId
122+
* the new status id
123+
* @param nTemporaryStatusId
124+
* To find Demands that are linked to notifications that have the temporary status in parameter
125+
*/
126+
void updateDemandsStatusId( int nStatusId, int nTemporaryStatusId );
117127

118128
/**
119129
* Deletes a demand with the specified id and type id

src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandServiceProvider.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public interface IDemandServiceProvider
7979
*
8080
* @param dao
8181
*/
82-
public void setStatusDao( IDemandStatusDAO dao );
82+
public void setStatusDao( ITemporaryStatusDAO dao );
8383

8484
/**
8585
* Finds demands for the specified customer id
@@ -144,6 +144,16 @@ public interface IDemandServiceProvider
144144
* @return the updated demand
145145
*/
146146
public Demand update( Demand demand );
147+
148+
/**
149+
* Update status demand
150+
*
151+
* @param nNewStatusId
152+
* the new status id
153+
* @param nTemporaryStatusId
154+
* To find Demands that are linked to notifications that have the temporary status in parameter
155+
*/
156+
public void updateDemandsStatusId( int nNewStatusId, int nTemporaryStatusId );
147157

148158
/**
149159
* Removes a demand with the specified id and type id
@@ -198,7 +208,7 @@ public interface IDemandServiceProvider
198208
* @param strStatusLabel
199209
* @return the status
200210
*/
201-
public Optional<DemandStatus> getStatusByLabel( String strStatusLabel );
211+
public Optional<TemporaryStatus> getStatusByLabel( String strStatusLabel );
202212

203213
/**
204214
* Deletion of the demand and data related to the demand.

src/java/fr/paris/lutece/plugins/grubusiness/business/demand/IDemandStatusDAO.java renamed to src/java/fr/paris/lutece/plugins/grubusiness/business/demand/ITemporaryStatusDAO.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
import java.util.Optional;
3838

3939
/**
40-
* IStatusDAO Interface
40+
* ITemporaryStatusDAO Interface
4141
*/
42-
public interface IDemandStatusDAO
42+
public interface ITemporaryStatusDAO
4343
{
4444
/**
4545
* Insert a new record in the table.
@@ -49,7 +49,7 @@ public interface IDemandStatusDAO
4949
* @param plugin
5050
* the Plugin
5151
*/
52-
void insert( DemandStatus status );
52+
void insert( TemporaryStatus status );
5353

5454
/**
5555
* Update the record in the table
@@ -59,7 +59,7 @@ public interface IDemandStatusDAO
5959
* @param plugin
6060
* the Plugin
6161
*/
62-
void store( DemandStatus status );
62+
void store( TemporaryStatus status );
6363

6464
/**
6565
* Delete a record from the table
@@ -83,7 +83,7 @@ public interface IDemandStatusDAO
8383
* the Plugin
8484
* @return The instance of the status
8585
*/
86-
Optional<DemandStatus> load( int nKey );
86+
Optional<TemporaryStatus> load( int nKey );
8787

8888
/**
8989
* Load the data from the table
@@ -93,7 +93,7 @@ public interface IDemandStatusDAO
9393
* the Plugin
9494
* @return The instance of the status
9595
*/
96-
Optional<DemandStatus> loadByStatusId( int nStatusId );
96+
Optional<TemporaryStatus> loadByStatusId( int nStatusId );
9797

9898
/**
9999
* Load the data of all the status objects and returns them as a list
@@ -102,7 +102,7 @@ public interface IDemandStatusDAO
102102
* the Plugin
103103
* @return The list which contains the data of all the status objects
104104
*/
105-
List<DemandStatus> selectStatusList( );
105+
List<TemporaryStatus> selectStatusList( );
106106

107107
/**
108108
* Load the id of all the status objects and returns them as a list
@@ -122,7 +122,7 @@ public interface IDemandStatusDAO
122122
* liste of ids
123123
* @return The list which contains the data of all the avant objects
124124
*/
125-
List<DemandStatus> selectStatusListByIds( List<Integer> listIds );
125+
List<TemporaryStatus> selectStatusListByIds( List<Integer> listIds );
126126

127127
/**
128128
* Load the data from the table
@@ -132,5 +132,5 @@ public interface IDemandStatusDAO
132132
* the Plugin
133133
* @return The instance of the status
134134
*/
135-
Optional<DemandStatus> loadByStatus( String strStatus );
135+
Optional<TemporaryStatus> loadByStatus( String strStatus );
136136
}

src/java/fr/paris/lutece/plugins/grubusiness/business/demand/DemandStatus.java renamed to src/java/fr/paris/lutece/plugins/grubusiness/business/demand/TemporaryStatus.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@
4040
import java.io.Serializable;
4141

4242
/**
43-
* This is the business class for the object Status
43+
* This is the business class for the object TemporaryStatus
4444
*/
45-
public class DemandStatus implements Serializable
45+
public class TemporaryStatus implements Serializable
4646
{
4747
private static final long serialVersionUID = 1L;
4848

4949
// Variables declarations
50-
private int _nId;
50+
private int _nTemporayStatusId;
5151

5252
@NotEmpty( message = "#i18n{notificationstore.validation.status.Status.notEmpty}" )
5353
private String _strStatus;
@@ -61,7 +61,7 @@ public class DemandStatus implements Serializable
6161
*/
6262
public int getId( )
6363
{
64-
return _nId;
64+
return _nTemporayStatusId;
6565
}
6666

6767
/**
@@ -72,7 +72,7 @@ public int getId( )
7272
*/
7373
public void setId( int nId )
7474
{
75-
_nId = nId;
75+
_nTemporayStatusId = nId;
7676
}
7777

7878
/**

src/java/fr/paris/lutece/plugins/grubusiness/business/mock/MockDemandDAO.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,4 +194,11 @@ public void deleteByUid( int nUid )
194194

195195
}
196196

197+
@Override
198+
public void updateDemandsStatusId( int nStatusId, int nTemporaryStatusId )
199+
{
200+
// TODO Auto-generated method stub
201+
202+
}
203+
197204
}

0 commit comments

Comments
 (0)