package de.frigosped.dc.model;

import java.time.LocalDateTime;

/**
 * DTO für ORDS-Endpunkt GET /api/dc/projects/:id/documents/
 * Kein BLOB; has_original_text / has_translated_text kommen als 0/1.
 */
public class OrdsDocument {

    private Long id;
    private String filename;
    private String mimeType;
    private Long documentTypeId;
    private Long catalogId;
    private LocalDateTime uploadedAt;
    private String status;
    private Integer progress;
    private Integer hasOriginalText;    // 0 oder 1
    private Integer hasTranslatedText;  // 0 oder 1
    private Long parentDocumentId;      // gesetzt bei heruntergeladenen Referenzen
    private Integer isReference;        // 0 = Originaldokument, 1 = Referenz
    private String sourceUrl;           // Ursprungs-URL der Referenz
    private Integer rowVersion;
    private LocalDateTime created;
    private LocalDateTime updated;

    public OrdsDocument() {}

    public Long getId()                          { return id; }
    public void setId(Long id)                   { this.id = id; }

    public String getFilename()                  { return filename; }
    public void setFilename(String filename)     { this.filename = filename; }

    public String getMimeType()                  { return mimeType; }
    public void setMimeType(String mimeType)     { this.mimeType = mimeType; }

    public Long getDocumentTypeId()              { return documentTypeId; }
    public void setDocumentTypeId(Long v)        { this.documentTypeId = v; }

    public Long getCatalogId()                   { return catalogId; }
    public void setCatalogId(Long catalogId)     { this.catalogId = catalogId; }

    public LocalDateTime getUploadedAt()         { return uploadedAt; }
    public void setUploadedAt(LocalDateTime v)   { this.uploadedAt = v; }

    public String getStatus()                    { return status; }
    public void setStatus(String status)         { this.status = status; }

    public Integer getProgress()                 { return progress; }
    public void setProgress(Integer progress)    { this.progress = progress; }

    public Integer getHasOriginalText()          { return hasOriginalText; }
    public void setHasOriginalText(Integer v)    { this.hasOriginalText = v; }

    public Integer getHasTranslatedText()        { return hasTranslatedText; }
    public void setHasTranslatedText(Integer v)  { this.hasTranslatedText = v; }

    public Long getParentDocumentId()            { return parentDocumentId; }
    public void setParentDocumentId(Long v)      { this.parentDocumentId = v; }

    public Integer getIsReference()              { return isReference; }
    public void setIsReference(Integer v)        { this.isReference = v; }

    /** true, wenn dieses Dokument eine heruntergeladene Referenz ist. */
    public boolean isReference()                 { return Integer.valueOf(1).equals(isReference); }

    public String getSourceUrl()                 { return sourceUrl; }
    public void setSourceUrl(String v)           { this.sourceUrl = v; }

    public Integer getRowVersion()               { return rowVersion; }
    public void setRowVersion(Integer v)         { this.rowVersion = v; }

    public LocalDateTime getCreated()            { return created; }
    public void setCreated(LocalDateTime v)      { this.created = v; }

    public LocalDateTime getUpdated()            { return updated; }
    public void setUpdated(LocalDateTime v)      { this.updated = v; }
}
