package com.gnx.telemedicine.model;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.UpdateTimestamp;

import java.time.Instant;
import java.util.List;
import java.util.UUID;

@Getter
@Setter
@Entity
@Table(name = "data_processing_records")
public class DataProcessingRecord {
    @Id
    @GeneratedValue(strategy = GenerationType.UUID)
    @Column(name = "id")
    private UUID id;

    @Column(name = "processing_purpose", nullable = false)
    private String processingPurpose;

    @Column(name = "data_categories", columnDefinition = "TEXT[]")
    private List<String> dataCategories;

    @Column(name = "data_subjects", columnDefinition = "TEXT[]")
    private List<String> dataSubjects;

    @Column(name = "recipients", columnDefinition = "TEXT[]")
    private List<String> recipients;

    @Column(name = "transfers_to_third_countries", columnDefinition = "TEXT[]")
    private List<String> transfersToThirdCountries;

    @Column(name = "retention_period")
    private String retentionPeriod;

    @Column(name = "security_measures", columnDefinition = "TEXT[]")
    private List<String> securityMeasures;

    @Column(name = "data_controller")
    private String dataController;

    @Column(name = "data_processor")
    private String dataProcessor;

    @Column(name = "legal_basis")
    private String legalBasis;

    @Column(name = "created_at", nullable = false, updatable = false)
    private Instant createdAt = Instant.now();

    @UpdateTimestamp
    @Column(name = "updated_at", nullable = false)
    private Instant updatedAt = Instant.now();
}

