Enhancement/inverstor search data (#1838)

* Investor Search data

* Investor module

---------

Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
José Alberto Hernández
2023-08-10 01:53:42 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent 861cf7a000
commit ed47d769e3
47 changed files with 1627 additions and 489 deletions
@@ -0,0 +1,70 @@
import { HttpClient, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class ExternalAssetOwnerService {
basePath = '/external-asset-owners';
constructor(private http: HttpClient) { }
/**
* @param {string} loanId Loan Id
* @param {string} command Command
* @param {any} data Data
* @returns {Observable<any>}
*/
executeExternalAssetOwnerLoanCommand(loanId: string, data: any, command: string): Observable<any> {
const httpParams = new HttpParams().set('command', command);
return this.http.post(`${this.basePath}/transfers/loans/${loanId}`, data, { params: httpParams });
}
/**
* @param {string} transferId Transfer Id
* @param {string} command Command
* @param {any} data Data
* @returns {Observable<any>}
*/
executeExternalAssetOwnerTransferCommand(transferId: string, data: any, command: string): Observable<any> {
const httpParams = new HttpParams().set('command', command);
return this.http.post(`${this.basePath}/transfers/${transferId}`, data, { params: httpParams });
}
/**
* @param {string} loanId Loan Id
* @returns {Observable<any>}
*/
retrieveExternalAssetOwnerTransfers(loanId: string): Observable<any> {
const httpParams = new HttpParams().set('loanId', loanId);
return this.http.get(`${this.basePath}/transfers`, { params: httpParams });
}
/**
* @param {string} loanId Loan Id
* @returns {Observable<any>}
*/
retrieveExternalAssetOwnerActiveTransfer(loanId: string): Observable<any> {
const httpParams = new HttpParams().set('loanId', loanId);
return this.http.get(`${this.basePath}/transfers/active-transfer`, { params: httpParams });
}
/**
* @param {string} transferId Transfer Id
* @returns {Observable<any>}
*/
retrieveExternalAssetOwnerTransferJournalEntries(transferId: string): Observable<any> {
return this.http.get(`${this.basePath}/transfers/${transferId}/journal-entries`);
}
/**
* @param {any} request Transfer Id
* @returns {Observable<any>}
*/
searchExternalAssetOwnerTransfer(request: any): Observable<any> {
return this.http.post(`${this.basePath}/search`, request);
}
}