feat:glim and gsim account create and view

This commit is contained in:
Ramveer
2022-08-25 10:52:56 +05:30
parent e17a022c5f
commit 0e2daeac7f
51 changed files with 2623 additions and 8 deletions
@@ -0,0 +1,32 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { GroupsService } from '../groups.service';
/**
* GLIM Loans Accounts data resolver.
*/
@Injectable()
export class GLIMAccountsResolver implements Resolve<Object> {
/**
* @param {GroupsService} groupsService Groups service.
*/
constructor(private groupsService: GroupsService) { }
/**
* Returns the Group's GLIM Loans Acccounts data.
* @param {ActivatedRouteSnapshot} route Route Snapshot.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const groupId = route.parent.paramMap.get('groupId');
return this.groupsService.getGLIMAccountsData(groupId);
}
}
@@ -0,0 +1,32 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { GroupsService } from '../groups.service';
/**
* GSIM Accounts data resolver.
*/
@Injectable()
export class GSIMAccountsResolver implements Resolve<Object> {
/**
* @param {GroupsService} groupsService Groups service.
*/
constructor(private groupsService: GroupsService) { }
/**
* Returns the Group's GSIM Acccounts data.
* @param {ActivatedRouteSnapshot} route Route Snapshot.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const groupId = route.parent.paramMap.get('groupId');
return this.groupsService.getGSIMAccountsData(groupId);
}
}
+8 -2
View File
@@ -30,6 +30,8 @@ import { GroupDatatablesResolver } from './common-resolvers/group-datatables.res
import { GroupDatatableResolver } from './common-resolvers/group-datatable.resolver';
import { GroupDataAndTemplateResolver } from './common-resolvers/group-data-and-template.resolver';
import { GroupActionsResolver } from './common-resolvers/group-actions.resolver';
import { GLIMAccountsResolver } from './common-resolvers/glim-account-resolver';
import { GSIMAccountsResolver } from './common-resolvers/gsim-account-resolver';
/** Groups Routes */
const routes: Routes = [
@@ -71,7 +73,9 @@ const routes: Routes = [
data: { title: extract('General'), breadcrumb: 'General', routeParamBreadcrumb: false },
resolve: {
groupAccountsData: GroupAccountsResolver,
groupSummary: GroupSummaryResolver
groupSummary: GroupSummaryResolver,
gsimData: GSIMAccountsResolver,
glimData: GLIMAccountsResolver
}
},
{
@@ -166,6 +170,8 @@ const routes: Routes = [
GroupDatatablesResolver,
GroupDatatableResolver,
GroupDataAndTemplateResolver,
GroupActionsResolver]
GroupActionsResolver,
GSIMAccountsResolver,
GLIMAccountsResolver]
})
export class GroupsRoutingModule { }
@@ -193,6 +193,96 @@
</div>
<div *ngIf="gsimAccounts">
<div fxLayout="row" fxLayoutAlign="start" class="table-header">
<div class="m-b-10">
<h3>GSIM Account Overview</h3>
</div>
</div>
<!-- GSIM Accounts Table -->
<table mat-table [dataSource]="gsimAccounts"
class="mat-elevation-z1 m-b-30">
<ng-container matColumnDef="GSIM Id">
<th mat-header-cell *matHeaderCellDef> GSIM Id </th>
<td mat-cell *matCellDef="let element">
{{element.gsimId}} </td>
</ng-container>
<ng-container matColumnDef="Account Number">
<th mat-header-cell *matHeaderCellDef> Account Number </th>
<td mat-cell *matCellDef="let element"> {{element.accountNumber}} </td>
</ng-container>
<ng-container matColumnDef="Product">
<th mat-header-cell *matHeaderCellDef> Product </th>
<td mat-cell *matCellDef="let element"> {{element.childGSIMAccounts[0].productName}}</td>
</ng-container>
<ng-container matColumnDef="Balance">
<th mat-header-cell *matHeaderCellDef> Balance </th>
<td mat-cell *matCellDef="let element"> {{element.parentBalance}} </td>
</ng-container>
<ng-container matColumnDef="Status">
<th mat-header-cell *matHeaderCellDef> Status </th>
<td mat-cell *matCellDef="let element"> {{element.savingsStatus}} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="gsimAccountsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: gsimAccountsColumns;" [routerLink]="['../', 'savings-accounts', 'gsim-account', row.accountNumber]"></tr>
</table>
</div>
<div *ngIf="glimAccounts">
<div fxLayout="row" fxLayoutAlign="start" class="table-header">
<div class="m-b-10">
<h3>GLIM Loans Account Overview</h3>
</div>
</div>
<!-- GLIM Loans Accounts Table -->
<table mat-table [dataSource]="glimAccounts"
class="mat-elevation-z1 m-b-30">
<ng-container matColumnDef="GLIM Id">
<th mat-header-cell *matHeaderCellDef> GLIM Id </th>
<td mat-cell *matCellDef="let element">
{{element.glimId}} </td>
</ng-container>
<ng-container matColumnDef="Account Number">
<th mat-header-cell *matHeaderCellDef> Account Number </th>
<td mat-cell *matCellDef="let element"> {{element.accountNumber}} </td>
</ng-container>
<ng-container matColumnDef="Product">
<th mat-header-cell *matHeaderCellDef> Product </th>
<td mat-cell *matCellDef="let element"> {{element.childGLIMAccounts[0].productName}} </td>
</ng-container>
<ng-container matColumnDef="Original Loan">
<th mat-header-cell *matHeaderCellDef> Original Loan </th>
<td mat-cell *matCellDef="let element"> {{element.parentPrincipalAmount}} </td>
</ng-container>
<ng-container matColumnDef="Status">
<th mat-header-cell *matHeaderCellDef> Status </th>
<td mat-cell *matCellDef="let element">{{element.loanStatus}} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="glimAccountsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: glimAccountsColumns;" [routerLink]="['../', 'loans-accounts', 'glim-account', row.glimId]"></tr>
</table>
</div>
<div *ngIf="savingAccounts">
<div fxLayout="row" fxLayoutAlign="start" class="table-header">
@@ -26,4 +26,7 @@
i:hover {
cursor: pointer;
}
tr:hover {
cursor: pointer;
}
}
@@ -18,6 +18,10 @@ export class GeneralTabComponent {
loanAccounts: any;
/** Group's savings accounts data */
savingAccounts: any;
/** GSIM Accounts */
gsimAccounts: any;
/** GLIM Accounts */
glimAccounts: any;
/** Group Summary */
groupSummary: any;
/** Group's Client Members */
@@ -32,6 +36,10 @@ export class GeneralTabComponent {
openSavingsColumns: string[] = ['Account No', 'Saving Account', 'Last Active', 'Balance', 'Actions'];
/** Columns to be displayed for closed accounts table */
closedSavingsColumns: string[] = ['Account No', 'Saving Account', 'Closed Date'];
/** Columns to be displayed for GSIM Accounts Table */
gsimAccountsColumns: string[] = ['GSIM Id', 'Account Number', 'Product', 'Balance', 'Status'];
/** Columns to be displayed for GLIM Accounts Table */
glimAccountsColumns: string[] = ['GLIM Id', 'Account Number', 'Product', 'Original Loan', 'Status'];
/** Boolean for toggling loan accounts table */
showClosedLoanAccounts = false;
/** Boolean for toggling savings accounts table */
@@ -42,7 +50,9 @@ export class GeneralTabComponent {
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
this.route.data.subscribe((data: { groupAccountsData: any, groupClientMembers: any, groupSummary: any }) => {
this.route.data.subscribe((data: { groupAccountsData: any, groupClientMembers: any, groupSummary: any, glimData: any, gsimData: any }) => {
this.glimAccounts = data.glimData;
this.gsimAccounts = data.gsimData;
this.groupAccountData = data.groupAccountsData;
this.savingAccounts = data.groupAccountsData.savingsAccounts;
this.loanAccounts = data.groupAccountsData.loanAccounts;
@@ -73,6 +73,8 @@
<button mat-menu-item *mifosxHasPermission="'CREATE_LOAN'">Bulk JLG Loan Application</button></span>
<button mat-menu-item *mifosxHasPermission="'CREATE_SAVINGSACCOUNT'" [routerLink]="['savings-accounts', 'create']">Group Saving Application</button>
<button mat-menu-item *mifosxHasPermission="'CREATE_LOAN'" [routerLink]="['loans-accounts', 'create']">Group Loan Application</button>
<button mat-menu-item [routerLink]="['loans-accounts', 'glim-account', 'create']">GLIM Loan Application</button>
<button mat-menu-item [routerLink]="['savings-accounts', 'gsim-account' , 'create']"> GSIM Application </button>
</mat-menu>
<button mat-raised-button [matMenuTriggerFor]="More">More</button>
+16
View File
@@ -312,4 +312,20 @@ export class GroupsService {
return this.http.get('/groups/template', { params: httpParams });
}
/**
* @param groupId Group Id of group to get data for.
* @returns {Observable<any>} Group GLIM Accounts data.
*/
getGLIMAccountsData(groupId: string): Observable<any> {
return this.http.get(`/groups/${groupId}/glimaccounts`);
}
/**
* @param groupId Group Id of group to get data for.
* @returns {Observable<any>} Group GSIM Accounts data.
*/
getGSIMAccountsData(groupId: string): Observable<any> {
return this.http.get(`/groups/${groupId}/gsimaccounts`);
}
}