public class CommentsService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ServiceExecutor |
serviceExecutor |
Constructor and Description |
---|
CommentsService(MambuAPIService mambuAPIService)
Create a new service
|
Modifier and Type | Method and Description |
---|---|
com.mambu.core.shared.model.Comment |
create(MambuEntityType parentEntity,
java.lang.String parentEntityId,
com.mambu.core.shared.model.Comment comment)
Create new Comment using Comment object.
|
com.mambu.core.shared.model.Comment |
create(MambuEntityType parentEntity,
java.lang.String parentEntityId,
java.lang.String text)
Create new Comment
|
java.util.List<com.mambu.core.shared.model.Comment> |
getComments(MambuEntityType parentEntity,
java.lang.String parentId,
java.lang.Integer offset,
java.lang.Integer limit)
Get all Comments for a given parent entity
|
static MambuEntityType[] |
getSupportedEntities()
Get supported entity types
|
static boolean |
isSupported(MambuEntityType parentEntityType)
Is parent entity type supported by the Comments API
|
protected ServiceExecutor serviceExecutor
@Inject public CommentsService(MambuAPIService mambuAPIService)
mambuAPIService
- the service responsible with the connection to the serverpublic com.mambu.core.shared.model.Comment create(MambuEntityType parentEntity, java.lang.String parentEntityId, java.lang.String text) throws MambuApiException
parentEntity
- MambuEntityType for which comments are retrieved. Example: MambuEntityType.CLIENT for comments owned
by Client. Must not be null. Comments for the following entities are currently supported: Client,
Group. LoanAccount, SavingsAccount, LoanProduct, SavingsProduct, Branch, Centre, UserparentEntityId
- entity id or encoded key for the parent entity. Example, ciinetId for MambuEntityType.CLIENT. Must not
be nulltext
- comment to post. Must not be nullMambuApiException
public com.mambu.core.shared.model.Comment create(MambuEntityType parentEntity, java.lang.String parentEntityId, com.mambu.core.shared.model.Comment comment) throws MambuApiException
parentEntity
- MambuEntityType for which comments are retrieved. Example: MambuEntityType.CLIENT for comments owned
by Client. Must not be null. Comments for the following entities are currently supported: Client,
Group. LoanAccount, SavingsAccount, LoanProduct, SavingsProduct, Branch, Centre, UserparentEntityId
- entity id or encoded key for the parent entity. Example, ciinetId for MambuEntityType.CLIENT. Must not
be nullcomment
- comment to post. Must not be null. Only "text" field is usedMambuApiException
public java.util.List<com.mambu.core.shared.model.Comment> getComments(MambuEntityType parentEntity, java.lang.String parentId, java.lang.Integer offset, java.lang.Integer limit) throws MambuApiException
parentEntity
- MambuEntityType for which comments are retrieved. MambuEntityType.CLIENT, MambuEntity.BRANCH. Must not
be null. Comments for the following entities are currently supported: Client, Group. LoanAccount,
SavingsAccount, LoanProduct, SavingsProduct, Branch, Centre, UserparentId
- entity id or encoded key for the parent entity. Example, client id for a MambuEntityType.CLIENT. Must
not be nulloffset
- pagination offsetlimit
- pagination limitMambuApiException
public static MambuEntityType[] getSupportedEntities()
public static boolean isSupported(MambuEntityType parentEntityType)
parentEntityType
- Mambu Entity type