package com.storycove.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

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

public class StoryDto {
    
    private UUID id;
    
    @NotBlank(message = "Story title is required")
    @Size(max = 255, message = "Story title must not exceed 255 characters")
    private String title;
    
    private String summary;
    
    @Size(max = 1000, message = "Story description must not exceed 1000 characters")
    private String description;
    
    private String contentHtml;
    // contentPlain removed for performance - use StoryReadingDto when content is needed
    private String sourceUrl;
    private String coverPath;
    private Integer wordCount;
    private Integer rating;
    private Double volume;
    
    // Reading progress fields
    private Boolean isRead;
    private Integer readingPosition;
    private Integer readingProgressPercentage; // Pre-calculated percentage (0-100)
    private LocalDateTime lastReadAt;
    private LocalDateTime lastCompletedAt;

    // Related entities as simple references
    private UUID authorId;
    private String authorName;
    private UUID seriesId;
    private String seriesName;
    private List<TagDto> tags;
    
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    
    public StoryDto() {}
    
    public StoryDto(String title) {
        this.title = title;
    }
    
    // Getters and Setters
    public UUID getId() {
        return id;
    }
    
    public void setId(UUID id) {
        this.id = id;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public String getSummary() {
        return summary;
    }
    
    public void setSummary(String summary) {
        this.summary = summary;
    }
    
    public String getDescription() {
        return description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    public String getContentHtml() {
        return contentHtml;
    }
    
    public void setContentHtml(String contentHtml) {
        this.contentHtml = contentHtml;
    }
    
    
    public String getSourceUrl() {
        return sourceUrl;
    }
    
    public void setSourceUrl(String sourceUrl) {
        this.sourceUrl = sourceUrl;
    }
    
    public String getCoverPath() {
        return coverPath;
    }
    
    public void setCoverPath(String coverPath) {
        this.coverPath = coverPath;
    }
    
    public Integer getWordCount() {
        return wordCount;
    }
    
    public void setWordCount(Integer wordCount) {
        this.wordCount = wordCount;
    }
    
    public Integer getRating() {
        return rating;
    }
    
    public void setRating(Integer rating) {
        this.rating = rating;
    }
    
    public Double getVolume() {
        return volume;
    }
    
    public void setVolume(Double volume) {
        this.volume = volume;
    }
    
    public Boolean getIsRead() {
        return isRead;
    }
    
    public void setIsRead(Boolean isRead) {
        this.isRead = isRead;
    }
    
    public Integer getReadingPosition() {
        return readingPosition;
    }
    
    public void setReadingPosition(Integer readingPosition) {
        this.readingPosition = readingPosition;
    }

    public Integer getReadingProgressPercentage() {
        return readingProgressPercentage;
    }

    public void setReadingProgressPercentage(Integer readingProgressPercentage) {
        this.readingProgressPercentage = readingProgressPercentage;
    }

    public LocalDateTime getLastReadAt() {
        return lastReadAt;
    }
    
    public void setLastReadAt(LocalDateTime lastReadAt) {
        this.lastReadAt = lastReadAt;
    }

    public LocalDateTime getLastCompletedAt() {
        return lastCompletedAt;
    }

    public void setLastCompletedAt(LocalDateTime lastCompletedAt) {
        this.lastCompletedAt = lastCompletedAt;
    }

    public UUID getAuthorId() {
        return authorId;
    }
    
    public void setAuthorId(UUID authorId) {
        this.authorId = authorId;
    }
    
    public String getAuthorName() {
        return authorName;
    }
    
    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }
    
    public UUID getSeriesId() {
        return seriesId;
    }
    
    public void setSeriesId(UUID seriesId) {
        this.seriesId = seriesId;
    }
    
    public String getSeriesName() {
        return seriesName;
    }
    
    public void setSeriesName(String seriesName) {
        this.seriesName = seriesName;
    }
    
    public List<TagDto> getTags() {
        return tags;
    }
    
    public void setTags(List<TagDto> tags) {
        this.tags = tags;
    }
    
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
    
    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }
    
    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }
}