import { Entity, PrimaryColumn, Column } from 'typeorm';

/**
 * Daily-rotating salt for visitor_id_daily. One row per UTC day.
 * Salts older than ~7 days are purged to make historical re-identification
 * mathematically impossible (cookie-free, GDPR-clean).
 */
@Entity('visitor_salts')
export class VisitorSalt {
  /** UTC date (YYYY-MM-DD). Stored as DATE, no time component. */
  @PrimaryColumn({ type: 'date' })
  day!: string;

  /** 32 random bytes. */
  @Column({ type: 'bytea' })
  salt!: Buffer;
}
