package de.assecutor.votianlt.model.invoices;

import java.time.LocalDateTime;

/**
 * Einzelner Eintrag im Änderungsprotokoll einer Rechnung gemäß R-36 bis R-39.
 *
 * Eingebettet in {@link CustomerInvoice}; wird ausschließlich angehängt, niemals
 * geändert. Hält Wer/Wann/Was/Warum sowie ggf. den erzeugten Folgebeleg fest.
 */
public class InvoiceAuditEntry {

    private LocalDateTime timestamp;
    private String userId;
    private String userDisplayName;
    private InvoiceAuditAction action;
    private String reason;

    /** Optionale Referenz auf einen erzeugten Folgebeleg (Korrektur, Storno, Ersatzrechnung). */
    private String resultingInvoiceId;
    private String resultingInvoiceNumber;

    public InvoiceAuditEntry() {
    }

    public InvoiceAuditEntry(InvoiceAuditAction action, String userId, String userDisplayName, String reason) {
        this.timestamp = LocalDateTime.now();
        this.action = action;
        this.userId = userId;
        this.userDisplayName = userDisplayName;
        this.reason = reason;
    }

    public LocalDateTime getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(LocalDateTime timestamp) {
        this.timestamp = timestamp;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserDisplayName() {
        return userDisplayName;
    }

    public void setUserDisplayName(String userDisplayName) {
        this.userDisplayName = userDisplayName;
    }

    public InvoiceAuditAction getAction() {
        return action;
    }

    public void setAction(InvoiceAuditAction action) {
        this.action = action;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getResultingInvoiceId() {
        return resultingInvoiceId;
    }

    public void setResultingInvoiceId(String resultingInvoiceId) {
        this.resultingInvoiceId = resultingInvoiceId;
    }

    public String getResultingInvoiceNumber() {
        return resultingInvoiceNumber;
    }

    public void setResultingInvoiceNumber(String resultingInvoiceNumber) {
        this.resultingInvoiceNumber = resultingInvoiceNumber;
    }
}
