feat: view fixed-deposit account page (#959)

Fixes: #225
This commit is contained in:
Karan Takalkar
2020-07-02 20:49:49 +05:30
committed by GitHub
parent 50dbb7b6e6
commit 87604b4e3e
32 changed files with 1333 additions and 2 deletions
@@ -0,0 +1,120 @@
/** Fixed Deposits Account Buttons Configuration */
export class FixedDepositsButtonsConfiguration {
optionArray: {
name: string
}[];
buttonsArray: {
name: string,
icon: string,
}[];
constructor(status: string) {
this.setOptions(status);
this.setButtons(status);
}
get singleButtons() {
return this.buttonsArray;
}
get options() {
return this.optionArray;
}
setButtons(status: string) {
switch (status) {
case 'Active':
this.buttonsArray = [
{
name: 'Premature Close',
icon: 'fa fa-arrow-left'
},
{
name: 'Calculate Interest',
icon: 'fa fa-table'
}
];
break;
case 'Matured':
this.buttonsArray = [
{
name: 'Close',
icon: 'fa fa-arrow-right'
},
{
name: 'Calculate Interest',
icon: 'fa fa-table'
}
];
break;
case 'Submitted and pending approval':
this.buttonsArray = [
{
name: 'Modify Application',
icon: 'fa fa-pencil '
},
{
name: 'Approve',
icon: 'fa fa-check'
}
];
break;
case 'Approved':
this.buttonsArray = [
{
name: 'Undo Approval',
icon: 'fa fa-undo'
},
{
name: 'Activate',
icon: 'fa fa-check'
}
];
break;
default:
this.buttonsArray = [];
}
}
setOptions(status: string) {
switch (status) {
case 'Active':
case 'Matured':
this.optionArray = [
{
name: 'Post Interest'
},
{
name: 'Add Charge'
}
];
break;
case 'Submitted and pending approval':
this.optionArray = [
{
name: 'Reject'
},
{
name: 'Withdraw By Client'
},
{
name: 'Add Charge'
},
{
name: 'Delete'
}
];
break;
case 'Approved':
default:
this.optionArray = [];
}
}
addOption(option: {name: string}) {
this.optionArray.push(option);
}
}