]> git.evergreen-ils.org Git - Evergreen.git/blob - docs/admin/aged_circs.adoc
e71402d3e32f21904c04452231f4f47cd64bb511
[Evergreen.git] / docs / admin / aged_circs.adoc
1 Aging Circulations
2 ------------------
3
4 .Use case
5 ****
6 Aging circulations helps to protect patron privacy and save disk space.
7 ****
8
9 Evergreen allows for the bulk anonymization of circulation histories.  Evergreen calls this aged circulation. Circulation statistics are preserved (total circs, last checkout/renewal date, checkout/renewal/checkin workstation, etc) but patron information (name : barcode) is replaced with <Aged Circulation> text and the link to the patron record is removed.   
10
11 In the client, <Aged Circulation> will show in the patron field in Circulation History Tab and Show Last Few Circulations.
12
13 In the database, every time you attempt to `DELETE` a row from `action.circ`, it
14 copies over the appropriate data to `action.aged_circulation`,
15 then deletes the `action.circ` row.
16
17 Global Flags
18 ~~~~~~~~~~~~
19
20 There are four global flags used for aging circulations.
21
22 1. Historical Circulation Retention Age - determines the timeframe for aging circulations based on transaction age (7 days, 14 days, 30 days, etc). 
23
24 2. Historical Circulations Per Item - determines how many circulations to keep (ex. 1, 2, 3). If set to 1, Evergreen will always keep the last (most recent) circulation.
25
26 3. Historical Circulations use most recent xact_finish date instead of last circ's (true or false)
27
28 4. Historical Circulations are kept for global retention age at a minimum, regardless of user preferences (true or false)
29
30
31
32 What Data is Aged?
33 ~~~~~~~~~~~~~~~~~~
34
35 Only completed transactions are aged.  These circulations have been checked in (returned) and *do not* contain any unpaid fines or bills.  
36
37 Data that is not aged includes:
38
39 * open transactions (i.e. checked out)
40 * closed transactions with unpaid fines
41 * closed transactions with unpaid bills
42 * the last X circulation(s) (determined by historical circulations per item flag)
43
44
45 [TIP]
46 ==========
47 Aging circulations will not affect a patron being able to keep their checkout history.  Minimal metadata is stored in the patron checkout history table. Once the corresponding circulation is aged, the full circulation metadata is no longer linked to the patron's reading history.
48 ==========
49
50 [TIP]
51 ==========
52 Just aging circulations is not sufficient to protect patron circulation
53 history.  Fully protecting these data would also involve a thoughtful
54 approach to logs and backups of these data.
55 ==========
56
57 [TIP]
58 ==========
59 You can create a cron job to automatically age circulations.
60 ==========
61
62 How Circulations are Aged
63 ~~~~~~~~~~~~~~~~~~~~~~~~~
64
65 The action.aged_circulation table is for statistical reporting while breaking the link to the patron who had the item checked out.
66
67 Circulations get moved under three circumstances in stock Evergreen:
68
69 1. A patron is deleted. This moves all of the patron's circulations from action.circulation to action.aged_circulation
70
71 2. A row or row(s) in action.circulation are deleted. The action.age_circ_on_delete trigger moves deleted action.circulations to action.aged_circulation.
72
73 3. The action.purge_circulations function is run. This function is meant to be run periodically to enforce patron privacy. It's behavior is controlled by two internal flags: history.circ.retention_age and history.circ.retention_count.
74
75 [TIP]
76 ==========
77 The purge_circulations function is often run from a cron via the purge_circulations.srfsh script.
78 ==========
79
80
81 [TIP]
82 ==========
83 The purge_circulations function will take a *long* time to run for the first time on a system that has had much activity. The srfsh script will likely time out before the database function finishes and nothing will get moved.
84 ==========
85
86
87 Impacts on Billing Data
88 ~~~~~~~~~~~~~~~~~~~~~~~
89
90 Rows are deleted from money.materialized_billable_xact_summary when circulations are aged. This table is the basis for billing reports and views.
91
92 NOTE: currently grocery bills are ignored and not aged.  
93