- Add ClerkUiStateService with full account state save/restore (no double network call on back navigation) - Add Photo & Signature, Standing Instructions, Today's Activity as dedicated nav pages - Remove photo/signature, standing instructions, linked accounts, today's activity panels from main dashboard - Add ESC key to exit fullscreen; clicking Clerk nav immediately restores fullscreen without re-navigating - Compact clerk dashboard UI with reduced font sizes and padding throughout - Add CashierOnlyGuard for route protection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
64 lines
1.8 KiB
TypeScript
64 lines
1.8 KiB
TypeScript
/**
|
|
* Copyright since 2025 Mifos Initiative
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
import { Injectable } from '@angular/core';
|
|
import { BehaviorSubject } from 'rxjs';
|
|
|
|
export interface ClerkSavedAccount {
|
|
accountDetails: any;
|
|
clientDetails: any;
|
|
kycDetails: any;
|
|
nominees: any[];
|
|
jointHolders: any[];
|
|
clientAddresses: any[];
|
|
nonPersonDetails: any;
|
|
clientPhotoUrl: string | null;
|
|
signatureUrl: string | null;
|
|
accountNotes: any[];
|
|
standingInstructions: any[];
|
|
todayTransactions: any[];
|
|
linkedAccounts: any;
|
|
sameDayNeftRtgs: number;
|
|
sameDayChequeClearing: number;
|
|
selectedRow: any;
|
|
}
|
|
|
|
export interface ClerkUiState {
|
|
accountLoaded: boolean;
|
|
facilities: { label: string; active: boolean }[];
|
|
savedRow: { acNo: string; acTyp: string } | null;
|
|
savedAccount: ClerkSavedAccount | null;
|
|
}
|
|
|
|
@Injectable({ providedIn: 'root' })
|
|
export class ClerkUiStateService {
|
|
private readonly _state = new BehaviorSubject<ClerkUiState>({
|
|
accountLoaded: false,
|
|
facilities: [],
|
|
savedRow: null,
|
|
savedAccount: null
|
|
});
|
|
readonly state$ = this._state.asObservable();
|
|
|
|
get snapshot(): ClerkUiState {
|
|
return this._state.value;
|
|
}
|
|
|
|
setFacilities(facilities: { label: string; active: boolean }[], acNo: string, acTyp: string): void {
|
|
this._state.next({ ...this._state.value, accountLoaded: true, facilities, savedRow: { acNo, acTyp } });
|
|
}
|
|
|
|
saveFullState(account: ClerkSavedAccount): void {
|
|
this._state.next({ ...this._state.value, savedAccount: account });
|
|
}
|
|
|
|
clear(): void {
|
|
this._state.next({ accountLoaded: false, facilities: [], savedRow: null, savedAccount: null });
|
|
}
|
|
}
|