/** * 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/. */ /** Angular Imports */ import { Injectable, inject } from '@angular/core'; import { ActivatedRouteSnapshot } from '@angular/router'; /** rxjs Imports */ import { Observable } from 'rxjs'; /** Custom Services */ import { CurrentAccountsService } from '../current-accounts.service'; /** * Current Account Transaction Template data resolver. */ @Injectable() export class CurrentAccountTransactionTemplateResolver { private currentAccountsService = inject(CurrentAccountsService); /** * Returns the Current Account Transaction Template data. * @param {ActivatedRouteSnapshot} route Route Snapshot * @returns {Observable} */ resolve(route: ActivatedRouteSnapshot): Observable { const currentAccountId = route.parent.paramMap.get('currentAccountId'); const transactionId = route.paramMap.get('id'); return this.currentAccountsService.getCurrentAccountTransactionTemplate(currentAccountId, transactionId); } }