Skip to content

Commit

Permalink
External Asset Owner tab with details (#1773)
Browse files Browse the repository at this point in the history
Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
  • Loading branch information
josehernandezfintecheandomx and Jose Alberto Hernandez authored Jun 27, 2023
1 parent 3d845b1 commit d0bc112
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,80 @@
<div class="tab-container mat-typography">
<div fxFlexFill *ngIf="existActiveTransfer">
<h3>Active Asset Transfer</h3>
<div fxLayout="row" fxLayoutGap="32px" class="asset-transfer-container">
<table>
<tbody>
<tr>
<td fxFlex="25%">
<b>Status :</b>
</td>
<td fxFlex="25%" class="left">
<div [ngClass]="itemStatus(activeTransferData.status)">
<fa-icon icon="stop"></fa-icon>
<span class="m-l-10 status">{{activeTransferData.status}}</span>
</div>
</td>
<td fxFlex="25%">
<b>Owner External Id :</b>
</td>
<td fxFlex="25%" class="left">
{{activeTransferData.owner.externalId}}
</td>
</tr>
<tr>
<td fxFlex="25%">
<b>Settlement Date :</b>
</td>
<td fxFlex="25%" class="left">
{{activeTransferData.settlementDate | dateFormat}}
</td>
<td fxFlex="25%">
<b>Effective Date :</b>
</td>
<td fxFlex="25%" class="left">
{{activeTransferData.effectiveFrom | dateFormat}}
</td>
</tr>
<tr>
<td fxFlex="25%">
<b>Details :</b>
</td>
<td fxFlex="75%" class="left">
<table>
<tbody>
<tr>
<td fxFlex="50%"><b>Principal Outstanding :</b></td>
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalPrincipalOutstanding | number}}</td>
</tr>
<tr>
<td fxFlex="50%"><b>Interest Outstanding :</b></td>
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalInterestOutstanding | number}}</td>
</tr>
<tr>
<td fxFlex="50%"><b>Fees Outstanding :</b></td>
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalFeeChargesOutstanding | number}}</td>
</tr>
<tr>
<td fxFlex="50%"><b>Penalties Outstanding :</b></td>
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalPenaltyChargesOutstanding | number}}</td>
</tr>
<tr>
<td fxFlex="50%"><b>Outstanding :</b></td>
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalOutstanding | number}}</td>
</tr>
<tr>
<td fxFlex="50%"><b>Overpaid :</b></td>
<td fxFlex="50%" class="r-amount">{{activeTransferData.details.totalOverpaid | number}}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>

<div fxLayout="row" fxLayoutAlign="start center">

<h3 fxFlex="90%">External Asset Owner</h3>
Expand Down Expand Up @@ -30,7 +106,7 @@ <h3 fxFlex="90%">External Asset Owner</h3>
<div [ngClass]="itemStatus(item.status)">
<fa-icon icon="stop"></fa-icon>
<span class="m-l-10 status">
{{ item.status | translate }}
{{ itemCurrentStatus(item) | translate }}
</span>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
.container {
.tab-container {
padding-bottom: 2%;

h3 {
margin: 1% auto;
}

.transaction-buttons {
padding-bottom: 1rem;
padding-top: 1rem;
Expand All @@ -9,6 +13,12 @@
}
}

.asset-transfer-container {
border: 1px solid;
padding: 1%;
margin-bottom: 20px;
}

table {
width: 100%;

Expand All @@ -33,3 +43,5 @@
margin: 0 2%;
line-height: 25px;
}


Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
loanTransferColumns: string[] = ['status', 'effectiveFrom', 'ownerExternalId', 'transferExternalId', 'settlementDate', 'purchasePriceRatio', 'actions'];

currentItem: any;
existActiveTransfer = false;

constructor(private route: ActivatedRoute,
private router: Router,
Expand All @@ -24,7 +25,10 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
) {
this.route.data.subscribe((data: { loanTransfersData: any, activeTransferData: any }) => {
this.loanTransfersData = data.loanTransfersData.empty ? [] : data.loanTransfersData.content;
this.activeTransferData = data.activeTransferData || {};
this.activeTransferData = data.activeTransferData || null;
this.existActiveTransfer = (data.activeTransferData && data.activeTransferData.transferId != null);
console.log(this.existActiveTransfer);
console.log(this.activeTransferData);
});
}

Expand All @@ -35,6 +39,13 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
}
}

itemCurrentStatus(item: any): string {
if (item.status === 'BUYBACK' && item.effectiveTo === '9999-12-31') {
return item.status + ' PENDING';
}
return item.status;
}

itemStatus(status: string): string {
return 'status-' + status.toLowerCase();
}
Expand Down

0 comments on commit d0bc112

Please sign in to comment.