package org.raddatz.familienarchiv.dashboard;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.annotation.Nullable;
import org.raddatz.familienarchiv.audit.ActivityActorDTO;
import org.raddatz.familienarchiv.audit.AuditKind;

import java.time.OffsetDateTime;
import java.util.UUID;

public record ActivityFeedItemDTO(
        @Schema(requiredMode = Schema.RequiredMode.REQUIRED) AuditKind kind,
        @Nullable ActivityActorDTO actor,
        @Schema(requiredMode = Schema.RequiredMode.REQUIRED) UUID documentId,
        @Schema(requiredMode = Schema.RequiredMode.REQUIRED) String documentTitle,
        @Schema(requiredMode = Schema.RequiredMode.REQUIRED) OffsetDateTime happenedAt,
        @Schema(requiredMode = Schema.RequiredMode.REQUIRED) boolean youMentioned,
        @Schema(requiredMode = Schema.RequiredMode.REQUIRED) boolean youParticipated,
        @Schema(requiredMode = Schema.RequiredMode.REQUIRED) int count,
        @Nullable OffsetDateTime happenedAtUntil,
        @Nullable
        @Schema(
                requiredMode = Schema.RequiredMode.NOT_REQUIRED,
                description = "Deep-link target comment; populated only for COMMENT_ADDED and MENTION_CREATED kinds."
        )
        UUID commentId,
        @Nullable
        @Schema(
                requiredMode = Schema.RequiredMode.NOT_REQUIRED,
                description = "Annotation associated with the comment; populated only for COMMENT_ADDED and MENTION_CREATED kinds."
        )
        UUID annotationId,
        @Nullable
        @Schema(
                requiredMode = Schema.RequiredMode.NOT_REQUIRED,
                description = "Plain-text preview of the comment body (HTML stripped server-side, truncated to 120 chars); null for non-comment feed items or deleted comments."
        )
        String commentPreview
) {}
