All files / src/lib retention.ts

100% Statements 5/5
100% Branches 1/1
100% Functions 1/1
100% Lines 5/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16              3x 3x     1x 1x 1x    
/**
 * Retention of the secure processing environment's logs, Regulation (EU)
 * 2025/327 Art. 73(1)(e): identifiable logs of access and activity are kept
 * for at least one year. Every access event and every recorded transfer
 * carries `retainUntil`; nothing is deleted before it. Issue #206, M3.
 */
 
export const RETENTION_MONTHS = 12;
export const RETENTION_ARTICLE = "Regulation (EU) 2025/327, Art. 73(1)(e)";
 
export function retainUntil(from: Date = new Date()): Date {
  const r = new Date(from);
  r.setUTCMonth(r.getUTCMonth() + RETENTION_MONTHS);
  return r;
}