/** Angular Imports */ import { Injectable } from '@angular/core' ; import { HttpClient , HttpParams } from '@angular/common/http' ; /** rxjs Imports */ import { Observable } from 'rxjs' ; /**
 * Recurring Deposits Service.
 */ @ Injectable ( { providedIn : 'root' } ) export class RecurringDepositsService { constructor ( private http ) { } params getRecurringDepositsAccountData ( recurringDepositAccountId ) { const httpParams = new HttpParams ( ) . set ( 'associations' , 'all' ) ; return this . http . get ( `/recurringdepositaccounts/${ recurringDepositAccountId }` , { params : httpParams } ) ; } param clientId param clientName param fromAccountId param locale param dateFormat returns { Observable < any > } getStandingInstructions ( clientId , clientName , fromAccountId , locale , dateFormat ) { const httpParams = new HttpParams ( ) . set ( 'clientId' , clientId ) . set ( 'clientName' , clientName ) . set ( 'fromAccountId' , fromAccountId ) . set ( 'fromAccountType' , '2' ) . set ( 'locale' , locale ) . set ( 'dateFormat' , dateFormat ) ; return this . http . get ( `/standinginstructions` , { params : httpParams } ) ; } param clientId param productId getRecurringDepositsAccountTemplate ( clientId , productId ? ) { let httpParams = new HttpParams ( ) . set ( 'clientId' , clientId ) ; httpParams = productId ? httpParams . set ( 'productId' , productId ) : httpParams ; return this . http . get ( `/recurringdepositaccounts/template` , { params : httpParams } ) ; } param recurringAccountData createRecurringDepositAccount ( recurringAccountData ) { return this . http . post ( `/recurringdepositaccounts` , recurringAccountData ) ; } param { string } accountId param { string } command param { any } data returns { Observable < any > } executeRecurringDepositsAccountCommand ( accountId , command , data ) { const httpParams = new HttpParams ( ) . set ( 'command' , command ) ; return this . http . post ( `/recurringdepositaccounts/${ accountId }` , data , { params : httpParams } ) ; } param { string } accountId returns { Observable < any > } deleteRecurringDepositsAccount ( accountId ) { return this . http . delete ( `/recurringdepositaccounts/${ accountId }` ) ; } param accountId getRecurringDepositsAccountAndTemplate ( accountId ) { const httpParams = new HttpParams ( ) . set ( 'associations' , 'charges' ) . set ( 'template' , 'true' ) ; return this . http . get ( `/recurringdepositaccounts/${ accountId }` , { params : httpParams } ) ; } param { any } accountId param { any } recurringDepositAccountData returns { Observable < any > } updateRecurringDepositAccount ( accountId , recurringDepositAccountData ) { return this . http . put ( `/recurringdepositaccounts/${ accountId }` , recurringDepositAccountData ) ; } param accountId param command getRecurringDepositAccountActionResource ( accountId , command ) { const httpParams = new HttpParams ( ) . set ( 'command' , command ) ; return this . http . get ( `/recurringdepositaccounts/${ accountId }/template` , { params : httpParams } ) ; } param accountId param command getRecurringDepositAccountTransactionTemplateResource ( accountId , command ) { const httpParams = new HttpParams ( ) . set ( 'command' , command ) ; return this . http . get ( `/recurringdepositaccounts/${ accountId }/transactions/template` , { params : httpParams } ) ; } getRecurringDepositsAccountTransaction ( accountId , transactionId ) { return this . http . get ( `/recurringdepositaccounts/${ accountId }/transactions/${ transactionId }` ) ; } param { string } accountId param { string } transactionId returns { Observable < any > } getRecurringDepositsAccountTransactionTemplate ( accountId , transactionId ) { const httpParams = new HttpParams ( ) . set ( 'template' , 'true' ) ; return this . http . get ( `/recurringdepositaccounts/${ accountId }/transactions/${ transactionId }` , { params : httpParams } ) ; } param { string } accountId param { string } command param { any } data param { string } transactionId returns { Observable < any > } executeRecurringDepositsAccountTransactionsCommand ( accountId , command , data , transactionId ? ) { const httpParams = new HttpParams ( ) . set ( 'command' , command ) ; return this . http . post ( `/recurringdepositaccounts/${ accountId }/transactions/${ transactionId }` , data , { params : httpParams } ) ; } }