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>
</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-row *matRowDef="let row; columns: displayedColumns" class="table-row" [routerLink]="[row.id]"></tr>
</table>
@@ -67,8 +67,7 @@ export class CashiersComponent implements OnInit {
displayedColumns: string[] = [
'period',
'staffName',
'isFullDay',
'vaultActions'
'isFullDay'
];
/** Data source for cashiers table. */
dataSource: MatTableDataSource<any>;
@@ -20,7 +20,7 @@
<mat-label>{{ 'labels.inputs.Filter' | translate }}</mat-label>
<input matInput (keyup)="applyFilter($event.target.value)" />
</mat-form-field>
<div class="table-buttons">
<div class="table-buttons" *ngIf="!tellersData || tellersData.length === 0">
<button
mat-flat-button
color="primary"
@@ -78,7 +78,5 @@
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns" [routerLink]="[row.id]" class="table-row"></tr>
</table>
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
</div>
</div>
@@ -8,7 +8,6 @@
/** Angular Imports */
import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort, MatSortHeader } from '@angular/material/sort';
import {
MatTableDataSource,
@@ -55,7 +54,6 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
MatHeaderRow,
MatRowDef,
MatRow,
MatPaginator,
DateFormatPipe
]
})
@@ -75,8 +73,6 @@ export class TellersComponent implements OnInit {
/** Data source for tellers table. */
dataSource: MatTableDataSource<any>;
/** Paginator for tellers table. */
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
/** Sorter for tellers table. */
@ViewChild(MatSort, { static: true }) sort: MatSort;
@@ -110,7 +106,6 @@ export class TellersComponent implements OnInit {
*/
setTellers() {
this.dataSource = new MatTableDataSource(this.tellersData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}
}
@@ -1,4 +1,4 @@
<!--
<!--
Copyright since 2025 Mifos Initiative
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 />
</mat-form-field>
<div class="sad-field sad-info-row">
<span class="sad-info-label">Share Linking Enabled</span>
<span class="sad-badge" [class.sad-badge--yes]="productTemplate.shareLinkingEnabled">
{{ productTemplate.shareLinkingEnabled ? 'Yes' : 'No' }}
</span>
</div>
<mat-form-field appearance="outline" class="sad-field">
<mat-label>Share Linking Enabled</mat-label>
<mat-select [(ngModel)]="shareLinkingEnabled" [ngModelOptions]="{ standalone: true }">
<mat-option [value]="true">Yes</mat-option>
<mat-option [value]="false">No</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
@@ -70,6 +70,7 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
@Output() savingsAccountProductTemplate = new EventEmitter();
productTemplate: any = null;
shareLinkingEnabled = false;
accountTypeOptions: string[] = [];
customerSegmentOptions: string[] = [];
selectedAccountType: string | null = null;
@@ -333,6 +334,7 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
.getSavingsAccountTemplate(entityId, productId, this.savingsAccountTemplate.groupId ? true : false)
.subscribe((response: any) => {
this.productTemplate = response;
this.shareLinkingEnabled = !!response.shareLinkingEnabled;
this.accountTypeOptions = this.extractOptions(response.accountTypeOptions, response.accountType);
this.customerSegmentOptions = this.extractOptions(response.customerSegmentOptions, response.customerSegment);
this.selectedAccountType = response.accountType ?? null;
@@ -432,6 +434,9 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
this.introducerName = ea.introducerName ?? null;
this.introducerCif = ea.introducerCifNumber ?? null;
}
if (ea.shareLinkingEnabled !== undefined) {
this.shareLinkingEnabled = !!ea.shareLinkingEnabled;
}
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.shareLinkingEnabled = this.shareLinkingEnabled;
return value;
}
}
@@ -116,9 +116,18 @@
<span class="preview-label">Share Linking Enabled</span>
<span
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>
</div>
</div>