const MILLISECONDS_PER_DAY = 86_400_000;
export class RetentionPolicy {
    retentionDays;
    constructor(retentionDays) {
        this.retentionDays = retentionDays;
    }
    static create(days = 14) {
        if (!Number.isInteger(days) || days < 1) {
            throw new Error('Retention days must be a positive integer (minimum 1)');
        }
        return new RetentionPolicy(days);
    }
    get days() {
        return this.retentionDays;
    }
    isExpired(fileDate, now = new Date()) {
        const cutoff = new Date(now.getTime() - this.retentionDays * MILLISECONDS_PER_DAY);
        return fileDate.getTime() < cutoff.getTime();
    }
}
//# sourceMappingURL=retentionPolicy.valueObject.js.map