package dev.lions.unionflow.server.entity;

import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@Entity
@Table(name = "backup_config")
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class BackupConfig extends BaseEntity {

    @Column(name = "auto_backup_enabled", nullable = false)
    @Builder.Default
    private Boolean autoBackupEnabled = true;

    /** HOURLY, DAILY, WEEKLY */
    @Column(name = "frequency", nullable = false, length = 20)
    @Builder.Default
    private String frequency = "DAILY";

    @Column(name = "retention_days", nullable = false)
    @Builder.Default
    private Integer retentionDays = 30;

    /** HH:mm format, e.g. "02:00" */
    @Column(name = "backup_time", nullable = false, length = 10)
    @Builder.Default
    private String backupTime = "02:00";

    @Column(name = "include_database", nullable = false)
    @Builder.Default
    private Boolean includeDatabase = true;

    @Column(name = "include_files", nullable = false)
    @Builder.Default
    private Boolean includeFiles = false;

    @Column(name = "include_configuration", nullable = false)
    @Builder.Default
    private Boolean includeConfiguration = true;

    /** Absolute path where backup files are stored */
    @Column(name = "backup_directory", length = 500)
    private String backupDirectory;
}
