package de.assecutor.votianlt.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.bson.types.ObjectId;

import java.time.LocalDateTime;

/**
 * Photo entity for storing photo data from task completions. References the job
 * ObjectId and stores base64 encoded photos.
 */
@Data
@Document(collection = "photos")
public class Photo {

    @Id
    private ObjectId id;

    private ObjectId taskId;
    private String photo; // base64 encoded photos
    private LocalDateTime createdAt;
    private String completedBy;

    // Default constructor
    public Photo() {
        this.createdAt = LocalDateTime.now();
    }

    // Constructor with parameters
    public Photo(ObjectId taskId, String photo, String completedBy) {
        this();
        this.taskId = taskId;
        this.photo = photo;
        this.completedBy = completedBy;
    }
}