feat(tellers,savings): restrict teller creation, remove cashier vault actions, and add saving share link toggle

This commit is contained in:
keshav898966
2026-06-24 13:11:54 +05:30
parent 3d9b0480c6
commit 4660a3eb15
7 changed files with 28 additions and 51 deletions
@@ -54,38 +54,6 @@
<td mat-cell *matCellDef="let cashier">{{ cashier.isFullDay | yesNo }}</td> <td mat-cell *matCellDef="let cashier">{{ cashier.isFullDay | yesNo }}</td>
</ng-container> </ng-container>
<ng-container matColumnDef="vaultActions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Vault Actions' | translate }}</th>
<td mat-cell *matCellDef="let cashier" (click)="$event.stopPropagation()">
<div class="vault-actions">
<a
class="vault-btn vault-btn--allocate"
matTooltip="{{ 'tooltips.Allocate Cash' | translate }}"
[routerLink]="[cashier.id, 'allocate']"
*mifosxHasPermission="'ALLOCATECASHIER_TELLER'"
>
<i class="fas fa-arrow-up"></i>
</a>
<a
class="vault-btn vault-btn--settle"
matTooltip="{{ 'tooltips.Settle Cash' | translate }}"
[routerLink]="[cashier.id, 'settle']"
*mifosxHasPermission="'SETTLECASHIER_TELLER'"
>
<i class="fas fa-arrow-down"></i>
</a>
<a
class="vault-btn vault-btn--view"
matTooltip="{{ 'tooltips.View Transactions' | translate }}"
[routerLink]="[cashier.id, 'transactions']"
*mifosxHasPermission="'ALLOCATECASHIER_TELLER'"
>
<i class="fas fa-eye"></i>
</a>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns" class="table-row" [routerLink]="[row.id]"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns" class="table-row" [routerLink]="[row.id]"></tr>
</table> </table>
@@ -67,8 +67,7 @@ export class CashiersComponent implements OnInit {
displayedColumns: string[] = [ displayedColumns: string[] = [
'period', 'period',
'staffName', 'staffName',
'isFullDay', 'isFullDay'
'vaultActions'
]; ];
/** Data source for cashiers table. */ /** Data source for cashiers table. */
dataSource: MatTableDataSource<any>; dataSource: MatTableDataSource<any>;
@@ -20,7 +20,7 @@
<mat-label>{{ 'labels.inputs.Filter' | translate }}</mat-label> <mat-label>{{ 'labels.inputs.Filter' | translate }}</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)" /> <input matInput (keyup)="applyFilter($event.target.value)" />
</mat-form-field> </mat-form-field>
<div class="table-buttons"> <div class="table-buttons" *ngIf="!tellersData || tellersData.length === 0">
<button <button
mat-flat-button mat-flat-button
color="primary" color="primary"
@@ -78,7 +78,5 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns" [routerLink]="[row.id]" class="table-row"></tr> <tr mat-row *matRowDef="let row; columns: displayedColumns" [routerLink]="[row.id]" class="table-row"></tr>
</table> </table>
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
</div> </div>
</div> </div>
@@ -8,7 +8,6 @@
/** Angular Imports */ /** Angular Imports */
import { Component, OnInit, ViewChild, inject } from '@angular/core'; import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort, MatSortHeader } from '@angular/material/sort'; import { MatSort, MatSortHeader } from '@angular/material/sort';
import { import {
MatTableDataSource, MatTableDataSource,
@@ -55,7 +54,6 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
MatHeaderRow, MatHeaderRow,
MatRowDef, MatRowDef,
MatRow, MatRow,
MatPaginator,
DateFormatPipe DateFormatPipe
] ]
}) })
@@ -75,8 +73,6 @@ export class TellersComponent implements OnInit {
/** Data source for tellers table. */ /** Data source for tellers table. */
dataSource: MatTableDataSource<any>; dataSource: MatTableDataSource<any>;
/** Paginator for tellers table. */
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
/** Sorter for tellers table. */ /** Sorter for tellers table. */
@ViewChild(MatSort, { static: true }) sort: MatSort; @ViewChild(MatSort, { static: true }) sort: MatSort;
@@ -110,7 +106,6 @@ export class TellersComponent implements OnInit {
*/ */
setTellers() { setTellers() {
this.dataSource = new MatTableDataSource(this.tellersData); this.dataSource = new MatTableDataSource(this.tellersData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort; this.dataSource.sort = this.sort;
} }
} }
@@ -1,4 +1,4 @@
<!-- <!--
Copyright since 2025 Mifos Initiative Copyright since 2025 Mifos Initiative
This Source Code Form is subject to the terms of the Mozilla Public This Source Code Form is subject to the terms of the Mozilla Public
@@ -115,12 +115,13 @@
<input matInput [value]="productTemplate.introducerRequired ? 'Yes' : 'No'" readonly /> <input matInput [value]="productTemplate.introducerRequired ? 'Yes' : 'No'" readonly />
</mat-form-field> </mat-form-field>
<div class="sad-field sad-info-row"> <mat-form-field appearance="outline" class="sad-field">
<span class="sad-info-label">Share Linking Enabled</span> <mat-label>Share Linking Enabled</mat-label>
<span class="sad-badge" [class.sad-badge--yes]="productTemplate.shareLinkingEnabled"> <mat-select [(ngModel)]="shareLinkingEnabled" [ngModelOptions]="{ standalone: true }">
{{ productTemplate.shareLinkingEnabled ? 'Yes' : 'No' }} <mat-option [value]="true">Yes</mat-option>
</span> <mat-option [value]="false">No</mat-option>
</div> </mat-select>
</mat-form-field>
</div> </div>
</div> </div>
@@ -70,6 +70,7 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
@Output() savingsAccountProductTemplate = new EventEmitter(); @Output() savingsAccountProductTemplate = new EventEmitter();
productTemplate: any = null; productTemplate: any = null;
shareLinkingEnabled = false;
accountTypeOptions: string[] = []; accountTypeOptions: string[] = [];
customerSegmentOptions: string[] = []; customerSegmentOptions: string[] = [];
selectedAccountType: string | null = null; selectedAccountType: string | null = null;
@@ -333,6 +334,7 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
.getSavingsAccountTemplate(entityId, productId, this.savingsAccountTemplate.groupId ? true : false) .getSavingsAccountTemplate(entityId, productId, this.savingsAccountTemplate.groupId ? true : false)
.subscribe((response: any) => { .subscribe((response: any) => {
this.productTemplate = response; this.productTemplate = response;
this.shareLinkingEnabled = !!response.shareLinkingEnabled;
this.accountTypeOptions = this.extractOptions(response.accountTypeOptions, response.accountType); this.accountTypeOptions = this.extractOptions(response.accountTypeOptions, response.accountType);
this.customerSegmentOptions = this.extractOptions(response.customerSegmentOptions, response.customerSegment); this.customerSegmentOptions = this.extractOptions(response.customerSegmentOptions, response.customerSegment);
this.selectedAccountType = response.accountType ?? null; this.selectedAccountType = response.accountType ?? null;
@@ -432,6 +434,9 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
this.introducerName = ea.introducerName ?? null; this.introducerName = ea.introducerName ?? null;
this.introducerCif = ea.introducerCifNumber ?? null; this.introducerCif = ea.introducerCifNumber ?? null;
} }
if (ea.shareLinkingEnabled !== undefined) {
this.shareLinkingEnabled = !!ea.shareLinkingEnabled;
}
this.cdr.detectChanges(); this.cdr.detectChanges();
} }
@@ -650,6 +655,8 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
value.minorDateOfBirth = this.minorDob ? this.dateUtils.formatDate(this.minorDob, 'dd MMMM yyyy') : null; value.minorDateOfBirth = this.minorDob ? this.dateUtils.formatDate(this.minorDob, 'dd MMMM yyyy') : null;
} }
value.shareLinkingEnabled = this.shareLinkingEnabled;
return value; return value;
} }
} }
@@ -116,9 +116,18 @@
<span class="preview-label">Share Linking Enabled</span> <span class="preview-label">Share Linking Enabled</span>
<span <span
class="preview-value preview-badge" class="preview-value preview-badge"
[class.preview-badge--yes]="savingsAccountProductTemplate?.shareLinkingEnabled" [class.preview-badge--yes]="
savingsAccount?.shareLinkingEnabled !== undefined
? savingsAccount.shareLinkingEnabled
: savingsAccountProductTemplate?.shareLinkingEnabled
"
> >
{{ savingsAccountProductTemplate?.shareLinkingEnabled | yesNo }} {{
(savingsAccount?.shareLinkingEnabled !== undefined
? savingsAccount.shareLinkingEnabled
: savingsAccountProductTemplate?.shareLinkingEnabled
) | yesNo
}}
</span> </span>
</div> </div>
</div> </div>