public class DocumentTemplatesService
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected ServiceExecutor |
serviceExecutor |
Constructor and Description |
---|
DocumentTemplatesService(MambuAPIService mambuAPIService)
Create a new service
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getPopulatedEntityTemplate(MambuEntityType parentEntity,
java.lang.String entityId,
java.lang.String templateKey,
java.lang.String startDate,
java.lang.String endDate)
Convenience method to get populated document template for a given parent entity and a given template id
|
java.lang.String |
getPopulatedEntityTransactionTemplate(MambuEntityType parentEntity,
java.lang.String entityId,
java.lang.String templateKey,
java.lang.String transactionId)
Convenience method to get populated transaction document template for a given parent entity (LoanAccount or
SavingsAccont)
|
java.lang.String |
getPopulatedLoanTemplate(java.lang.String loanAccountId,
java.lang.String templateKey,
java.lang.String startDate,
java.lang.String endDate)
Get populated account document template for a loan account and a given template key
|
java.lang.String |
getPopulatedLoanTransactionTemplate(java.lang.String loanAccountId,
java.lang.String templateKey,
java.lang.String transactionId)
Get populated transaction document template for a loan account
|
java.lang.String |
getPopulatedSavingsTemplate(java.lang.String savingsAccountId,
java.lang.String templateKey,
java.lang.String startDate,
java.lang.String endDate)
Get populated account document template for a savings account and a given template key
|
java.lang.String |
getPopulatedSavingsTransactionTemplate(java.lang.String savingsAccountId,
java.lang.String templateKey,
java.lang.String transactionId)
Get populated transaction document template for a savings account
|
static MambuEntityType[] |
getSupportedEntities()
Get supported entity types
|
static boolean |
isSupported(MambuEntityType entityType)
Is parent entity type supported by the Document Templates API
|
protected ServiceExecutor serviceExecutor
@Inject public DocumentTemplatesService(MambuAPIService mambuAPIService)
mambuAPIService
- the service responsible with the connection to the serverpublic java.lang.String getPopulatedLoanTemplate(java.lang.String loanAccountId, java.lang.String templateKey, java.lang.String startDate, java.lang.String endDate) throws MambuApiException
loanAccountId
- id or encoded key for the loan account. Must not be nulltemplateKey
- template encoded key. Should be a valid product document template encoded key. Must not be nullstartDate
- Start date. Mandatory for product documents that "Include Transactions History" (i.e. documents of
DocumentTemplateType.ACCOUNT_WITH_TRANSACTIONS type) and can be only specified for documents of this
type. If specified, must be less or equal to endDateendDate
- End date. Mandatory for product documents that "Include Transactions History" (i.e. documents of
DocumentTemplateType.ACCOUNT_WITH_TRANSACTIONS type) and can be only specified for documents of this
type.MambuApiException
public java.lang.String getPopulatedSavingsTemplate(java.lang.String savingsAccountId, java.lang.String templateKey, java.lang.String startDate, java.lang.String endDate) throws MambuApiException
savingsAccountId
- id or encoded key for the savings account. Must not be nulltemplateKey
- template encoded key. Should be a valid product document template encoded key. Must not be nullstartDate
- Start date. Mandatory for product documents that "Include Transactions History" (i.e. documents of
DocumentTemplateType.ACCOUNT_WITH_TRANSACTIONS type) and can be only specified for documents of this
type. If specified, must be less or equal to endDateendDate
- End date. Mandatory for product documents that "Include Transactions History".(i.e. documents of
DocumentTemplateType.ACCOUNT_WITH_TRANSACTIONS type) and can be only specified for documents of this
type.MambuApiException
public java.lang.String getPopulatedLoanTransactionTemplate(java.lang.String loanAccountId, java.lang.String templateKey, java.lang.String transactionId) throws MambuApiException
loanAccountId
- id or encoded key for the loan account. Must not be nulltemplateKey
- template encoded key. Should be a valid product document template encoded key. Must not be nulltransactionId
- a valid transaction ID or encoded key. Must not be nullMambuApiException
public java.lang.String getPopulatedSavingsTransactionTemplate(java.lang.String savingsAccountId, java.lang.String templateKey, java.lang.String transactionId) throws MambuApiException
savingsAccountId
- entity id or encoded key for the savings account. Must not be nulltemplateKey
- template encoded key. Should be a valid product document template encoded key. Must not be nulltransactionId
- a valid transaction ID or encoded key. Must not be nullMambuApiException
public static MambuEntityType[] getSupportedEntities()
public static boolean isSupported(MambuEntityType entityType)
entityType
- Mambu Entity typepublic java.lang.String getPopulatedEntityTemplate(MambuEntityType parentEntity, java.lang.String entityId, java.lang.String templateKey, java.lang.String startDate, java.lang.String endDate) throws MambuApiException
parentEntity
- MambuEntityType for which document templates are retrieved. Example, MambuEntityType.LOAN_ACCOUNT.
Must not be null. Currently can be only MambuEntityType.LOAN_ACCOUNT or
MambuEntityType.SAVINGS_ACCOUNTentityId
- entity id or encoded key for the parent entity. Example, loan account id for a
MambuEntityType.LOAN_ACCOUNT. Must not be nulltemplateKey
- template encoded key. Should be a valid product document template encoded key. Must not be nullstartDate
- Start date. Mandatory for product documents that "Include Transactions History". Can only be be
specified for documents that "Include Transactions History". startDate <= endDateendDate
- End date. Mandatory for product documents that "Include Transactions History". Can only be be
specified for documents that "Include Transactions History". startDate <= endDateMambuApiException
public java.lang.String getPopulatedEntityTransactionTemplate(MambuEntityType parentEntity, java.lang.String entityId, java.lang.String templateKey, java.lang.String transactionId) throws MambuApiException
parentEntity
- MambuEntityType for which document templates are retrieved. Example, MambuEntityType.LOAN_ACCOUNT.
Must not be null. Currently can be only MambuEntityType.LOAN_ACCOUNT or
MambuEntityType.SAVINGS_ACCOUNTentityId
- entity id or encoded key for the parent entity. Example, loan account id for a
MambuEntityType.LOAN_ACCOUNT. Must not be nulltemplateKey
- template encoded key. Should be a valid product document template encoded key. Must not be nulltransactionId
- a valid transaction ID or encoded key. Must not be nullMambuApiException