]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/eg2/src/app/staff/circ/patron/resolver.service.ts
LP1904036 Billing continued
[Evergreen.git] / Open-ILS / src / eg2 / src / app / staff / circ / patron / resolver.service.ts
1 import {Injectable} from '@angular/core';
2 import {Router, Resolve, RouterStateSnapshot,
3         ActivatedRouteSnapshot} from '@angular/router';
4 import {ServerStoreService} from '@eg/core/server-store.service';
5 import {NetService} from '@eg/core/net.service';
6 import {OrgService} from '@eg/core/org.service';
7 import {AuthService} from '@eg/core/auth.service';
8 import {PatronContextService} from './patron.service';
9
10
11 @Injectable()
12 export class PatronResolver implements Resolve<Promise<any[]>> {
13
14     constructor(
15         private store: ServerStoreService,
16         private context: PatronContextService
17     ) {}
18
19     resolve(
20         route: ActivatedRouteSnapshot,
21         state: RouterStateSnapshot): Promise<any[]> {
22         return this.fetchSettings();
23     }
24
25     fetchSettings(): Promise<any> {
26
27         // Some of these are used by the shared circ services.
28         // Precache them since we're making the call anyway.
29         return this.store.getItemBatch([
30           'eg.circ.patron.summary.collapse',
31           'circ.do_not_tally_claims_returned',
32           'circ.tally_lost',
33           'ui.staff.require_initials.patron_standing_penalty',
34           'ui.admin.work_log.max_entries',
35           'ui.admin.patron_log.max_entries',
36           'circ.staff_client.do_not_auto_attempt_print',
37           'circ.clear_hold_on_checkout',
38           'ui.circ.suppress_checkin_popups',
39           'ui.circ.billing.uncheck_bills_and_unfocus_payment_box',
40           'ui.circ.billing.amount_warn',
41           'ui.circ.billing.amount_limit',
42           'circ.staff_client.do_not_auto_attempt_print',
43           'circ.disable_patron_credit',
44           'credit.processor.default'
45         ]).then(settings => {
46             this.context.noTallyClaimsReturned =
47                 settings['circ.do_not_tally_claims_returned'];
48             this.context.tallyLost = settings['circ.tally_lost'];
49         });
50     }
51 }
52