Files
cbsnexora/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposits-buttons.config.ts
T

125 lines
2.4 KiB
TypeScript

/** 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'
},
{
name: 'Undo Activation',
icon: 'fa fa-undo'
}
];
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: 'Withdrawn by Client'
},
{
name: 'Add Charge'
},
{
name: 'Delete'
}
];
break;
case 'Approved':
default:
this.optionArray = [];
}
}
addOption(option: {name: string}) {
this.optionArray.push(option);
}
}