Skip to content

Commit

Permalink
27594: Some improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
omarbenhaddi authored and FrancoisEricMerlin committed Nov 18, 2024
1 parent b28f921 commit d08857e
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -198,7 +208,7 @@ public interface IDemandServiceProvider
* @param strStatusLabel
* @return the status
*/
public Optional<DemandStatus> getStatusByLabel( String strStatusLabel );
public Optional<TemporaryStatus> getStatusByLabel( String strStatusLabel );

/**
* Deletion of the demand and data related to the demand.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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
Expand All @@ -83,7 +83,7 @@ public interface IDemandStatusDAO
* the Plugin
* @return The instance of the status
*/
Optional<DemandStatus> load( int nKey );
Optional<TemporaryStatus> load( int nKey );

/**
* Load the data from the table
Expand All @@ -93,7 +93,7 @@ public interface IDemandStatusDAO
* the Plugin
* @return The instance of the status
*/
Optional<DemandStatus> loadByStatusId( int nStatusId );
Optional<TemporaryStatus> loadByStatusId( int nStatusId );

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

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

/**
* Load the data from the table
Expand All @@ -132,5 +132,5 @@ public interface IDemandStatusDAO
* the Plugin
* @return The instance of the status
*/
Optional<DemandStatus> loadByStatus( String strStatus );
Optional<TemporaryStatus> loadByStatus( String strStatus );
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -61,7 +61,7 @@ public class DemandStatus implements Serializable
*/
public int getId( )
{
return _nId;
return _nTemporayStatusId;
}

/**
Expand All @@ -72,7 +72,7 @@ public int getId( )
*/
public void setId( int nId )
{
_nId = nId;
_nTemporayStatusId = nId;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,11 @@ public void deleteByUid( int nUid )

}

@Override
public void updateDemandsStatusId( int nStatusId, int nTemporaryStatusId )
{
// TODO Auto-generated method stub

}

}

0 comments on commit d08857e

Please sign in to comment.